SocialToAIStart freeConsole

X (Twitter) API

Posts, comments, accounts, trends.

The X (Twitter) API lets you search posts and read post details, comments, account profiles, an account's posts and the trending list, with no X account or login. Calls cost 1 to 6 credits each (from $0.002); failed calls are free. Use it over HTTP with an API key, or through MCP from your AI client. Last tested 2026-11-05.

6 of 6actions available
From 1 creditper call
Same formatas every other call

Last tested: Last updated:

POST/v1/search200 OK2 credits
platform: "x" · query: "weather forecast"
@…·7,425 followers·
likes 238comments 37shares nullcollects 145views 8,357reposts 121
Always null here:titlemetrics.sharesis_pinned
pageNext pagecursor
billingThis call2 credits
Sample data1 of the 20 items recorded

6 actions.
Plus 13 only X has.

Open a row to see its request. Its full parameters and response fields are on its own page.

ActionsCredits per call
SearchFind posts by keyword: text, author, likes, comment count, views and publish time./v1/search2 credits≈ $0.0067
You send
platformquery+1 optional
sort=latestnewest first2 credits
type=useraccounts instead of posts5 credits
X (Twitter) Search API: All parameters and response fields
Sign in to run2 creditsOpens this call in the Playground after you sign in. It never runs by itself, and a failed call is not charged.
cURL
curl https://api.socialtoai.com/v1/search \  -H "Authorization: Bearer $SOCIALTOAI_API_KEY" \  -H "Idempotency-Key: $(uuidgen)" \  -H "Content-Type: application/json" \  -d '{    "platform": "x",    "query": "weather forecast"  }'
POST /v1/searchYour key goes in the Authorization header
TrendingWhat is trending now: title, rank and heat./v1/trending6 credits≈ $0.02
You send
platform+2 optional
X (Twitter) Trending API: All parameters and response fields
Sign in to run6 creditsOpens this call in the Playground after you sign in. It never runs by itself, and a failed call is not charged.
cURL
curl https://api.socialtoai.com/v1/trending \  -H "Authorization: Bearer $SOCIALTOAI_API_KEY" \  -H "Idempotency-Key: $(uuidgen)" \  -H "Content-Type: application/json" \  -d '{    "platform": "x"  }'
POST /v1/trendingYour key goes in the Authorization header
DetailOne post by ID or link: text, author, likes, comment count, views and publish time./v1/detail1 credit≈ $0.0033
You send
platformid or url
include=transcriptthe transcript of the video2 credits
X (Twitter) Detail API: All parameters and response fields
Sign in to run1 creditOpens this call in the Playground after you sign in. It never runs by itself, and a failed call is not charged.
cURL
curl https://api.socialtoai.com/v1/detail \  -H "Authorization: Bearer $SOCIALTOAI_API_KEY" \  -H "Idempotency-Key: $(uuidgen)" \  -H "Content-Type: application/json" \  -d '{    "platform": "x",    "id": "2108198226532708497"  }'
POST /v1/detailYour key goes in the Authorization header
CommentsThe comments under one post: text, likes, reply count and time./v1/comments2 credits≈ $0.0067
You send
platformid
X (Twitter) Comments API: All parameters and response fields
Sign in to run2 creditsOpens this call in the Playground after you sign in. It never runs by itself, and a failed call is not charged.
cURL
curl https://api.socialtoai.com/v1/comments \  -H "Authorization: Bearer $SOCIALTOAI_API_KEY" \  -H "Idempotency-Key: $(uuidgen)" \  -H "Content-Type: application/json" \  -d '{    "platform": "x",    "id": "2108198226532708497"  }'
POST /v1/commentsYour key goes in the Authorization header
User ProfileOne account: name, bio, followers, following and post count./v1/user_profile1 credit≈ $0.0033
You send
platformid or username
X (Twitter) User Profile API: All parameters and response fields
Sign in to run1 creditOpens this call in the Playground after you sign in. It never runs by itself, and a failed call is not charged.
cURL
curl https://api.socialtoai.com/v1/user_profile \  -H "Authorization: Bearer $SOCIALTOAI_API_KEY" \  -H "Idempotency-Key: $(uuidgen)" \  -H "Content-Type: application/json" \  -d '{    "platform": "x",    "id": "11348282"  }'
POST /v1/user_profileYour key goes in the Authorization header
User PostsThe recent posts of one account./v1/user_posts2 credits≈ $0.0067
You send
platformusername+1 optional
X (Twitter) User Posts API: All parameters and response fields
Sign in to run2 creditsOpens this call in the Playground after you sign in. It never runs by itself, and a failed call is not charged.
cURL
curl https://api.socialtoai.com/v1/user_posts \  -H "Authorization: Bearer $SOCIALTOAI_API_KEY" \  -H "Idempotency-Key: $(uuidgen)" \  -H "Content-Type: application/json" \  -d '{    "platform": "x",    "username": "NASA"  }'
POST /v1/user_postsYour key goes in the Authorization header

