API CatalogTwitter/X API

Twitter/X Data API

Build social listening tools, trend dashboards, lead research workflows, and AI data pipelines with normalized Twitter/X data. This API wraps a third-party Twitter data provider behind ApiMask-owned response schemas so integrations stay stable if the upstream provider changes. Intelligence endpoints use deterministic analysis for predictable engagement, sentiment, topic, and conversation signals.

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/search/insightsGETAnalyze search results with deterministic insights
/v1/twitter/brand/mentionsGETMonitor brand mentions and social listening signals
/v1/twitter/profile/insightsGETAnalyze profile performance and recent tweet topics
/v1/twitter/tweetGETGet tweet details by tweet ID
/v1/twitter/repliesGETGet replies for a tweet
/v1/twitter/tweet/conversation-insightsGETAnalyze replies for sentiment, questions, objections, and controversy
/v1/twitter/threadGETExtract a thread as normalized tweets, text, and markdown

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=OpenAI&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.

Search insights

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

Returns the matching tweets plus deterministic insight fields including total_engagement, average_engagement, sentiment, top_hashtags, top_mentions, top_authors, common_terms, and top_tweets.

Brand mentions

GET /v1/twitter/brand/mentions?brand=OpenAI&keywords=ChatGPT,API&type=latest&limit=20

Query params:

FieldTypeRequiredDescription
brandstringYesBrand, product, company, or keyword to monitor.
keywordsstringNoComma-separated related terms to include.
exclude_keywordsstringNoComma-separated terms to exclude.
typelatest | topNoSort mode. Defaults to latest.
limitnumberNoNumber of mentions to analyze, max 20.
cursorstringNoPagination cursor from the previous response.

Returns mention tweets plus deterministic social listening fields including mention_count, sentiment, top_complaints, top_praise, top_accounts, top_hashtags, and notable_mentions.

Profile insights

GET /v1/twitter/profile/insights?username=OpenAI&tweet_limit=20&include_replies=false

Returns the profile, recent tweets, and deterministic profile performance fields including average_likes, average_replies, average_retweets, average_engagement, engagement_score, best_performing_tweets, common_topics, top_hashtags, and posting_style.

Get tweet

GET /v1/twitter/tweet?tweet_id=2075367885438890134

Get replies

GET /v1/twitter/replies?tweet_id=2075367885438890134&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.

Conversation insights

GET /v1/twitter/tweet/conversation-insights?tweet_id=2075367885438890134&sort=relevance&reply_limit=20

Returns the original tweet, sampled replies, and deterministic conversation fields including sentiment, top_questions, top_objections, notable_replies, and controversy_score.

Thread extractor

GET /v1/twitter/thread?tweet_id=2075367885438890134&format=markdown&limit=20

Query params:

FieldTypeRequiredDescription
tweet_idstringYesTweet ID to extract thread context for.
formatjson | text | markdownNoPreferred thread format. Defaults to json.
limitnumberNoNumber of thread tweets to return, max 20.
cursorstringNoPagination cursor from the previous response.

Example response

{
  "success": true,
  "data": {
    "tweets": [
      {
        "id": "2075367885438890134",
        "url": "https://x.com/user/status/2075367885438890134",
        "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
  • Brand mention monitoring
  • Thread extraction for newsletters, research, and AI workflows
  • AI and LLM data workflows