X Search

Get X Posts by Username

Retrieve user's timeline posts by specifying their username. This endpoint fetches the latest tweets posted by the user associated with the provided username.

Billing metadata: successful billable responses include the X-Desearch-Cost-Usd, X-Desearch-Usage-Count, X-Desearch-Service, and X-Desearch-Currency headers. JSON object responses also include optional cost_usd, usage_count, service, and currency fields. For example, usage_count=10 at $0.015 / 1,000 resolves to cost_usd=0.00015. JSON arrays, text, and streaming responses keep their body shape and expose billing metadata only through headers.

get/twitter/user/posts

Request

  • Base URL: https://api.desearch.ai
  • URL: https://api.desearch.ai/twitter/user/posts
  • Auth: API key in header Authorization

Query parameters

usernamestring required

Username to fetch posts for

cursorstring nullable

Cursor for pagination

Response

A JSON object mapping X Posts

next_cursorstring nullable

Cursor for pagination

Example response

{
  "user": {
    "id": "123456789",
    "url": "https://twitter.com/example_user",
    "name": "John Doe",
    "username": "johndoe",
    "created_at": "2023-01-01T00:00:00Z",
    "description": "This is an example user description.",
    "favourites_count": 100,
    "followers_count": 1500,
    "followings_count": 100,
    "listed_count": 10,
    "media_count": 50,
    "profile_image_url": "https://example.com/profile.jpg",
    "profile_banner_url": "https://example.com/banner.jpg",
    "statuses_count": 500,
    "verified": true,
    "is_blue_verified": true,
    "entities": {
      "description": {
        "urls": [
          {
            "display_url": "example.com",
            "expanded_url": "https://example.com/full-url",
            "url": "https://t.co/short",
            "indices": [
              50,
              73
            ]
          }
        ]
      },
      "url": {
        "urls": [
          {
            "display_url": "example.com",
            "expanded_url": "https://example.com/full-url",
            "url": "https://t.co/short",
            "indices": [
              50,
              73
            ]
          }
        ]
      }
    },
    "can_dm": true,
    "can_media_tag": true,
    "location": "Jamaica",
    "pinned_tweet_ids": [
      "123456789",
      "987654321"
    ],
    "professional": {
      "professional_type": "Business",
      "category": [
        {
          "id": 1,
          "name": "Technology"
        }
      ]
    },
    "affiliates_highlighted_label": {
      "label": {
        "badge": {
          "url": "https://pbs.twimg.com/profile_images/2005664281002491904/bz2ZO_nU_bigger.jpg"
        },
        "description": "Polymarket",
        "url": {
          "url": "https://twitter.com/Polymarket",
          "url_type": "DeepLink"
        },
        "user_label_display_type": "Badge",
        "user_label_type": "BusinessLabel"
      }
    },
    "website": "https://t.co/4sVzS0XYIW"
  },
  "tweets": [
    {
      "user": {
        "id": "123456789",
        "url": "https://twitter.com/example_user",
        "name": "John Doe",
        "username": "johndoe",
        "created_at": "2023-01-01T00:00:00Z",
        "description": "This is an example user description.",
        "favourites_count": 100,
        "followers_count": 1500,
        "followings_count": 100,
        "listed_count": 10,
        "media_count": 50,
        "profile_image_url": "https://example.com/profile.jpg",
        "profile_banner_url": "https://example.com/banner.jpg",
        "statuses_count": 500,
        "verified": true,
        "is_blue_verified": true,
        "entities": {
          "description": {
            "urls": [
              {
                "display_url": "example.com",
                "expanded_url": "https://example.com/full-url",
                "url": "https://t.co/short",
                "indices": [
                  50,
                  73
                ]
              }
            ]
          },
          "url": {
            "urls": [
              {
                "display_url": "example.com",
                "expanded_url": "https://example.com/full-url",
                "url": "https://t.co/short",
                "indices": [
                  50,
                  73
                ]
              }
            ]
          }
        },
        "can_dm": true,
        "can_media_tag": true,
        "location": "Jamaica",
        "pinned_tweet_ids": [
          "123456789",
          "987654321"
        ],
        "professional": {
          "professional_type": "Business",
          "category": [
            {
              "id": 1,
              "name": "Technology"
            }
          ]
        },
        "affiliates_highlighted_label": {
          "label": {
            "badge": {
              "url": "https://pbs.twimg.com/profile_images/2005664281002491904/bz2ZO_nU_bigger.jpg"
            },
            "description": "Polymarket",
            "url": {
              "url": "https://twitter.com/Polymarket",
              "url_type": "DeepLink"
            },
            "user_label_display_type": "Badge",
            "user_label_type": "BusinessLabel"
          }
        },
        "website": "https://t.co/4sVzS0XYIW"
      },
      "id": "987654321",
      "text": "This is an example tweet.",
      "reply_count": 10,
      "view_count": 1000,
      "retweet_count": 5,
      "like_count": 100,
      "quote_count": 2,
      "bookmark_count": 3,
      "url": "https://twitter.com/example_tweet",
      "created_at": "2023-01-01T00:00:00Z",
      "media": [],
      "lang": "en",
      "conversation_id": "987654321",
      "in_reply_to_screen_name": "someuser",
      "in_reply_to_status_id": "987654320",
      "in_reply_to_user_id": "123456789",
      "quoted_status_id": "987654319",
      "display_text_range": [
        0,
        280
      ],
      "entities": {
        "hashtags": [
          {
            "indices": [
              0,
              5
            ],
            "text": "AAPL"
          }
        ],
        "media": [
          {
            "display_url": "pic.twitter.com/example",
            "expanded_url": "https://twitter.com/user/status/123/photo/1",
            "id_str": "1234567890123456789",
            "indices": [
              100,
              123
            ],
            "media_key": "3_1234567890123456789",
            "media_url_https": "https://pbs.twimg.com/media/example.jpg",
            "type": "photo",
            "url": "https://t.co/example",
            "additional_media_info": {
              "monetizable": true,
              "source_user": {}
            },
            "ext_media_availability": {
              "status": "available"
            },
            "features": {
              "large": {
                "faces": []
              },
              "medium": {
                "faces": []
              },
              "small": {
                "faces": []
              },
              "orig": {
                "faces": []
              }
            },
            "sizes": {
              "large": {
                "w": 1200,
                "h": 675,
                "resize": "fit"
              },
              "medium": {
                "w": 1200,
                "h": 675,
                "resize": "fit"
              },
              "small": {
                "w": 1200,
                "h": 675,
                "resize": "fit"
              },
              "thumb": {
                "w": 1200,
                "h": 675,
                "resize": "fit"
              }
            },
            "original_info": {
              "height": 1080,
              "width": 1920,
              "focus_rects": []
            },
            "allow_download_status": {
              "allow_download": true
            },
            "video_info": {
              "duration_millis": 30000,
              "aspect_ratio": [
                16,
                9
              ],
              "variants": [
                {
                  "content_type": "video/mp4",
                  "url": "https://video.twimg.com/example.mp4",
                  "bitrate": 2176000
                }
              ]
            },
            "media_results": {
              "result": {
                "media_key": "3_1234567890123456789"
              }
            }
          }
        ],
        "symbols": [
          {
            "indices": [
              0,
              5
            ],
            "text": "AAPL"
          }
        ],
        "urls": [
          {
            "display_url": "example.com",
            "expanded_url": "https://example.com/full-url",
            "url": "https://t.co/short",
            "indices": [
              50,
              73
            ]
          }
        ],
        "user_mentions": [
          {
            "id_str": "123456789",
            "name": "John Doe",
            "screen_name": "johndoe",
            "indices": [
              0,
              10
            ]
          }
        ]
      },
      "extended_entities": {
        "media": [
          {
            "display_url": "pic.twitter.com/example",
            "expanded_url": "https://twitter.com/user/status/123/photo/1",
            "id_str": "1234567890123456789",
            "indices": [
              100,
              123
            ],
            "media_key": "3_1234567890123456789",
            "media_url_https": "https://pbs.twimg.com/media/example.jpg",
            "type": "photo",
            "url": "https://t.co/example",
            "additional_media_info": {
              "monetizable": true,
              "source_user": {}
            },
            "ext_media_availability": {
              "status": "available"
            },
            "features": {
              "large": {
                "faces": []
              },
              "medium": {
                "faces": []
              },
              "small": {
                "faces": []
              },
              "orig": {
                "faces": []
              }
            },
            "sizes": {
              "large": {
                "w": 1200,
                "h": 675,
                "resize": "fit"
              },
              "medium": {
                "w": 1200,
                "h": 675,
                "resize": "fit"
              },
              "small": {
                "w": 1200,
                "h": 675,
                "resize": "fit"
              },
              "thumb": {
                "w": 1200,
                "h": 675,
                "resize": "fit"
              }
            },
            "original_info": {
              "height": 1080,
              "width": 1920,
              "focus_rects": []
            },
            "allow_download_status": {
              "allow_download": true
            },
            "video_info": {
              "duration_millis": 30000,
              "aspect_ratio": [
                16,
                9
              ],
              "variants": [
                {
                  "content_type": "video/mp4",
                  "url": "https://video.twimg.com/example.mp4",
                  "bitrate": 2176000
                }
              ]
            },
            "media_results": {
              "result": {
                "media_key": "3_1234567890123456789"
              }
            }
          }
        ]
      },
      "article": {
        "id": "2036821104418029568",
        "title": "How to become so creative it feels illegal",
        "cover_media": {
          "url": "https://pbs.twimg.com/media/example.jpg",
          "width": 1920,
          "height": 768
        }
      },
      "content_disclosure": {
        "advertising_disclosure": {
          "is_paid_promotion": true
        }
      },
      "edit_control": {
        "edit_tweet_ids": [
          "987654321"
        ],
        "editable_until_msecs": "1784103100000",
        "edits_remaining": "5"
      }
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.