Skip to content

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

  1. Read Retry-After and wait at least that long before retrying.
  2. 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.
  3. Cap the retries and surface a clear error after the last one.
  4. Spread the work: queue requests and send them at a steady rate below the limit.
  5. Need fewer requests: cache responses, use bulk or batch endpoints, ask for webhooks instead of polling.
javascript
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-After and 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.

Frequently asked questions

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

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.