HTTP error 429 means the server is rate-limiting your client because too many requests arrived in a period of time. The reliable fix is to stop the burst, read Retry-After when it is present, lower concurrency, and retry with backoff instead of sending the same request again immediately.
What you need
Have the endpoint’s API documentation, a way to inspect response headers, and logs that show timestamps, status codes, request IDs, and the account or key used. For the examples below, use curl or Python with requests; for a multi-worker job, also know the combined request rate and concurrency.
Step 1: Understand what 429 means
HTTP 429 is a client error status defined by RFC 6585, section 4. It does not necessarily mean that the URL, credentials, or request format is wrong. It usually means the server, API, account, user, or source address has crossed a request limit for a time window.
The limit may apply at several levels:
| Scope | What it can mean |
|---|---|
| IP address | All requests leaving one public address are counted together. |
| API key or account | Authenticated clients share a quota even when their network changes. |
| User or session | A cookie, login, or tenant has its own limit. |
| Endpoint or resource | One expensive route is limited more tightly than the rest of the API. |
| Global service | A provider is protecting a shared resource from a traffic spike. |
This is why changing your IP is not the first fix. If the server is limiting your API key, account, session, endpoint, or behaviour, a new address does not solve the cause. Repeatedly switching addresses can also make your traffic harder to diagnose and may conflict with a service’s terms.
Success looks like a specific hypothesis about which identity or resource is being limited, not just the assumption that the IP is blocked.
Step 2: Check the response and its limits
Why: you need to know whether the 429 is an IP limit, an account quota, a route-specific rule, or a permanent quota problem before choosing a retry strategy.
Make one request and save the response headers. Do not run a tight loop while investigating:
curl -sS -D response.headers -o response.body https://api.example.com/items
sed -n '1,40p' response.headers
Look for:
Retry-After, which tells you when to try again.- Provider-specific fields such as
X-RateLimit-Limit,X-RateLimit-Remaining, orX-RateLimit-Reset. - A JSON error code that distinguishes request rate, daily quota, account credit, or concurrency.
- A request ID that support can use to find the event.
Retry-After can contain a number of seconds, such as Retry-After: 30, or an HTTP date. The HTTP Semantics specification defines both forms. Other rate-limit headers are not universal, so follow the API’s own documentation rather than assuming that a header has the same meaning everywhere.
Success looks like a clear limit diagnosis and a recorded request ID, status, response headers, and timestamp. If the response says your quota or credits are exhausted, do not treat it as a temporary burst: check the account or plan instead.
Step 3: Honor Retry-After
Why: the server may know the exact time at which your client can try again, and ignoring that hint usually creates another 429.
The Retry-After header is optional, but use it whenever the server sends a valid value. For a numeric value, wait that many seconds after receiving the response. For a date, calculate the time remaining using a clock, then clamp negative results to zero.
Do not make all workers sleep and wake at exactly the same instant. Add a small random jitter, and coordinate the delay through one rate limiter if several workers share the same API key or IP. Otherwise, 20 workers can create a second burst immediately after the first wait finishes.
If the header is missing or malformed, use capped exponential backoff with jitter. A practical starting point is:
delay = min(max_delay, base_delay * 2**attempt) + random_jitter
For example, with a 1-second base and a 60-second cap, the waits grow roughly from 1 to 2, 4, 8, 16, and 32 seconds. The exact numbers should match the API’s published limits and your job’s latency requirements. Always set a maximum number of retries and a maximum total wait.
Success looks like the next request is scheduled after the server’s requested delay, with no synchronized burst from your other workers.
Step 4: Fix a 429 in a browser
Why: an automatic refresh, several open tabs, or an extension can keep generating requests while you are trying to recover.
Take these actions in order:
- Stop refresh buttons, auto-refresh extensions, background exports, and duplicate tabs for the same service.
- Wait for the
Retry-Afterperiod if the response shows one. If there is no header, wait a few minutes rather than refreshing repeatedly. - Check the service’s dashboard or API documentation for account, daily, or endpoint quotas.
- Sign out other sessions or pause another tool using the same account only if the service permits that workflow.
- Retry one normal request. If it succeeds, resume slowly rather than reopening every tab at once.
Clearing cookies or switching browsers may change a session, but it does not increase a server-side quota. Do not use a new account or a new address to evade a restriction. If a legitimate job still gets 429 responses after the stated wait, contact the service with the request ID and your measured request rate.
Success looks like one controlled request works without an auto-refresh or duplicate tab immediately creating another burst.
Step 5: Reduce script concurrency and request cost
Why: a retry loop cannot compensate for a worker pool that is producing more requests than the server allows.
Start with fewer workers and one request at a time per host or API key. Add a queue between your producer and HTTP clients so that work can be paced. Reuse successful responses and use conditional requests such as If-None-Match when the API supports them, rather than downloading unchanged data repeatedly.
Also check for accidental sources of volume:
- A retry loop that retries every exception, including authentication and validation errors.
- Pagination that starts over from page one after a temporary failure.
- A short timeout that causes the same slow request to run in parallel.
- Multiple processes using the same API key without a shared limiter.
- Browser automation loading images, scripts, and API calls for every page when only one endpoint is needed.
Keep concurrency separate from request rate. Ten workers making one request per second each still produce ten requests per second. If the provider publishes a limit such as 60 requests per minute, pace the combined traffic below that limit and leave room for clock differences and other jobs.
For state-changing requests such as payments, writes, or form submissions, do not blindly replay a request after a 429. Retry only when the API documents the operation as safe to repeat or provides an idempotency key. A status code does not tell you whether the server started processing the request before returning the response.
Success looks like the combined request rate is below the documented limit and the queue can pause without starting duplicate work.
Step 6: Decide whether IP rotation helps
Why: a new address can separate independent, legitimate workloads, but it cannot repair account-level limits or justify bypassing a site’s access controls.
IP rotation can be useful when all of these are true:
- The provider documents a limit per source IP.
- Your requests are allowed and your total traffic remains reasonable.
- Each address is a real network path you control or are authorised to use.
- You still apply a rate limit per destination, account, and session.
It is not a substitute for backoff when the limit is attached to an API key, cookie, user, endpoint, or global quota. It also does not fix bad credentials, invalid parameters, expensive queries, or an account that has run out of credits.
For legitimate collection, ad verification, QA, or price-monitoring work, you may need several customer-owned 4G connections with separate egress addresses. ProxyKite turns compatible Huawei E3372 HiLink dongles connected to your Raspberry Pi or Linux box into HTTP and SOCKS5 proxies. Its cloud router avoids static IPs and inbound port forwarding, and its rotation controls support on-demand, link-based, or timed changes. You still need to respect each destination’s rules and rate limits.
See the 4G proxy farm setup guide for the hardware layout, and how to build your own mobile proxy with 4G and Raspberry Pi for the broader architecture. When you need rotation, the ProxyKite rotation API documentation explains how to integrate it with an authorised workflow.
Success looks like each authorised destination still has its own limiter, even when your workload uses more than one customer-owned egress connection.
Step 7: Add exponential backoff in Python and curl
Why: handling 429 in one reusable function prevents every caller from inventing a different retry policy.
Python with Retry-After
This example handles both standard Retry-After forms, adds jitter only when it must calculate a delay, and stops after a bounded number of attempts. Install requests in the environment where you run it.
import email.utils
import random
import time
from datetime import datetime, timezone
import requests
def retry_after_seconds(value: str | None) -> float | None:
if not value:
return None
try:
return max(0.0, float(value))
except ValueError:
try:
retry_at = email.utils.parsedate_to_datetime(value)
if retry_at.tzinfo is None:
retry_at = retry_at.replace(tzinfo=timezone.utc)
return max(0.0, retry_at.timestamp() - time.time())
except (TypeError, ValueError, OverflowError):
return None
def get_with_backoff(url: str, attempts: int = 5) -> requests.Response:
for attempt in range(attempts):
response = requests.get(url, timeout=30)
if response.status_code != 429:
response.raise_for_status()
return response
if attempt == attempts - 1:
response.raise_for_status()
wait = retry_after_seconds(response.headers.get("Retry-After"))
if wait is None:
wait = min(60.0, 2 ** attempt) + random.uniform(0, 1)
time.sleep(wait)
raise RuntimeError("unreachable")
For production, share the limiter across workers and log the URL path, status, wait, attempt count, and request ID without logging credentials. If the API returns a quota-exhausted error, stop instead of spending all five attempts on a condition that cannot clear by waiting.
curl with built-in retries
Recent curl versions treat HTTP 429 as a transient error for --retry and honor a valid Retry-After header. The default retry delay is exponential, and --retry-max-time caps the retry window. For a safe, idempotent GET, use:
curl --fail-with-body \
--retry 5 \
--retry-max-time 120 \
--connect-timeout 10 \
--max-time 30 \
'https://api.example.com/items'
Do not add --retry-all-errors by default. It can replay errors that are not safe to repeat, especially when sending a request body. For POST or other state-changing operations, use the API’s idempotency mechanism or write a small handler that knows which failures are safe to retry.
Success looks like the client either receives a successful response or exits after its bounded retry budget, with no endless loop.
Verify the fix
Why: a single successful request does not prove that a batch job will stay under the limit.
Run a small controlled test and record:
- Requests per minute for the destination, account, and source address.
- The number of concurrent requests and active workers.
- 2xx, 4xx, and 5xx counts separately.
- Every 429’s
Retry-After, provider reset field, and final retry outcome. - The delay between a 429 and the next request.
Success means the next request is sent no earlier than the server’s stated wait, concurrency remains bounded, 429s fall away, and the job stops cleanly when its retry budget is used. Keep the limiter in place after recovery; otherwise the same burst will return when the queue catches up.
Troubleshooting persistent 429 responses
The response has no Retry-After
Use capped exponential backoff with jitter and consult the provider’s quota documentation. Record any vendor-specific reset header, but do not assume that X-RateLimit-Reset is seconds, a Unix timestamp, or a duration until the provider says so.
A new IP still receives 429
The limit may be keyed to the API key, account, cookie, endpoint, request fingerprint, or a shared quota. Restore one stable route, reduce request volume, and check the account response body before changing anything else.
The first request returns 429
Check whether a previous process, browser session, or shared NAT address already consumed the quota. Also look for a daily limit, an account restriction, a required authentication scope, or a provider-specific rule that returns 429 for a non-rate condition.
Retries make the problem worse
Your workers may be retrying independently, or the client library may already have its own retry loop. Use one bounded retry layer, coordinate workers through a shared limiter, and include jitter so they do not synchronize.
You need many egress IPs for an authorised workload
Use customer-owned connections and document a per-destination rate limit before adding rotation. ProxyKite’s proxy formats guide covers the HTTP and SOCKS5 connection formats; its licence is $9 per active dongle per month with no per-GB charge because traffic uses your own SIM data plan.
FAQ
What does HTTP error 429 mean?
It means the server is refusing the request because the client exceeded a rate or quota limit in a time window. The limit may be based on an IP, account, API key, user, session, endpoint, or the whole service.
How long should I wait after a 429?
Use the Retry-After header if the server sends one. If it is absent, use capped exponential backoff with random jitter, a finite retry count, and a maximum total wait rather than retrying continuously.
Does rotating an IP fix a 429 error?
Only when the provider documents a per-IP limit and the workload is authorised. It does not fix account, API-key, cookie, endpoint, or global quotas, and it should never be used to evade access controls or a service’s rules.
Should I retry a POST after a 429?
Only when the API documents the operation as safe to repeat or supports an idempotency key. A 429 response does not prove that a state-changing request was never received or started.
How can I prevent 429 errors in a scraper or API client?
Measure the combined request rate, reduce concurrency, cache or reuse results, follow pagination carefully, and honor Retry-After. Put all workers behind one bounded limiter, then test with a small batch before increasing throughput.