Skip to content

QUICKSTART

How to Start With the TwitterAPIs API

You need one Bearer key and a single HTTP call. Sign up, copy the key, and send a GET to tweet/advanced_search with an Authorization: Bearer header. No X developer account, no review queue, no card. New accounts start with $0.50 in free credits, and your first read call costs $0.0008.

Quick answer

How do you start with the TwitterAPIs API?

The TwitterAPIs API is a hosted Twitter and X data API you call with one Bearer key and a single HTTP request, with no X developer account or approval queue. Sign up, copy your key, and send a GET to https://api.twitterapis.com/twitter/tweet/advanced_search with an Authorization: Bearer header, live in under a minute. Every new account includes $0.50 in free credits and the first read call costs $0.0008.

Your First Call, in One Line

Swap $TWITTERAPIS_KEY for the key in your dashboard. This searches recent tweets and returns a page of about 20 results.

curl
curl "https://api.twitterapis.com/twitter/tweet/advanced_search?query=from%3Anaval%20min_faves%3A1000&product=Latest" \
  -H "Authorization: Bearer $TWITTERAPIS_KEY"

A 200 returns JSON with a tweets array and a next_cursor. A 401 means the key is wrong or missing; re-copy it and check the header.

1

Get a key

Sign up with Google or email. Your Bearer key exists right away, with no developer account, no review queue, and no card. Every new account starts with $0.50 in free credits, enough for around 625 read calls.

2

Make your first call

Send a GET to tweet/advanced_search with your key in the Authorization header. That single curl line returns a page of matching tweets.

3

Port it to your stack

The same request runs in Python (requests) or JavaScript (fetch). There is no SDK to install; it is plain HTTP with one header.

4

Read the response

Each read call returns roughly 20 tweets in a tweets array plus a next_cursor. Pass the cursor back to page through more results.

Step 1: Mint Your Bearer Key

Log in with Google in half a minute and your personal key appears in the dashboard. No developer account, no waiting line, no card. You land $0.50 in free credits at signup.

Start Free

The Same Call in curl, Python, and JavaScript

There is no language SDK to install. Every endpoint is plain HTTP with one Bearer header, so it works from any runtime. Here is the same advanced-search request three ways.

curl "https://api.twitterapis.com/twitter/tweet/advanced_search?query=from%3Anaval%20min_faves%3A1000&product=Latest" \
  -H "Authorization: Bearer $TWITTERAPIS_KEY"

The Bearer header matches the official X API shape, so client code written against api.x.com runs here after one base-URL change to api.twitterapis.com. For the longer Python version of this snippet, with cursor pagination, retries, async, and a tweepy port, work through the Python Twitter API tutorial.

Read the Response and Page Further

A read call returns roughly 20 tweets per request inside a tweets array, plus a next_cursor string. To fetch the next page, send the same request again with cursor set to that value. Stop when the array comes back empty.

Need a single profile instead of a search? Call user/info?username=naval, also a $0.0008 read. The full endpoint reference, with every parameter and response field, lives in the API docs.

What It Costs After the Free Credits

Standard reads and simple write actions are $0.0008 per call (about $0.04 per 1,000 tweets when a call comes back with a full 20-tweet page). A few endpoints are premium: creating a tweet and the two DM reads are $0.0016, full account history (user/tweets/complete) is $0.0024, and a full thread expansion (tweet/thread) is $0.004. That is the whole price list across all 99 endpoints.

See the full breakdown on the pricing page, read how the key itself works in the Twitter API key guide, wire your key into an AI agent with the MCP server, or see how the catalog stacks up in TwitterAPIs vs twitterapi.io. If you are already calling twitterapi.io, the endpoint-by-endpoint swap is written out in the twitterapi.io migration guide.

This page is the five-minute path. The long-form version, covering auth models, every endpoint family, rate limits, and what the official API costs at each volume, is the complete Twitter API tutorial. Once reads are working, the first write most people reach for is an image post, and posting a tweet with an image covers the upload, the status poll, and the create call in order.

Coming from the official X (Twitter) API?

Most people reading a quickstart are not starting from nothing. They already have code against the official X (Twitter) API and want to know how much of it survives. The short answer is nearly all of it: the auth header is the same shape, the transport is plain HTTP, and there is no SDK to swap. Change the base URL from api.x.com to api.twitterapis.com, swap the bearer token for your key from the dashboard, and a working client keeps working.

The endpoint names differ and the mapping is close to one for one. Recent search becomes tweet/advanced_search, and it takes the same operator syntax you already write. A user lookup becomes user/info?username= or user/info_by_id. A user timeline becomes user/tweets. Followers become user/followers or user/followers_v2. Pagination is the biggest textual change: X hands you a next_token and we hand you a cursor, which you pass back on the next request until the array comes back empty. Rates on our side are $0.0008 for a standard read call rather than a per-object charge, so a call returning twenty tweets costs the same as one returning three.

One thing genuinely does not port, and it is worth naming rather than discovering. If your product signs users in with their own X accounts and acts on their behalf, that consent-bound OAuth flow belongs to X and no third-party API can legally stand in for it. Keep the official API for that path. Everything that reads public data, search, timelines, profiles, follower graphs, lists and communities, is the base-URL swap above. Most products end up running both, which is not a compromise so much as using each for what it is good at.

Pagination, Rate Limits, and Retries

A read call returns a page, not a result set, so anything beyond the first page is a loop. Page sizes differ by endpoint: a search or timeline page is around twenty tweets, while a follower or list page is larger. Send the request with no cursor to get page one, read next_cursor off the response, and send it back on the next request. For the stop condition, test has_more rather than the cursor. That matters because the two behave differently: list and affiliate endpoints do null the cursor on the last page, but follower-graph endpoints keep sending a non-null one past the end, so a loop that only checks the cursor runs forever there. has_more flips to false on the final page everywhere, so one loop works against every paged endpoint with no special case.

One key carries a ceiling of 600 requests a minute, and that number is your whole capacity plan. It is worth converting into wall clock before scheduling anything: at roughly 20 tweets a call, 600 requests a minute is about 720,000 tweets an hour on a single key. Pagination itself is sequential, because each page needs the cursor from the one before it, so extra throughput comes from working several accounts or queries concurrently rather than from splitting one loop. Run at around eighty percent of the ceiling rather than at it, since a client that sits on the limit spends its time backing off and ends up slower than one that paces itself.

Retry a 429 and a 5xx with exponential backoff and jitter. Never retry a 400, a 401 or a 404: those describe the request rather than the moment, and a retry loop on one turns a typo into a stall that ends with the same error. Failed calls are not billed, so a backoff loop costs time and not money. For any long export, checkpoint the cursor you were on. Resuming a crawl that died forty minutes in costs a few calls; restarting it costs forty minutes and the credits already spent.

Errors You Will Hit, and What Each One Means

Every error arrives as the same envelope: a machine-readable error code beside a human message, so a client branches on the code and logs the message rather than matching on prose. Five codes cover almost everything.

StatusWhat it meansWhat to do
400A missing or malformed parameter. Usually a username sent with a leading @, or a cursor copied with whitespace attached.Fix the request. Do not retry.
401The key is missing, malformed or revoked.Check the Authorization header carries the word Bearer and then the key. Do not retry.
402The balance is exhausted. This is the one an unattended overnight job hits halfway through.Top up, then resume from your last checkpoint. Worth alerting on separately from other failures.
404The resource does not exist: a deleted tweet, a suspended account, or a protected profile.Record it as unresolvable rather than dropping it, or tomorrow's run tries it again.
429More than 600 requests a minute on this key. The one error a healthy client is expected to see.Back off exponentially with jitter and continue.

One habit worth adopting on day one: log the error code as a field rather than the whole message as a string. It is the difference between a dashboard that tells you a job is credit-starved and one that tells you it had 4,000 failures.

