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| Header | Value |
|---|---|
X-RapidAPI-Key | Your RapidAPI key |
X-RapidAPI-Host | twitter-x-api.p.rapidapi.com |
See Authentication, Rate limits, and Errors for shared behavior.
Endpoints
| Endpoint | Method | Description |
|---|---|---|
/v1/twitter/profile | GET | Get a profile by username |
/v1/twitter/user-tweets | GET | Get latest tweets for a username |
/v1/twitter/search | GET | Search tweets by keyword, hashtag, or advanced query |
/v1/twitter/search/insights | GET | Analyze search results with deterministic insights |
/v1/twitter/brand/mentions | GET | Monitor brand mentions and social listening signals |
/v1/twitter/profile/insights | GET | Analyze profile performance and recent tweet topics |
/v1/twitter/tweet | GET | Get tweet details by tweet ID |
/v1/twitter/replies | GET | Get replies for a tweet |
/v1/twitter/tweet/conversation-insights | GET | Analyze replies for sentiment, questions, objections, and controversy |
/v1/twitter/thread | GET | Extract a thread as normalized tweets, text, and markdown |
Get profile
GET /v1/twitter/profile?username=elonmuskcurl --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=falseQuery params:
| Field | Type | Required | Description |
|---|---|---|---|
username | string | Yes | Twitter/X username, with or without @. |
limit | number | No | Number of tweets to return, max 20. |
cursor | string | No | Pagination cursor from the previous response. |
include_replies | boolean | No | Include replies in the user timeline. |
Search tweets
GET /v1/twitter/search?query=AI&type=latest&limit=20Query params:
| Field | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Keyword, hashtag, or Twitter advanced search query. |
type | latest | top | No | Sort mode. Defaults to latest. |
limit | number | No | Number of tweets to return, max 20. |
cursor | string | No | Pagination cursor from the previous response. |
Search insights
GET /v1/twitter/search/insights?query=AI&type=latest&limit=20Returns 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=20Query params:
| Field | Type | Required | Description |
|---|---|---|---|
brand | string | Yes | Brand, product, company, or keyword to monitor. |
keywords | string | No | Comma-separated related terms to include. |
exclude_keywords | string | No | Comma-separated terms to exclude. |
type | latest | top | No | Sort mode. Defaults to latest. |
limit | number | No | Number of mentions to analyze, max 20. |
cursor | string | No | Pagination 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=falseReturns 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=2075367885438890134Get replies
GET /v1/twitter/replies?tweet_id=2075367885438890134&sort=relevance&limit=20Query params:
| Field | Type | Required | Description |
|---|---|---|---|
tweet_id | string | Yes | Tweet ID to fetch replies for. |
sort | relevance | latest | likes | No | Reply sort mode. Defaults to relevance. |
limit | number | No | Number of replies to return, max 20. |
cursor | string | No | Pagination cursor from the previous response. |
Conversation insights
GET /v1/twitter/tweet/conversation-insights?tweet_id=2075367885438890134&sort=relevance&reply_limit=20Returns 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=20Query params:
| Field | Type | Required | Description |
|---|---|---|---|
tweet_id | string | Yes | Tweet ID to extract thread context for. |
format | json | text | markdown | No | Preferred thread format. Defaults to json. |
limit | number | No | Number of thread tweets to return, max 20. |
cursor | string | No | Pagination 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