API CatalogTwitter/X API

Twitter/X API Collection

Build social listening tools, trend dashboards, lead research workflows, and AI data pipelines with normalized Twitter/X data. This collection wraps a third-party Twitter data provider behind ApiMask-owned response schemas so integrations stay stable if the upstream provider changes.

Open Twitter/X API on RapidAPI

Base URL and authentication

https://twitter-x-api.p.rapidapi.com
HeaderValue
X-RapidAPI-KeyYour RapidAPI key
X-RapidAPI-Hosttwitter-x-api.p.rapidapi.com

See Authentication, Rate limits, and Errors for shared behavior.

Endpoints

EndpointMethodDescription
/v1/twitter/profileGETGet a profile by username
/v1/twitter/user-tweetsGETGet latest tweets for a username
/v1/twitter/searchGETSearch tweets by keyword, hashtag, or advanced query
/v1/twitter/tweetGETGet tweet details by tweet ID
/v1/twitter/repliesGETGet replies for a tweet

Get profile

GET /v1/twitter/profile?username=elonmusk
curl --request GET \
  --url "https://twitter-x-api.p.rapidapi.com/v1/twitter/profile?username=elonmusk" \
  --header "X-RapidAPI-Key: $RAPIDAPI_KEY" \
  --header "X-RapidAPI-Host: twitter-x-api.p.rapidapi.com"

Get user tweets

GET /v1/twitter/user-tweets?username=elonmusk&limit=20&include_replies=false

Query params:

FieldTypeRequiredDescription
usernamestringYesTwitter/X username, with or without @.
limitnumberNoNumber of tweets to return, max 20.
cursorstringNoPagination cursor from the previous response.
include_repliesbooleanNoInclude replies in the user timeline.

Search tweets

GET /v1/twitter/search?query=AI&type=latest&limit=20

Query params:

FieldTypeRequiredDescription
querystringYesKeyword, hashtag, or Twitter advanced search query.
typelatest | topNoSort mode. Defaults to latest.
limitnumberNoNumber of tweets to return, max 20.
cursorstringNoPagination cursor from the previous response.

Get tweet

GET /v1/twitter/tweet?tweet_id=123456789

Get replies

GET /v1/twitter/replies?tweet_id=123456789&sort=relevance&limit=20

Query params:

FieldTypeRequiredDescription
tweet_idstringYesTweet ID to fetch replies for.
sortrelevance | latest | likesNoReply sort mode. Defaults to relevance.
limitnumberNoNumber of replies to return, max 20.
cursorstringNoPagination cursor from the previous response.

Example response

{
  "success": true,
  "data": {
    "tweets": [
      {
        "id": "123456789",
        "url": "https://x.com/user/status/123456789",
        "text": "Example tweet text",
        "created_at": "Tue Dec 10 07:00:30 +0000 2024",
        "author": {
          "id": "44196397",
          "username": "example",
          "display_name": "Example User",
          "verified": true
        },
        "metrics": {
          "retweet_count": 10,
          "reply_count": 5,
          "like_count": 100,
          "quote_count": 2,
          "view_count": 1000
        },
        "data_source": "twitterapi_io",
        "as_of": "2026-01-01T00:00:00+00:00"
      }
    ],
    "page_info": {
      "has_next_page": true,
      "next_cursor": "cursor"
    },
    "result_count": 1,
    "data_source": "twitterapi_io",
    "as_of": "2026-01-01T00:00:00+00:00"
  },
  "error": null,
  "meta": {
    "request_id": "req_5d7a1c0e23bb"
  }
}

Use cases

  • Social listening and brand monitoring
  • Twitter/X search dashboards
  • Creator and influencer research
  • Tweet reply analysis
  • Market and sentiment research
  • AI and LLM data workflows