HTTP, TLS & Web Performance

429 Too Many Requests and Rate Limiting

What a 429 error means, why servers limit requests, how to read Retry-After, and how to fix the problem as a visitor, developer or site owner.

Key takeaways

  • A 429 status says the client has exceeded a request limit, and it is usually temporary.
  • The optional Retry-After header tells you how long to wait, either as a number of seconds or as a date.
  • Retrying immediately makes things worse; good clients back off exponentially and add random jitter.
  • Limits can be tied to an IP address, account, API key or endpoint, so several people may share one allowance.
  • Site owners should return clear 429 responses, document their limits and watch for legitimate users being caught.

A 429 Too Many Requests response means the server understood your request but is refusing it for now because you, or something sharing your identity, sent too many in a given period. The fix is almost always to slow down, wait for the time the server suggests, and then send fewer requests than before.

If you're a visitor, that usually means waiting a few minutes and not hammering the reload button. If you're writing code that calls an API, it means building in backoff and respecting the limits. If you run the site, it means checking that your limits catch abuse without punishing ordinary people.

What the status code means

HTTP status codes in the 400 range say something about the request from the client's side. The 429 code was added by RFC 6585 specifically for rate limiting, which is the practice of capping how many requests a client may make within a window of time. If you want the wider picture, the status code families explain where it sits.

A typical response looks like this:

HTTP/1.1 429 Too Many Requests
Content-Type: application/json
Retry-After: 30

{"error": "rate_limited", "message": "Too many requests. Try again in 30 seconds."}

The status line is the only required signal. The body can be anything, and the Retry-After header is optional. Some services return a friendly HTML page, others a short JSON object, and a few send nothing but the code.

A 429 differs from its neighbors in useful ways. A 403 says you aren't allowed, and waiting won't change that. A 503 Service Unavailable says the server itself can't handle requests right now, for anyone. A 429 is aimed at you in particular.

Why servers limit requests

Every request costs something: processor time, a database query, bandwidth, sometimes a fee paid to another provider. Without limits, one busy client can use up capacity that everyone else needs.

Common reasons include:

  • Protecting capacity. A script stuck in a loop can send thousands of requests per minute.
  • Slowing password guessing. Limits on login and password-reset forms make automated guessing far less practical.
  • Controlling scraping. Sites often allow normal browsing but throttle bulk copying.
  • Enforcing plan tiers. APIs frequently sell larger allowances on higher plans.
  • Containing costs. Expensive operations, such as sending text messages or running a model, need tighter caps than reading a cached page.

Rate limiting is a courtesy mechanism as much as a defense. It lets a service stay up for the many by turning away the excess from the few. It is a weak tool against very large distributed floods, though, because each source may stay under the limit. That problem calls for DDoS protection.

How the common limiting methods work

The method a server uses affects what you experience as a client.

Four ways to count requests
Fixed window Counts requests per clock interval Simple and cheap to run Allows bursts at the window edges Sliding window Looks back over the last period Smooths out edge bursts Needs more bookkeeping Token bucket Tokens refill at a steady rate Each request spends a token Allows short bursts up to bucket size Leaky bucket Requests queue and drain steadily Output rate stays even Overflow is rejected Fixed window Counts requests per clock interval Simple and cheap to run Allows bursts at the window edges Sliding window Looks back over the last period Smooths out edge bursts Needs more bookkeeping Token bucket Tokens refill at a steady rate Each request spends a token Allows short bursts up to bucket size Leaky bucket Requests queue and drain steadily Output rate stays even Overflow is rejected

A fixed window allows, say, 100 requests in each minute and resets the counter when the next minute starts. Its weakness is that a client can send 100 just before the reset and 100 just after.

A sliding window counts what happened over the previous 60 seconds from this moment, which closes that gap.

A token bucket holds a set number of tokens and adds new ones at a steady rate. You can spend a stored-up burst quickly, then you're held to the refill rate. This suits real browsing, which comes in bursts.

A leaky bucket accepts requests into a queue that empties at a constant pace. It protects a fragile backend well, at the cost of adding delay.

Many services layer several limits: one per second to stop spikes, another per day to cap total use, and a stricter one on sensitive paths such as sign-in.

Who the limit is attached to

A server has to decide what counts as one client. The choice explains many confusing 429 errors.

Limits keyed to an IP address are easy to apply before a user signs in. But many people can share one public address through an office network, a school, a VPN or carrier-grade NAT on a mobile or residential provider. A neighbor's heavy use can then count against you.

Limits keyed to an account or API key are fairer and follow you across networks. If two of your programs use the same key, they share one allowance, even though neither looks busy on its own.

Limits keyed to an endpoint apply different caps to different actions. Reading a product list might be generous while creating an order is tight.

Reading Retry-After and limit headers

Retry-After is the header to look for first. It comes in two forms:

Retry-After: 120
Retry-After: Sat, 05 Dec 2026 14:30:00 GMT

The first is a delay in seconds. The second is an HTTP date after which you may try again. A client should handle both.

