Does X (Twitter) have an API?
Yes: X sells an official API for posts, users and search, paid per use from prepaid credits. SocialToAI reads its publicly visible posts, comments, accounts and trends without a X developer account: 20 interfaces from 1 credit a call (≈ $0.002–$0.0033), and failed calls are free. Official facts checked 2026-10-17.
The short answer
Yes: X sells an official API for posts, users and search, paid per use from prepaid credits.
What the official API allows
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 own developer documentation, checked 2026-10-17. What a platform allows changes; its own pages are the authority.
Reading X's public data with SocialToAI
SocialToAI is an API and MCP server for publicly visible content and account information. You need no X account and no app review: one SocialToAI key, or signing in from Claude, ChatGPT, Claude Code, Cursor and Codex. Each call costs a fixed number of credits, and a failed call costs nothing.
| Interface | What it returns | Price key | Credits |
|---|---|---|---|
| Search | Find posts by keyword: text, author, likes, comment count, views and publish time. | x.search | 2 |
| Search · sort=latest | Find posts by keyword: text, author, likes, comment count, views and publish time. | x.search:latest | 2 |
| Search · type=user | Find accounts by keyword: name, bio, followers, following and post count. | x.search:user | 5 |
| Trending | What is trending now: title, rank and heat. | x.trending | 6 |
| Detail | One post by ID or link: text, author, likes, comment count, views and publish time. | x.detail | 1 |
| Comments | The comments under one post: text, likes, reply count and time. | x.comments | 2 |
| User Profile | One account: name, bio, followers, following and post count. | x.user_profile | 1 |
| User Posts | The recent posts of one account. | x.user_posts | 2 |
| Community profile | Get an X community by its ID. | x.community | 1 |
| Community posts | Get a page of the posts in an X community by the community's ID. | x.community_posts | 4 |
| List posts | Get a page of the posts on an X list's timeline by the list's ID, newest first, about 100 a page. | x.list_posts | 2 |
| Article detail | Get the long-form article attached to an X post by the post's ID. | x.article | 2 |
8 more on the X (Twitter) API page.
curl https://api.socialtoai.com/v1/search \ -H "Authorization: Bearer $SOCIALTOAI_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{ "platform": "x", "query": "weather forecast" }'- No X account, cookie or developer approval on your side.
- What comes back is what the platform shows publicly; commenters are anonymised.
- Every platform answers in the same response format, so the same code reads X and the others.
- Prepaid credits from 1 credit a call; 100 free credits on sign-up, no card.
Sources
- X: docs.x.com, checked 2026-10-17
- X (Twitter) API on SocialToAI: every call and its credits, last tested 2026-10-17
- The live catalog: what is offered now and its credits, readable without a key
Last updated: