Troubleshooting guide
429 Too Many Requests: what it means and how to fix it
A 429 means you sent more requests than the server allows in a time window. As a client you slow down and retry; as an API owner you decide who gets which limit and say when to come back.
4 min read10 sectionsUpdated
On this page
Key points
- 429 = rate limited. The request was fine; there were just too many of them.
- Respect Retry-After when the response has it, and otherwise back off exponentially with jitter.
- Cache and batch to need fewer requests in the first place.
- On your own API, key limits on the caller, not the IP when traffic arrives through proxies.
What 429 means
HTTP 429 Too Many Requests (RFC 6585) says the client has sent too many requests in a given amount of time. Servers often include a Retry-After header with the number of seconds to wait, and many APIs add headers such as X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset so clients can pace themselves before they hit the limit.
Fix it as a client
- Read
Retry-Afterand wait at least that long before retrying. - Back off exponentially with jitter when there is no header: wait 1 s, 2 s, 4 s and so on, each with a random spread, so many clients do not retry at the same instant.
- Cap the retries and surface a clear error after the last one.
- Spread the work: queue requests and send them at a steady rate below the limit.
- Need fewer requests: cache responses, use bulk or batch endpoints, ask for webhooks instead of polling.
async function fetchWithBackoff(url, options = {}, attempts = 5) {
for (let i = 0; i < attempts; i++) {
const res = await fetch(url, options);
if (res.status !== 429) return res;
const retryAfter = Number(res.headers.get('retry-after'));
const base = Number.isFinite(retryAfter) && retryAfter > 0 ? retryAfter * 1000 : 1000 * 2 ** i;
await new Promise((r) => setTimeout(r, base + Math.random() * 250));
}
throw new Error('Still rate limited after ' + attempts + ' attempts');
}Fix it as an API owner
- Return 429 with
Retry-Afterand the remaining-quota headers, so well-behaved clients can adapt. - Key limits on who is calling: an API key, user or account. Behind a load balancer, CDN or tunnel, every request can appear to come from the same IP address; then one shared per-IP bucket throttles everyone at once. Configure your framework to read the real client address from the proxy's header (only from proxies you trust), or give known internal callers their own bucket.
- Use separate limits for expensive endpoints (search, exports, logins) and cheap ones.
- Prefer a sliding window or token bucket over fixed windows, which let bursts through at each window edge.
- Never return 500 when a downstream limit is hit. Pass the 429 on, or degrade gracefully, so crawlers and clients see the right signal.
429 and search engines
Search engine crawlers treat 429 as a request to slow down and will come back later. That is far better than a 5xx error, which over time can make pages drop from the index. If your site renders pages by calling its own API, make sure a crawl burst cannot exhaust a limit meant for a single visitor, or pages start failing exactly when they are being indexed.
Catch it automatically
Track the share of 429 responses per endpoint and per caller. A sudden rise after a deploy usually means a client started looping; a slow rise means a customer outgrew their plan. Alert rules on the error rate and APM endpoint views show both without digging through logs.
Is 429 a client or a server error?
It is a 4xx client error: the server is working, and asks the client to send fewer requests.
How long should I wait after a 429?
As long as the Retry-After header says. Without it, start around one second and double the wait on each retry, with some random jitter.
Can a 429 be caused by other users?
Yes, when limits are counted per IP address and many users share one address, such as an office network, a mobile carrier or a proxy in front of the API.
Check it now, free
- Website down checker: Is it down for everyone or just me? Check any site now.
- HTTP headers checker: See the raw response headers of any URL.
Related reading
- 400 Bad Request: what it means and how to fix it: Fix a 400 Bad Request error: oversized cookies, malformed URLs, invalid JSON bodies and proxy rules, with commands to find which layer rejected it.
- 403 Forbidden: what it means and how to fix it: Fix 403 Forbidden errors: file permissions, missing index files, WAF and bot rules, IP allowlists, expired signed URLs and missing API scopes, step by step.
- MySQL: Too many connections: Fix MySQL error 1040 Too many connections: check max_connections and current threads, find sleeping or leaked connections, size application pools.
- 431 Request Header Fields Too Large: how to fix it: Fix 431 Request Header Fields Too Large: bloated cookies, Node.js header limits and localhost cookie build-up, with commands to measure real header size.
- 422 Unprocessable Entity: how to fix it: Fix 422 Unprocessable Entity (Unprocessable Content): validation errors in APIs and forms, CSRF tokens in Rails and Laravel, and how to read the error body.
- 501 Not Implemented: how to fix it: Fix 501 Not Implemented: unsupported HTTP methods, servers and proxies that do not support PATCH or WebDAV, and how it differs from 405 and 500.
Watch your own site and services with VitalRix
Uptime checks, APM, logs, real-user monitoring, alerts and status pages in one place. Every product has a free tier and no credit card is needed.