Many APIs also report your remaining allowance in headers on successful responses, often with names along the lines of X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. These names are conventions, and their meaning varies: one service reports the reset as a timestamp, another as seconds remaining. There has been standardization work on common RateLimit headers, so check the provider's documentation for what it actually sends.

To see the headers yourself on Linux or macOS:

curl -i https://example.com/api/items

In Windows PowerShell, call curl.exe explicitly so you get the real curl program:

curl.exe -i https://example.com/api/items

If you're a visitor seeing a 429

Work through these in order. Most cases end at the first step.

Getting past a 429 as a visitor
Have you waited a few minutes without reloading? YES If the page now loads, you simply hit a short limit. 1 NO Is an extension or open tab refreshing the site? YES Close or disable it, then wait again. 2 NO Are you on a VPN or shared network? YES Others may be using your address; try your normal connection. 3 NO Did you just fail to sign in several times? YES Wait, then use the password reset instead of guessing. 4 NO Contact the site Report the time, the page and any reference code shown on the error. Have you waited a few minutes without reloading? 1 IF YES If the page now loads, you simply hit a short limit. NO Is an extension or open tab refreshing the site? 2 IF YES Close or disable it, then wait again. NO Are you on a VPN or shared network? 3 IF YES Others may be using your address; try your normal connection. NO Did you just fail to sign in several times? 4 IF YES Wait, then use the password reset instead of guessing. NO Contact the site Report the time, the page and any reference code shown on the error.

Clearing cookies occasionally helps if the site tracks limits by a session cookie that has gone bad, but it also signs you out. Don't try to rotate addresses to get around a limit. It tends to break the site's terms and can get a whole network blocked.

If you see 429 errors without doing anything unusual, scan your computer for unwanted software and check your router for devices you don't recognize. Something on your network could be generating traffic in your name.

If your code receives a 429

A well-behaved client treats 429 as an instruction. The reliable pattern is:

  1. Check for Retry-After. If it exists, wait at least that long.
  2. If it doesn't, wait a short base delay, then double it after each further failure.
  3. Add jitter, a random amount of extra or reduced wait, so many clients don't retry at the same instant.
  4. Cap both the delay and the number of attempts.
  5. After the last attempt, report the failure clearly and stop.

With a one-second base delay and doubling, your waits run roughly 1, 2, 4, 8 and 16 seconds, each nudged by the random jitter. You can experiment with these schedules in the retry and backoff simulator.

Be careful about what you retry. Repeating a read is harmless. Repeating a request that creates or charges something can duplicate the action if the first attempt partly succeeded, so use an idempotency key if the API offers one. HTTP method semantics explain which requests are safe to repeat.

Better still, avoid hitting the limit at all. Cache responses you've already fetched, request data in batches where supported, replace frequent polling with webhooks or a push channel, and spread scheduled jobs so they don't all fire on the hour. Our guide to polite API clients goes further.

If you run the site

Start by measuring normal traffic. Look in your logs at how many requests a real visitor makes while loading a page and moving around, including images, scripts and API calls. Set limits well above that, then tighten where abuse actually occurs.

Rate limiting can live in several places: a CDN or edge service, a reverse proxy, an API gateway or your application. Rejecting excess traffic early is cheapest. Application-level limits are the most precise because they know who the user is.

In nginx, a basic per-address limit looks like this:

http {
    limit_req_zone $binary_remote_addr zone=perip:10m rate=10r/s;

    server {
        location /api/ {
            limit_req zone=perip burst=20 nodelay;
            limit_req_status 429;
        }
    }
}

The limit_req_status line matters, because nginx otherwise answers limited requests with a 503. If your server sits behind a CDN or load balancer, make sure it sees the real client address from a trusted forwarding header. Otherwise every visitor appears to be the proxy, and they all share one bucket.

A polite client meets a rate limit
Client API server Request 1 429 with Retry-After: 30 2 Retry after 30 seconds plus jitter 3 200 OK with data 4 Client API server Request 1 429 with Retry-After: 30 2 Retry after 30 seconds plus jitter 3 200 OK with data 4

Good practice on the server side:

  • Send Retry-After so clients know what to do.
  • Explain the limit in the response body and your documentation.
  • Don't let caches store the 429; RFC 6585 says these responses must not be cached.
  • Consider search crawlers. Sustained 429 responses typically cause them to slow down, and long-running ones can affect how your pages are indexed.
  • Log which rule fired, so you can find false positives.

Common questions

How long does a 429 error last?

As long as the server's rule says. It may be a few seconds for a per-second cap, or until the next day for a daily quota. Retry-After is the best clue.

Can a 429 be caused by a website bug?

Yes. A page script that retries a failing call in a tight loop can trip the site's own limits. If many users report it right after a site update, that's a likely cause, and only the owner can fix it.

Does a 429 mean I've been banned?

Usually not. A ban more often shows up as a 403, a block page or dropped connections. Repeatedly ignoring 429 responses, however, is a good way to earn a longer block.

Written for 4Internet with AI writing tools and not reviewed line by line by a person. Check anything you rely on with the maker, provider or standard concerned. Report an error.

Keep reading

All 45 articles in HTTP, TLS & Web Performance →

Latest news on this topic