Compared with Reddit: X posts also give author followers, saves, reposts, views and hashtags but do not give title or shares; its accounts also give followers and following.

Only on X · Communities and listsCredits per call
Community profileGet an X community by its ID.x.community1 credit≈ $0.0033

Get an X community by its ID: name, description, members, moderators, how people join, when it was created.

id
X (Twitter) community profile API: All parameters and response fields
Sign in to run1 creditOpens this call in the Playground after you sign in. It never runs by itself, and a failed call is not charged.
cURL
curl https://api.socialtoai.com/v1/call/x.community \  -H "Authorization: Bearer $SOCIALTOAI_API_KEY" \  -H "Idempotency-Key: $(uuidgen)" \  -H "Content-Type: application/json" \  -d '{    "id": "1493446837214187523"  }'
POST /v1/call/x.communityYour key goes in the Authorization header
Community postsGet a page of the posts in an X community by the community's ID.x.community_posts4 credits≈ $0.013

Get a page of the posts in an X community by the community's ID.

id
X (Twitter) community posts API: All parameters and response fields
Sign in to run4 creditsOpens this call in the Playground after you sign in. It never runs by itself, and a failed call is not charged.
cURL
curl https://api.socialtoai.com/v1/call/x.community_posts \  -H "Authorization: Bearer $SOCIALTOAI_API_KEY" \  -H "Idempotency-Key: $(uuidgen)" \  -H "Content-Type: application/json" \  -d '{    "id": "1539231166569410560"  }'
POST /v1/call/x.community_postsYour key goes in the Authorization header
List postsGet a page of the posts on an X list's timeline by the list's ID, newest first, about 100 a page.x.list_posts2 credits≈ $0.0067

Get a page of the posts on an X list's timeline by the list's ID, newest first, about 100 a page.

id
X (Twitter) list posts API: All parameters and response fields
Sign in to run2 creditsOpens this call in the Playground after you sign in. It never runs by itself, and a failed call is not charged.
cURL
curl https://api.socialtoai.com/v1/call/x.list_posts \  -H "Authorization: Bearer $SOCIALTOAI_API_KEY" \  -H "Idempotency-Key: $(uuidgen)" \  -H "Content-Type: application/json" \  -d '{    "id": "84839422"  }'
POST /v1/call/x.list_postsYour key goes in the Authorization header
Community membersGet a page of the accounts that have joined an X community, by the community's ID, about 20 a page.x.community_members5 credits≈ $0.017

Get a page of the accounts that have joined an X community, by the community's ID, about 20 a page: handle, name, bio, follower count, verification.

id
X (Twitter) community members API: All parameters and response fields
Sign in to run5 creditsOpens this call in the Playground after you sign in. It never runs by itself, and a failed call is not charged.
cURL
curl https://api.socialtoai.com/v1/call/x.community_members \  -H "Authorization: Bearer $SOCIALTOAI_API_KEY" \  -H "Idempotency-Key: $(uuidgen)" \  -H "Content-Type: application/json" \  -d '{    "id": "1539231166569410560"  }'
POST /v1/call/x.community_membersYour key goes in the Authorization header
List followersGet accounts that follow an X list, by the list's ID, up to 20.x.list_followers5 credits≈ $0.017

Get accounts that follow an X list, by the list's ID, up to 20: handle, name, bio, follower count, verification. This page only, with no further page.

id
X (Twitter) list followers API: All parameters and response fields
Sign in to run5 creditsOpens this call in the Playground after you sign in. It never runs by itself, and a failed call is not charged.
cURL
curl https://api.socialtoai.com/v1/call/x.list_followers \  -H "Authorization: Bearer $SOCIALTOAI_API_KEY" \  -H "Idempotency-Key: $(uuidgen)" \  -H "Content-Type: application/json" \  -d '{    "id": "84839422"  }'
POST /v1/call/x.list_followersYour key goes in the Authorization header
List membersGet a page of the accounts an X list is made of, by the list's ID, 20 a page.x.list_members5 credits≈ $0.017

Get a page of the accounts an X list is made of, by the list's ID, 20 a page: handle, name, bio, follower count, verification.

