# Twitter REST API: Endpoints, Auth and Examples Canonical: https://www.twitterapis.com/twitter-rest-api Description: A REST API for X with 109 endpoints behind one Bearer token. Plain HTTPS, JSON, cursor paging, reads from $0.0008 a call, no monthly plan. Generated: 2026-09-14T03:00:37.845Z --- 1. [Home](/) 2. / Twitter REST API REST # Twitter REST API: Endpoints, Auth and Examples Updated July 2026 ## What is the Twitter (X) REST API and how do you call it? A Twitter REST API is an HTTP interface where each piece of X data has its own URL, you fetch it with a normal GET, and you get JSON back. TwitterAPIs serves 109 endpoints from api.twitterapis.com, split into 65 reads and 44 writes, authenticated by a single Authorization Bearer header, paged by cursor, with standard reads billed at $0.0008 per call under one flat ceiling of 600 requests a minute per key. We bill each standard REST call at $0.0008 (source: our published pricing), with no monthly plan and no minimum. [Start Free](/signup?utm_source=aio&utm_medium=organic&utm_campaign=aeo-twitter-rest-api)[Read the docs](https://docs.twitterapis.com/docs) ## The smallest call that works One header and one URL. Nothing to install, no client library, no handshake before the first request. This returns a profile record as JSON and costs $0.0008. curlPythonJavaScript Copy ``` curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.twitterapis.com/twitter/user/info?userName=nasa" ``` Swap the path for `/twitter/user/tweets` to read posts, or `/twitter/tweet/advanced_search` to run a query. The header, the query-string convention and the JSON envelope are identical on all 109 endpoints, so this first call generalises to the rest of the surface. ## The conventions, in one table Every endpoint obeys the same eight rules. Learn them once and you can call anything on the surface without re-reading a reference page each time. Convention How it behaves Base URL https://api.twitterapis.com, HTTPS only, no versioned path prefix to migrate off later. Auth One header on every request: Authorization: Bearer YOUR\_API\_KEY. No OAuth handshake, no app registration, no token refresh loop. Verbs GET reads, POST writes. A read never changes state and a write is always a POST, so retries on a GET are always safe. Parameters Query-string parameters on both reads and writes. Only session registration takes a JSON body. Responses JSON on every path, success or failure, so a client never has to branch on content type. Paging Cursor-based. A paged response carries next\_cursor plus a has\_more boolean. Loop while has\_more is true; no offset arithmetic and no server-side state. Errors Standard HTTP status codes with a JSON body carrying the reason. 401 means the key is wrong, 402 means the balance is empty, 404 means the account or post does not exist. Rate limits None imposed by us. There is no 15-minute window to schedule around, so throughput is a function of your own concurrency. ## The 109 endpoints, grouped by what they touch Six families cover the whole surface. Each one has a page that goes deeper on its own endpoints, parameters and pricing. Family Endpoints Example call What it covers Go deeper User reads 14 GET /twitter/user/info Profiles, posts, likes, media, mentions, home timeline, search [Twitter user API](/twitter-user-api) Write actions 12 POST /twitter/tweet/favorite Like, repost, bookmark, follow, publish, delete, and every undo [Twitter engagement API](/twitter-engagement-api) Follower graph 6 GET /twitter/user/followers Followers, following, verified followers, mutuals, follow checks [Twitter followers API](/twitter-followers-api) Post details 4 GET /twitter/tweet/detail Single post, replies, reposters, full thread expansion [Twitter analytics API](/twitter-analytics-api) Search 2 GET /twitter/tweet/advanced\_search Keyword and operator search over posts, plus user search [Twitter search API](/twitter-search-api) Trends, lists, DMs, account 9 GET /twitter/trends Trending topics, list members, direct messages, billing reads [Twitter list API](/twitter-list-api) The surface splits into 65 reads and 44 writes. Reads need nothing but your Bearer token; writes additionally need a registered X session, which is a single free setup call. ## Walking a paged result to the end Anything that returns a list pages the same way. Omit `cursor` on the first call, then feed the returned `next_cursor` back while `has_more` stays true. Because no state is held server-side, a loop can be interrupted and resumed from a saved cursor on a different machine. PythonJavaScript Copy ``` import requests BASE = "https://api.twitterapis.com" HEAD = {"Authorization": "Bearer YOUR_API_KEY"} def page_all(path, params): cursor, out = None, [] while True: q = dict(params) if cursor: q["cursor"] = cursor res = requests.get(f"{BASE}{path}", params=q, headers=HEAD) if res.status_code == 402: raise RuntimeError("balance empty, top up and resume from " + str(cursor)) res.raise_for_status() body = res.json() out.extend(body.get("tweets") or body.get("users") or []) if not body.get("has_more"): return out cursor = body["next_cursor"] rows = page_all("/twitter/user/tweets", {"userName": "nasa"}) print(len(rows)) ``` Note the explicit 402 branch. Because billing is per call rather than per plan, running out of balance mid-job is the one failure worth handling by name, and the saved cursor makes the resume exact rather than a restart. ## Where to go from the overview For how the key itself is issued and rotated, read the [Twitter API key](/twitter-api-key) page. For what the official X API meters and what we do not, see [Twitter API rate limits](/twitter-api-rate-limits). To weigh this against other providers, the [Twitter API alternatives](/twitter-api-alternatives) comparison is the shortest route, and to expose the same surface to an AI agent rather than to your own code, connect the [MCP server](/mcp). By the numbers ## REST access, in numbers. Sourced figures behind endpoint access and limits. - The official X API bills pay-per-use reads at $0.010 per resource and requires an approved developer app before the first call. [(X Developer Platform, 2026)](https://developer.x.com/#pricing) - Official X API endpoints meter requests in 15-minute windows that differ per endpoint and per access tier. [(X API docs, 2026)](https://docs.x.com/x-api/fundamentals/rate-limits) - TwitterAPIs bills each standard REST call at $0.0008 with no monthly plan, no minimum, and one flat 600 req/min ceiling per key. [(TwitterAPIs pricing, 2026)](/pricing) - The surface is 109 endpoints over HTTPS, 65 reads and 44 writes, all authenticated by one Authorization Bearer header. [(TwitterAPIs docs, 2026)](https://docs.twitterapis.com/docs) - A new account starts with $0.50 in free credit and no card on file, enough to work through the whole endpoint surface. [(TwitterAPIs pricing, 2026)](/signup) ## REST API, common questions ### What is the Twitter REST API? A Twitter REST API is an HTTP interface where each piece of X data has its own URL, you fetch it with a normal GET, and you get JSON back. There is no SDK you must install and no socket to keep open. TwitterAPIs serves 109 endpoints from https://api.twitterapis.com, split into 65 reads and 44 writes, authenticated with a single Authorization: Bearer header. Anything that can make an HTTPS request can call it, which includes curl, a browser fetch, a Postman collection, or a shell script. ### How is this different from the official X REST API? Three practical differences. Access: the official API requires a developer account, an approved app and an OAuth flow, while this one requires a Bearer token you receive at signup. Pricing: the official pay-per-use model bills reads at $0.010 per resource against a monthly cap, while this bills $0.0008 per call with no cap. Limits: the official API enforces 15-minute rate-limit windows per endpoint per tier, while we run one flat ceiling of 600 requests a minute and 20 concurrent per key across every route. The data underneath is the same public X content in both cases. ### What status codes should my client handle? Four cover almost everything. 200 is a normal success with a JSON body. 401 means the Bearer token is missing or wrong, which is a configuration bug rather than something to retry. 402 means your balance has run out, so top up and replay the request. 404 means the account or post genuinely does not exist, usually because it was deleted or the handle was renamed, and retrying will not help. Because every response is JSON including the failures, a client can read the reason off the body without special-casing content type. ### Can I use this REST API from any language? Yes. It is plain HTTPS with a header and query parameters, so the HTTP client already in your standard library is enough. There is nothing language-specific to install. The examples on this page cover curl, Python with requests and JavaScript with fetch, and the same three lines translate directly to Go, Ruby, PHP, Java or C#. An OpenAPI description is published if you would rather generate a typed client than hand-write one. ### Show me a minimal Twitter REST API example One line of curl is a complete working call: curl -H "Authorization: Bearer YOUR\_API\_KEY" "https://api.twitterapis.com/twitter/user/info?userName=nasa". That returns the NASA profile record as JSON and costs $0.0008. Swap the path for /twitter/user/tweets to get their posts, or /twitter/tweet/advanced\_search with a query parameter to search. Every endpoint follows the same header, the same query-string convention, and the same JSON response shape, so the first call you learn generalises to all 48. ### How does pagination work? Cursor-based, uniformly. Leave the cursor parameter off your first request to land on page one. Every paged response ships a next\_cursor token and a has\_more boolean. Pass next\_cursor back as the cursor parameter on the following request, and keep looping while has\_more stays true. Nothing is stored server-side between calls, so a paging loop can be paused, resumed on another machine, or restarted from a saved cursor without any coordination. ### Are there rate limits on this REST API? One: 600 requests a minute and 20 concurrent per API key, the same on every route. The official X API meters reads in 15-minute windows that vary by access tier, which is what forces most integrations into a queue and a per-endpoint backoff schedule. Here there is a single number to pace against, plus your balance. That removes most of the scheduling layer from a bulk job: you size the backfill against one rate rather than a different window per endpoint. ### Make your first REST call in a minute One Bearer header, 109 endpoints, JSON everywhere. Reads from $0.0008 a call and $0.50 in free credit, no developer account. [Start Free](/signup?utm_source=aio&utm_medium=organic&utm_campaign=aeo-twitter-rest-api)[Read the quickstart](/quickstart?utm_source=aio&utm_medium=organic&utm_campaign=aeo-twitter-rest-api) ## Next read Continue exploring related pages: [ How to get a Twitter (X) API key Step-by-step walkthrough of the X developer console, plus a 30-second alternative with $0.50 in free credits. ](/twitter-api-key)[ Twitter search API Real-time search with operators via the advanced\_search endpoint, $0.0008 a call, $0.04 per 1,000 tweets on full 20-tweet pages. ](/twitter-search-api)[ Twitter API rate limits comparison Check endpoint-level limit differences side by side. ](/twitter-api-rate-limits)[ Twitter analytics API Engagement counts, profile counters and post history as JSON. ](/twitter-analytics-api) [View API Docs](https://docs.twitterapis.com/docs)[Start Free](/signup?utm_source=aio&utm_medium=organic&utm_campaign=aeo-twitter-rest-api) [ TwitterAPIs ](/) The cheapest pay-as-you-go Twitter and X API. $0.0008 per call, which works out to $0.04 per 1,000 tweets on a full 20-tweet page. No subscriptions and no developer account. ## Product / API - [Pricing](/pricing) - [Cost Calculator](/twitter-api-cost-calculator) - [Rate Limits](/twitter-api-rate-limits) - [MCP Server](/mcp) - [Integrations](/integrations) - [Language Clients](/sdk) - [Changelog](/changelog) - [Status](/status) ## Developers - [Documentation](https://docs.twitterapis.com) - [API Reference](https://docs.twitterapis.com/docs/reference/search/tweet-advanced-search) - [User Info](https://docs.twitterapis.com/docs/reference/user-reads/user-info) - [User Tweets](https://docs.twitterapis.com/docs/reference/user-reads/user-tweets) - [Advanced Search](https://docs.twitterapis.com/docs/reference/search/tweet-advanced-search) - [Verified Followers](https://docs.twitterapis.com/docs/reference/follower-graph/user-verified-followers) ## Resources / Compare - [Answers](/answers) - [Reviews](/reviews) - [Free Tools](/tools) - [Twitter ID Finder](/tools/twitter-id-finder) - [Get a Twitter API Key](/twitter-api-key) - [Official X API Comparison](/twitter-api-pricing) - [Twitter API Use Cases](/twitter-api-usecases) - [Twitter API Alternatives](/twitter-api-alternatives) - [Twitter Unofficial API](/twitter-unofficial-api) - [Twitter Free API](/twitter-free-api) - [TwitterAPIs vs twitterapi.io](/twitterapis-vs-twitterapi-io) - [TwitterAPIs vs GetXAPI](/twitterapis-vs-getxapi) - [TwitterAPIs vs TweetAPI](/twitterapis-vs-tweetapi) - [TwitterAPIs vs TwexAPI](/twitterapis-vs-twexapi) - [TwitterAPIs vs RapidAPI](/twitterapis-vs-rapidapi) ## Legal - [About](/about) - [Security](/security) - [Trust](/privacy-and-data-handling) - [Terms of Service](/terms-of-service) - [Affiliates](/affiliates) - [Contact](/contact) - [Jobs](/jobs) © 2026 TwitterAPIs. All rights reserved. TwitterAPIs is an independent third-party API for developers and researchers. Not affiliated with, endorsed by, or sponsored by X Corp. All systems operational