Verifying Your Setup Before You Build Anything

A first call that returns 200 proves the key works and almost nothing else. Four checks take about ten minutes on the free credit and catch the problems that otherwise surface a fortnight into a build, when they are expensive.

Page to the end of something real

Not one request. Loop a query you actually intend to run until has_more comes back false, and count both the calls made and the objects returned. That ratio is your own tweets-per-call multiplier, and it is the only input that turns a rate card into a budget. Expect it to sit below twenty, because a narrow query simply has fewer matching results to fill a page with.

Trigger a failure on purpose

Ask for a handle that does not exist and confirm your client handles the 404 without retrying. Send a malformed parameter and confirm the 400 is not swallowed. The behaviour of your error path matters more than the behaviour of your happy path, because the happy path is the one you will test by accident anyway.

Check your id handling

Every id in a response is a string, deliberately: X ids exceed the safe integer range in JavaScript, so Number(id) silently rounds and two accounts can collide on one key. Confirm your client, your database column and your JSON layer all keep ids as text or bigint before you store the first row.

Watch the balance move

Call account/me, which is free, before and after a short run. Seeing the credit tick down against a call count you predicted is the cheapest possible confirmation that your cost model matches reality, and it is far better to discover a factor-of-three error here than on an invoice.

The whole sequence fits inside the $0.50 signup credit with room left over, which is roughly 625 calls. That is deliberate: a free tier you can only make one request on tells you nothing worth knowing.

Where to Go After Your First Call

Search is the endpoint most people start on and it is one of 99. The four below are where the majority of real integrations go next, and each is the same Bearer key and the same $0.0008 read.

Read an account's timeline

user/tweets returns an account's posts as full tweet objects with the author profile attached, so a timeline pull needs no second lookup per row. user/tweets_and_replies adds the conversational half, and user/tweets/complete walks the full history in one request at the premium rate.

Walk the follower graph

user/followers_v2 pages through any public account's followers, each a full profile with bio, counts, account age and verification flags. user/following, user/verified_followers and user/followers_you_know page the same way for the other relationships.

Act, not just read

Posting, replying, liking, retweeting, following, direct messages, media upload and list management are all API calls here rather than a separate integration. Simple write actions bill at the read rate and creating a tweet is $0.0016.

Hand it to an agent

The same endpoints are exposed through a hosted MCP server, so a language model can call them as native tools with no wrapper and no tool definitions to write. Same key, same per-call rate. See the MCP server page for the connection string.

Frequently Asked Questions

A standard read call, like tweet/advanced_search or user/info, costs $0.0008 and returns about 20 tweets, which works out to $0.04 per 1,000 tweets (source: twitterapis pricing). Every new account starts with $0.50 in free credits, so your first call (and roughly 625 more) is covered before you ever add a card.

One Bearer token. Every request carries a single Authorization: Bearer YOUR_API_KEY header, the same shape as the official X API Bearer token. There is no OAuth 1.0a pair and no PKCE handshake to manage for data reads.

Write actions are POST requests with the same Bearer header. Simple writes (like, retweet, bookmark, follow, their undos, and delete) bill at the standard $0.0008 per call. Creating a tweet (tweet/create) is a premium write at $0.0016 per call. A like, for example, is a POST to tweet/favorite with a JSON body of {"tweet_id": "..."}.

No. TwitterAPIs issues your key the moment you sign up with Google or email. There is no developer account at console.x.com, no use-case writeup, and no approval queue. You go from signup to a working call in under a minute.

One, and it is the same on every route: 600 requests a minute and 20 concurrent per API key. Past either one the response is a 429 carrying a Retry-After header with the exact wait in seconds. What you will not hit is the per-endpoint 15-minute and daily windows the official X API enforces, because there is only the single ceiling to design around.

Read endpoints return roughly 20 tweets per call inside a tweets array, alongside a next_cursor string. To fetch the next page, send the same request again with the cursor parameter set to that value. Keep paging until the array comes back empty.