id
X (Twitter) list members API: All parameters and response fields
Sign in to run5 creditsOpens this call in the Playground after you sign in. It never runs by itself, and a failed call is not charged.
cURL
curl https://api.socialtoai.com/v1/call/x.list_members \  -H "Authorization: Bearer $SOCIALTOAI_API_KEY" \  -H "Idempotency-Key: $(uuidgen)" \  -H "Content-Type: application/json" \  -d '{    "id": "84839422"  }'
POST /v1/call/x.list_membersYour key goes in the Authorization header
Only on X · Content and accountsCredits per call
Article detailGet the long-form article attached to an X post by the post's ID.x.article2 credits≈ $0.0067

Get the long-form article attached to an X post by the post's ID: title, full text, author, time published, and its like, reply and view counts.

id
X (Twitter) article detail API: All parameters and response fields
Sign in to run2 creditsOpens this call in the Playground after you sign in. It never runs by itself, and a failed call is not charged.
cURL
curl https://api.socialtoai.com/v1/call/x.article \  -H "Authorization: Bearer $SOCIALTOAI_API_KEY" \  -H "Idempotency-Key: $(uuidgen)" \  -H "Content-Type: application/json" \  -d '{    "id": "1905545699552375179"  }'
POST /v1/call/x.articleYour key goes in the Authorization header
Post quotesGet a page of the X posts that quote a post, newest first or most popular first.x.quotes4 credits≈ $0.013

Get a page of the X posts that quote a post, newest first or most popular first.

id
X (Twitter) post quotes API: All parameters and response fields
Sign in to run4 creditsOpens this call in the Playground after you sign in. It never runs by itself, and a failed call is not charged.
cURL
curl https://api.socialtoai.com/v1/call/x.quotes \  -H "Authorization: Bearer $SOCIALTOAI_API_KEY" \  -H "Idempotency-Key: $(uuidgen)" \  -H "Content-Type: application/json" \  -d '{    "id": "2108662426606395572"  }'
POST /v1/call/x.quotesYour key goes in the Authorization header
Post retweetersGet a page of the accounts that retweeted an X post, by the post's ID.x.retweeters2 credits≈ $0.0067

Get a page of the accounts that retweeted an X post, by the post's ID: handle, name, bio, follower count.

id
X (Twitter) post retweeters API: All parameters and response fields
Sign in to run2 creditsOpens this call in the Playground after you sign in. It never runs by itself, and a failed call is not charged.
cURL
curl https://api.socialtoai.com/v1/call/x.retweeters \  -H "Authorization: Bearer $SOCIALTOAI_API_KEY" \  -H "Idempotency-Key: $(uuidgen)" \  -H "Content-Type: application/json" \  -d '{    "id": "2108198226532708497"  }'
POST /v1/call/x.retweetersYour key goes in the Authorization header
Thread contextGet the posts of an X thread by the ID of any post in it.x.thread9 credits≈ $0.03

Get the posts of an X thread by the ID of any post in it: the root post, the author's follow-ups and the replies among them.

id
X (Twitter) thread context API: All parameters and response fields
Sign in to run9 creditsOpens this call in the Playground after you sign in. It never runs by itself, and a failed call is not charged.
cURL
curl https://api.socialtoai.com/v1/call/x.thread \  -H "Authorization: Bearer $SOCIALTOAI_API_KEY" \  -H "Idempotency-Key: $(uuidgen)" \  -H "Content-Type: application/json" \  -d '{    "id": "2108198226532708497"  }'
POST /v1/call/x.threadYour key goes in the Authorization header
User followersGet a page of the accounts following an X user, up to 200 a page, newest followers first.x.followers12 credits≈ $0.04

Get a page of the accounts following an X user, up to 200 a page, newest followers first.

username
X (Twitter) user followers API: All parameters and response fields
Sign in to run12 creditsOpens this call in the Playground after you sign in. It never runs by itself, and a failed call is not charged.
cURL
curl https://api.socialtoai.com/v1/call/x.followers \  -H "Authorization: Bearer $SOCIALTOAI_API_KEY" \  -H "Idempotency-Key: $(uuidgen)" \  -H "Content-Type: application/json" \  -d '{    "username": "NASA"  }'
POST /v1/call/x.followersYour key goes in the Authorization header
User followingGet a page of the accounts an X user follows, up to 200 a page.x.following12 credits≈ $0.04

Get a page of the accounts an X user follows, up to 200 a page.

username
X (Twitter) user following API: All parameters and response fields
Sign in to run12 creditsOpens this call in the Playground after you sign in. It never runs by itself, and a failed call is not charged.
cURL
curl https://api.socialtoai.com/v1/call/x.following \  -H "Authorization: Bearer $SOCIALTOAI_API_KEY" \  -H "Idempotency-Key: $(uuidgen)" \  -H "Content-Type: application/json" \  -d '{    "username": "WHO"  }'
POST /v1/call/x.followingYour key goes in the Authorization header
User mentionsGet a page of the posts that mention an X user, newest first.x.mentions4 credits≈ $0.013

