Introduction
TwittrAPI is a REST API for public Twitter/X data. Send your key in a header, get X's JSON back, pay per call from a prepaid balance.
TwittrAPI is a REST API for public X (Twitter) data: profiles, tweets, followers, search, lists, communities, jobs and trends. You do not need an X developer account. TwittrAPI is not affiliated with X Corp.
How it works
- Base URL:
https://api.twittrapi.com - Auth: your API key in the
X-API-KEYheader. See Authentication. - Requests: plain HTTPS. Read endpoints are
GETwith path and query parameters. - Responses: the JSON that X's own web app receives, passed through unchanged, with a few documented exceptions. See Response format.
- Billing: one call is one billed request, from a prepaid balance. Calls that fail with 400, 407, 408, 409 or a 5xx error are refunded. See Pricing and billing.
- Limits: a per-key limit in requests per second. See Rate limits.
curl 'https://api.twittrapi.com/user/by/username/jack' \
--header 'X-API-KEY: YOUR_API_KEY'curl 'https://twitter-aio.p.rapidapi.com/user/by/username/jack' \
--header 'x-rapidapi-host: twitter-aio.p.rapidapi.com' \
--header 'x-rapidapi-key: YOUR_API_KEY'Where to go next
- First request: get a key and make a call with curl, Python, Node.js or Go.
- API reference: every read endpoint with parameters, limits, errors and examples.
- Account actions: post, reply, like, follow, DMs, lists and more with your own X account, cookie and proxy.
- SDKs and integrations: Python, Node.js and Go clients, an MCP server, n8n, LangChain, LlamaIndex, Apify and Make.
- For AI agents: how an agent gets a key, the MCP server, budget and retry rules. Machine-readable: OpenAPI spec, all docs in one Markdown file, pricing as JSON.
- Switching from another provider? Migration guides with endpoint mappings: from twitterapi.io, from SocialData and from the official X API.
What you can and cannot get
The read endpoints return public data only: what a logged-out visitor or any logged-in user could see. Protected accounts and other private content are not available through them.
Write endpoints act on your own X account: post (with media, a poll or a schedule), reply, like, retweet, follow, bookmarks, mute, block, lists, communities, drafts, profile, media upload and direct messages. They need your X session cookie and your own proxy, and cost the same per call as reads. See Account actions.