Rate Limit Exceeded on Twitter (X) API — Causes & Fixes

Two different situations produce this error, and the fix depends on which one you are in. You are using the X app or x.com and see "Rate limit exceeded": your account hit one of X's account limits (such as the daily cap on direct messages), which is a separate system from API quotas, and nothing in your code is involved. You are calling the X API and your logs show Request failed with status code 429, error 429, 429 Too Many Requests or error code 88: your access token or app key used up its limit for that endpoint in the current window, and the fixes below apply. Whether you searched for "twitter rate limit exceeded", "x error 429", or "twitter api 429" to land here, the platform's old name, its new name, and the raw HTTP status all refer to this same throttle. If you read public data through TwitterAPI.io, a pay-per-use X (Twitter) API, its limit is per second rather than per 15-minute window; that case is covered below too.
It happens more than it used to. X's rate limits have tightened across the board, the free tier that used to absorb small projects is gone, and a script that ran cleanly under the old fixed plans now bumps into a 429 inside an hour on today's pay-per-use billing. Most teams hit this without any change to their own code.
This guide is the practical fix: what "rate limit exceeded" actually means, the immediate retry pattern that gets your script working again, the longer-term choice between paying X per read (or moving to Enterprise) and using a third-party pay-per-use alternative, and the code patterns that stop you from hitting the limit in the first place.
TwitterAPI.io is billed per call with no fixed-window cap — the only limit is requests per second (20 on any paid account), so a script that paces itself does not run into a 15-minute window
What 'Rate Limit Exceeded' Actually Means
A rate limit is a cap on how many requests a client can make in a fixed window — typically 15 minutes for X's REST endpoints. The cap is per-endpoint, and it is enforced two ways at once: per user (the access token making the call) and per app (the API key behind it). Hit either and the next request fails. Account limits are a separate system: X's help center caps direct messages at 500 a day per account, with lower unpublished limits for unverified accounts, which we break down in our guide to the Twitter direct message limit.
When you do hit it, X returns HTTP 429 Too Many Requests and, in the response body, the error code 88 with the message Rate limit exceeded. The two are the same event reported at two layers: the HTTP status code is the transport-layer signal, and code: 88 is X's application-level identifier.
The limit resets automatically when the current window ends — and the response tells you when. Three headers carry the state: x-rate-limit-limit (the cap for that endpoint), x-rate-limit-remaining (how many requests you have left), and x-rate-limit-reset (the Unix timestamp of the next reset). Waiting until the reset is the simplest fix; anything more sophisticated is about how you wait and how you avoid hitting it again.
The Exact Errors You're Seeing
Different X clients surface the same 429 in slightly different shapes. If you are searching for an error message and trying to find this page, here are the variants — they all mean rate-limited:
Plain HTTP: HTTP 429 Too Many Requests — the status line.
X's JSON body: {"errors":[{"code":88,"message":"Rate limit exceeded"}]} — code 88 is the canonical identifier.
v2 endpoints: the body says {"title":"Too Many Requests","detail":"Too Many Requests","type":"about:blank","status":429} — newer schema, same event.
tweepy: raises tweepy.errors.TooManyRequests — it inherits from a base HTTPException, so a generic except over your X calls catches it.
Web UI of a tool that hits the API: the user sees a generic message — "Cannot retrieve tweets right now" or similar — because the front end caught the 429 and replaced it. Check the server logs.
The shape is just packaging. Once you confirm it is a 429 (status code) or code: 88 (X's error code), the fixes below apply regardless of which client you are using.
Why X Rate-Limits So Aggressively Now
X's rate-limiting got tighter for three simultaneous reasons.
The anti-automation push. After the platform's ownership change, X invested heavily in suppressing automation and scraping — and the rate limits are part of that perimeter. The same caps that frustrate legitimate developers also slow down scrapers, so they have been kept tight as a policy choice, not just a technical one.
Fixed plans gave way to metering. What used to be a single generous free tier is gone. X now bills pay-per-usage with no subscriptions — $0.005 per post read, $0.010 per user read — capped at 3 million post reads per monthly billing cycle, with Enterprise above that. Per-window limits still apply on every endpoint, and they are tight.
App-level enforcement is stricter. X also rate-limits at the app level, not only the user. A growing app whose users collectively exceed the app-wide cap will start seeing 429s even when no individual user is over their personal limit. This is the harder failure mode to debug, because nothing your individual users do is wrong.
None of this is fixable from the outside; all three are deliberate.
Immediate Fix — Wait, Then Exponential Backoff
When a request returns 429, do not retry immediately — you will just get a 429 again and waste another token of attention. The right pattern is to read the response, work out when the window resets, and wait until then.
On X's REST endpoints the response includes an x-rate-limit-reset header with the Unix timestamp of the next reset. Compute the seconds-until-reset, sleep that long, then retry. If the header is missing (some endpoints, some clients), fall back to exponential backoff — wait 1 second, then 2, then 4, then 8 — until the call succeeds or you give up.
The code below is the pattern, written against TwitterAPI.io, which sends no reset header: it backs off exponentially with jitter and gives up after a small number of retries. On the official X API, add one step before the backoff: read x-rate-limit-reset and sleep until that time. Either way it stops after a few tries so a permanent error does not loop forever. Wrap your real API calls in it once and you stop having to think about 429s in your business logic.
Longer-Term Fix — Pay X Per Read or Switch (X's Pay-Per-Use Pricing)
Retrying gets you through the current window; the structural fix, if you are hitting rate limits repeatedly, is either to keep paying X per read (and move to Enterprise past its cap) or to move to an API that does not have a hard ceiling in the same shape.
What X charges. X bills the API pay-per-usage, with no subscriptions. The published per-resource rates are $0.005 per Post read, $0.010 per User or DM read, $0.001 per Owned Read, $0.015 per Post created and $0.200 per Post-with-URL (yes — 40× a Post read). Pay-per-usage is capped at 3,000,000 Post reads per monthly billing cycle; above that, the only route is Enterprise, requested through an interest form with no public price. New developers get $20 in credits when they add a first card, plus a match of up to $50.
Why this matters at scale. Every Post read bills at $0.005 from the first one, so 1M Post reads/month cost $5,000 and 3M — the pay-per-usage ceiling — cost $15,000/month. The same 3M reads on TwitterAPI.io's pay-per-result pricing are roughly $450/month at $0.15 per 1,000 tweets — about 33× less. Past 3 million Post reads per monthly billing cycle, X's pay-per-usage billing stops and the workload needs Enterprise. The gap widens for User reads ($0.010/each) and URL-bearing Posts ($0.200/each, 40× a Post read).
Switching to a pay-per-use third-party API. The other path is to read X's data through a third-party API that is itself billed per call, without the hard window-based ceiling X enforces. Cost scales linearly with what you actually pull, there is no "you used 100% of your monthly allowance, you are throttled" cliff, and the predictability is the point: you size the bill from the work, not the other way around.
Neither choice is right for everyone. If you genuinely need official-only data — verified write access, ads metadata, certain user fields — the official API remains the path. If you mostly read public posts and accounts, the alternative is usually cheaper and quieter.

Why TwitterAPI.io Is the Alternative
TwitterAPI.io is one of those alternatives. It is pay-per-use — about $0.15 per 1,000 tweets retrieved, about $0.18 per 1,000 profiles — with no monthly minimum and no flat-rate tier you have to pre-commit to. You pay for what you actually pull and nothing else.
Where it diverges from the X API on the rate-limit question is in the shape of the throttle. There are no 15-minute windows and no per-endpoint quotas to track; the only limit is requests per second: 0.2 requests/s (one every 5 seconds) before your first payment, 20 requests/s once you've paid (any top-up or plan), 50 on Scale and 500 on Business, up to 1,000 on request. If you exceed it you get HTTP 429 (there is no Retry-After header: wait about a second and retry), so a script that paces itself to its tier and waits out the occasional 429 keeps running. That is the point — predictable cost, predictable behavior, and a limit you can see in advance.
Most teams who arrive here through "rate limit exceeded" do not need every official-only feature. If your job is reading public posts, profiles or searches, the third-party path makes the rate-limit problem stop being a problem. See the pricing page for the per-result rates; an API key is one Google sign-in, and new accounts that pass the bot check get up to $1 in free credits (one per person or network, expires after 31 days), enough for end-to-end testing.
When 'rate limit' really means X flagged the login as automated
If the error fires during an X login attempt (not during a normal read or post), it is usually not a rate limit at all: X's automated-behavior check flagged the login as scripted. Logins sent from a script (curl_cffi / requests / httpx) are blocked on the first attempt, and the message X shows reads like a rate limit even though no quota was used.
Diagnose it by the timing: a block at login, before any data request, is the check, not a quota. Stop the scripted logins, wait a few hours, then sign in once from a normal browser on the account's usual network; the account recovers on its own if it was not already locked for a policy reason. For data, do not log in at all: TwitterAPI.io reads public X data with an API key and no X session, so a read-only workload never meets this check.
# Read public data with an API key — no X login, no session to flag
curl -s "https://api.twitterapi.io/twitter/user/last_tweets?userName=nasa" \
-H "X-API-Key: $TWITTERAPI_IO_KEY"
# Response: { "data": { "tweets": [ ... ] }, "has_next_page": true, "next_cursor": "..." }Code Patterns to Avoid Hitting Limits
Even with headroom, the best call is the one you do not make. Four patterns get the most out of a fixed rate-limit budget:
Use bulk endpoints, not loops of single calls. An endpoint that returns 20 results in one request consumes one token from your limit. A loop that fetches each id individually consumes 20. The example below uses /twitter/user/last_tweets to pull an account's recent posts in one call instead of paging by id.
Cache aggressively. A user's profile metadata, an account's follower count, the resolution of a handle to a numeric id — these rarely change second-to-second. Cache them for minutes or hours; the slow data does not need a fresh API hit per request.
Page with cursors, do not re-fetch. When you need more than one page of results, use the response's cursor to fetch the next page rather than re-running the original query with an offset. Re-running searches the same content twice — once you have already paid for.
Batch background jobs. If a job runs every 15 minutes, design it so each run sits comfortably inside the per-window limit, with margin. A job that consumes 95% of the window leaves no headroom for retries or one-off lookups; a job at 30% absorbs spikes without going over.
import requests
API_KEY = "your_api_key"
HEADERS = {"X-API-Key": API_KEY}
# Bad: 20 single-tweet lookups = 20 round trips, 20 tokens from your limit.
# Good: one bulk call that returns up to 20 of an account's recent posts.
r = requests.get(
"https://api.twitterapi.io/twitter/user/last_tweets",
params={"userName": "nasa"},
headers=HEADERS,
timeout=30,
)
r.raise_for_status()
body = r.json()
tweets = body["data"]["tweets"]
# Need more? Page with the response cursor instead of re-running the query.
if body.get("has_next_page"):
print("more available — pass next_cursor on the next call")
print(f"got {len(tweets)} posts in one request")
import random
import time
import requests
API_KEY = "your_api_key"
def get_with_backoff(url, params=None, max_retries=5):
"""GET that handles 429s with exponential backoff and jitter.
TwitterAPI.io sends no Retry-After or x-rate-limit header, so there is
no reset time to read: wait about a second, then double it."""
delay = 1
for attempt in range(max_retries):
r = requests.get(
url, params=params,
headers={"X-API-Key": API_KEY},
timeout=30,
)
if r.status_code != 429:
r.raise_for_status()
return r.json()
# We hit the per-second limit: back off, with jitter, and double the delay.
wait = delay * (0.5 + random.random())
delay *= 2
print(f" 429 — waiting {wait:.1f}s (attempt {attempt + 1}/{max_retries})")
time.sleep(wait)
raise RuntimeError(f"still rate-limited after {max_retries} retries")
# Drop your real calls into get_with_backoff() and the 429 stops mattering.
data = get_with_backoff(
"https://api.twitterapi.io/twitter/user/last_tweets",
params={"userName": "nasa"},
)
print(f"got {len(data['data']['tweets'])} posts after backoff")

Researching this?Free starter credits cover end-to-end testing — Google sign-in, no card. Get a key.
Questions readers ask
How long until Twitter rate limits reset?
X's REST rate limits use a 15-minute rolling window for most endpoints. The exact reset time is in the x-rate-limit-reset response header as a Unix timestamp — read that and wait until the timestamp passes before retrying.
What does HTTP 429 mean on Twitter/X?
HTTP 429 "Too Many Requests" means you have crossed the rate limit for the endpoint you called, in the current window, for either your user or your app. X's response body usually also carries error code 88 with the message "Rate limit exceeded" — the same event reported at the application layer.
Is the X rate limit per user or per app?
Both, and either can throttle you. Most endpoints have a per-user limit tied to the access token and a per-app limit tied to the API key. A growing app whose users collectively exceed the app-wide cap will see 429s even when no individual user is over their personal limit.
Does paying X more remove the rate limit?
No. X bills pay-per-usage, and every endpoint keeps its per-window limits however much you spend; pay-per-usage also stops at 3 million post reads per monthly billing cycle, above which you need Enterprise, and Enterprise contracts still throttle. If you need a path without fixed-window throttling, a pay-per-use third-party API is the structural alternative.
Is there still a free tier on X's API?
No. The old free tier is gone; the API is pay-per-usage, with $20 in credits when you add a first card plus a match of up to $50. At $0.005 per post read, $20 buys about 4,000 post reads, and the per-window limits are the same as on any pay-per-usage account. For any sizeable reading workload, budget per read.
What's the difference between v1.1 and v2 rate-limit headers?
Both versions return x-rate-limit-limit, x-rate-limit-remaining and x-rate-limit-reset on each response. The mechanics are the same; what differs is the per-endpoint cap, which v2 documents per-endpoint in its docs rather than as a single table. Read your specific endpoint's documented limit before sizing a job.
Can my X account get suspended for hitting rate limits?
Hitting the limit itself does not suspend an account — you just get 429s. What can suspend an account is the pattern around it: repeated automated abuse, ignoring the response codes, or coordinating activity across many accounts. Back off cleanly on 429s and the limit is a throttle, not a strike.
How do I check my current X rate-limit usage?
Every response carries x-rate-limit-remaining — the number of requests left in the current window. Log it on every call and you have a live view of how close you are to the cap. X's developer dashboard also surfaces rate-limit usage if you prefer a UI, but the response headers are the right place to look for ongoing programmatic monitoring.
How much does X charge per Post read, and what happens at the 3M cap?
X bills pay-per-usage: every Post read costs $0.005 from the first one. User reads and DM reads cost $0.010 each, Owned Reads (your own dev app reading your own account data) are $0.001, and Post creation that includes a URL is the steepest at $0.200 per request — 40 times a Post read. Pay-per-usage is capped at 3,000,000 Post reads per monthly billing cycle (3M × $0.005 = $15,000); above that you need Enterprise, requested through an interest form with no public price. Confirm current rates on docs.x.com before you size a job.
Does TwitterAPI.io have rate limits?
Yes, per second rather than per 15-minute window: 0.2 requests/s (one every 5 seconds) before your first payment, 20 requests/s once you've paid (any top-up or plan), 50 on Scale and 500 on Business, up to 1,000 on request. Exceeding it returns HTTP 429 with no Retry-After header, so wait about a second and retry with backoff. Billing is separate, about $0.15 per 1,000 tweets, so cost scales linearly with what you pull.
Why are my requests rate-limited even though I have not made many?
Usually one of three things. (1) The cap is per-app as well as per-user — your users collectively are over the app-wide limit. (2) The endpoint you are hitting has a tighter cap than you expect; check the per-endpoint limit, not the headline number. (3) Background processes — retries, health checks, a script you forgot was running — are eating your window. Add x-rate-limit-remaining to your logs and the cause becomes visible.
Continue
- X API — Rate limits (docs.x.com)
- X Help Center: About X limits
- X API — pricing (docs.x.com, 2026 verified)
- twitterapi.io — pricing
- /
- /blog/twitter-api-pricing-2025
- /blog/twitter-api-python-complete-guide
- /x-api
- /pricing
- Twitter API rate-limit calculator
- Twitter (X) counter API guide
- /blog/twitter-no-account-api-read-only
- /blog/twitter-direct-message-limit
- 01How to Log Out of Twitter (X) on Web, iPhone and Android
- 02How to Change Your Twitter (X) Username, Step by Step
- 03Twitter (X) API timeline: get a user's tweets, page by page
- 04Twitter (X) User API: Get Profiles and Understand Every Field of the User Object
- 05Twitter (X) Feed API: How to Build Your Own Feed in 2026
- 06Twitter (X) Direct Message Limit: the Daily DM Cap, Who Can Message You, and Why DMs Fail to Send
- 07How to Calculate Twitter (X) Engagement Rate via API
- 08What Percentage of Twitter (X) Is Bots? Every Published Estimate and Its Method
Writing about something you built with TwitterAPI.io? Our community rewards program pays API credits for honest tutorials, build logs and videos.
Stop reading. Start building.
Starter credits cover real testing on real data. Google sign-in, no card, no application queue.
Get an API keyAlready building with TwitterAPI.io? Publish an honest tutorial or build log about it and earn up to $200 a month in API credits.