Get a page of the posts that mention an X user, newest first.

username
X (Twitter) user mentions API: All parameters and response fields
Sign in to run4 creditsOpens this call in the Playground after you sign in. It never runs by itself, and a failed call is not charged.
cURL
curl https://api.socialtoai.com/v1/call/x.mentions \  -H "Authorization: Bearer $SOCIALTOAI_API_KEY" \  -H "Idempotency-Key: $(uuidgen)" \  -H "Content-Type: application/json" \  -d '{    "username": "NASA"  }'
POST /v1/call/x.mentionsYour key goes in the Authorization header

What a whole job costs.

The jobHow it adds upCreditsAbout
Search 1,000 results on Xusually 20 a page, 50 pages100 creditsabout $0.33
Read 1,000 X commentsusually 35 a page, 29 pages58 creditsabout $0.19
Backfill one X account: a list of 200 posts and 20 in full10 list pages + 20 full reads40 creditsabout $0.13
Watch 1 X account daily, at most a month9 credits × 31 days279 creditsabout $0.93

Priced at the $10 pack; larger purchases bring it down. A watch runs only while it is on, and you can pause it at any time. There is no subscription.

Or skip the parameters.
Just ask.

Connect SocialToAI once over MCP. Your AI picks the calls, and you see what each one cost.

You ask01

Which is bigger on X this week: home coffee or matcha?

Your AI calls
  • search“home coffee”2 credits
  • search“matcha”2 credits
Total4 credits
You ask02

Read the comments on this X post and tell me what people complain about.

Your AI calls
  • detailthe post you pasted1 credit
  • commentsfirst 3 pages6 credits
Total7 credits
You ask03

Find five X accounts that post about camping coffee and show me what they posted lately.

Your AI calls
  • searchaccounts · “camping coffee”5 credits
  • user_posts5 accounts10 credits
Total15 credits

X (Twitter) MCP Server

Same shape on every platform.
Learn it once.

A X post and a Xiaohongshu note come back with the same field names. What a platform cannot give comes back as null.

Xdetail · 1 credit
{  "platform": "x",  "id": "…",  "ref": "…",  "approx": [],  "type": "content",  "url": "https://example.com/…",  "format": "video",  "title": null,  "text": "…",  "published_at": "2026-10-08T14:10:00.000Z",  "author": {    "id": "…",    "username": "…",    "name": "…",    "verified": true,    "followers": 932620  },  "metrics": {    "likes": 155,    "comments": 7,    "shares": null,    "collects": 11,    "views": 10638,    "reposts": 40  },  "images": [],  "hashtags": [],  "is_pinned": null}
Null on X:titlemetrics.sharesis_pinned
Xiaohongshudetail · 12 credits
{  "platform": "xiaohongshu",  "id": "…",  "ref": "…",  "approx": [],  "type": "content",  "url": "https://example.com/…",  "format": "image",  "title": "…",  "text": "…",  "published_at": "2026-10-09T01:00:34.000Z",  "author": {    "id": "…",    "username": "…",    "name": "…",    "verified": null,    "followers": null  },  "metrics": {    "likes": 927,    "comments": 122,    "shares": 256,    "collects": 59,    "views": null,    "reposts": null  },  "images": ["https://example.com/…", "https://example.com/…"],  "hashtags": ["…", "…"],  "is_pinned": false}
Null on Xiaohongshu:author.verifiedauthor.followersmetrics.viewsmetrics.reposts
Sample dataThe fields are always there; only the values differ.

7 tools read X.

All tools

Does X have an official API?

X offers an official API for posts, users and search. Developers sign up in the X developer console and pay per use with prepaid credits; higher volumes need an Enterprise plan.

Source: X's developer documentation, checked 2026-10-17.

Who can use itCostLimitsSource
X API, pay per useAny developer: sign up in the X developer console and buy prepaid credits.$0.005 per post read, $0.010 per user read, charged per resource returned.Up to 3 million post reads per billing cycle; more needs an Enterprise plan. X says prices may change.docs.x.com, checked 2026-10-29
SocialToAIAnyone with a key; no X account of yours and no review.From 1 credit a call (≈$0.0033); failed calls are free.Publicly visible content only; up to 60 items a call.Pricing

1,000 posts here: about 50 x.search calls (typically 20 a page), 100 credits, $0.33 at the first pack; at X's own $0.005 a post they are $5. Estimate your cost

X official API: access, prices and limitsX API cost calculator

The same calls work on 17 more.

All platforms and prices

Your AI is one URL away
from all of social media.

100 credits on sign-up, no card needed