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.
Last tested: Last updated:
/v1/search200 OK2 creditsplatform: "x" · query: "weather forecast"nullcollects 145views 8,357reposts 121titlemetrics.sharesis_pinned6 actions.
Plus 13 only X has.
Open a row to see its request. Its full parameters and response fields are on its own page.
SearchFind posts by keyword: text, author, likes, comment count, views and publish time./v1/search2 credits≈ $0.0067
platformquery+1 optionalsort=latestnewest first2 creditstype=useraccounts instead of posts5 creditscurl 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 headerTrendingWhat is trending now: title, rank and heat./v1/trending6 credits≈ $0.02
platform+2 optionalcurl 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 headerDetailOne post by ID or link: text, author, likes, comment count, views and publish time./v1/detail1 credit≈ $0.0033
platformid or urlinclude=transcriptthe transcript of the video2 creditscurl 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 headerCommentsThe comments under one post: text, likes, reply count and time./v1/comments2 credits≈ $0.0067
platformidcurl 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 headerUser ProfileOne account: name, bio, followers, following and post count./v1/user_profile1 credit≈ $0.0033
platformid or usernamecurl 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 headerUser PostsThe recent posts of one account./v1/user_posts2 credits≈ $0.0067
platformusername+1 optionalcurl 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 headerCompared 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.
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.
idcurl 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 headerCommunity 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.
idcurl 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 headerList 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.
idcurl 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 headerCommunity 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.
idcurl 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 headerList 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.
idcurl 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 headerList 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.
idcurl 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 headerArticle 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.
idcurl 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 headerPost 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.
idcurl 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 headerPost 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.
idcurl 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 headerThread 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.
idcurl 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 headerUser 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.
usernamecurl 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 headerUser 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.
usernamecurl 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 headerUser 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.
usernamecurl 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 headerWhat a whole job costs.
| The job | How it adds up | Credits | About |
|---|---|---|---|
| Search 1,000 results on X | usually 20 a page, 50 pages | 100 credits | about $0.33 |
| Read 1,000 X comments | usually 35 a page, 29 pages | 58 credits | about $0.19 |
| Backfill one X account: a list of 200 posts and 20 in full | 10 list pages + 20 full reads | 40 credits | about $0.13 |
| Watch 1 X account daily, at most a month | 9 credits × 31 days | 279 credits | about $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.
Which is bigger on X this week: home coffee or matcha?
- search“home coffee”2 credits
- search“matcha”2 credits
Read the comments on this X post and tell me what people complain about.
- detailthe post you pasted1 credit
- commentsfirst 3 pages6 credits
Find five X accounts that post about camping coffee and show me what they posted lately.
- searchaccounts · “camping coffee”5 credits
- user_posts5 accounts10 credits
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.
{ "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}titlemetrics.sharesis_pinned{ "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}author.verifiedauthor.followersmetrics.viewsmetrics.reposts7 tools read X.
All toolsDoes 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 it | Cost | Limits | Source | |
|---|---|---|---|---|
| X API, pay per use | Any 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 |
| SocialToAI | Anyone 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
- Comments API, every platformWhich platforms give comments, how many a page, at what price.
- Transcript API, every platformWhich platforms give a transcript, timed or not.
- How to let AI read X when the official API is too expensiveX's official prices, with sources, and reading X per call instead
- How to analyze video comments with AI, and keep the original wordswhat comments say, with original words: the tool or your AI, price per platform, a recorded answer
- How to get the numbers for hundreds of post links at oncethe numbers of hundreds of links in one job: prices per platform, what the free credits run, and what it stops for
- How to search X by date with since and untilsince and until, as parameters or in the query, tested, with what a month of posts costs
- Monitor X (Twitter) every day: what it really costsan X keyword or account, daily, 2 credits a run, with the month worked out against X's own price
- Monitor competitors' accounts every daycompetitors' accounts, daily: what is new and what beat their usual, from 9 credits an account
- Monitor brand mentions every day, with the posts behind thema brand, daily, across platforms: attitudes and the posts behind them, from 16 credits a run
- X (Twitter) trending todayToday's board in one list, refreshed daily.
- X (Twitter) MCP serverLet your AI read X.