HTTP 429 Too Many Requests
You’ve hit a rate limit — too many requests in a given time window. Slow down and retry later.
Meaning
The server (or an API gateway/CDN in front of it) is throttling you. Well-behaved servers include a Retry-After header and often X-RateLimit-* headers showing your quota. Retrying immediately in a tight loop only makes it worse.
Common causes
- Exceeding the API’s per-second/minute/day quota
- Retry loops without backoff amplifying traffic
- Many clients sharing one API key or one NAT/IP address
- Burst of parallel requests (Promise.all over hundreds of items)
- Brute-force protection on login endpoints
- CDN/WAF rate-limiting rules
⚡ Quick fix
- Honor the
Retry-Afterheader before retrying - Add exponential backoff with jitter to retries
- Limit concurrency (queue requests, e.g. 5 at a time)
- Cache responses that don’t change often
- Request a higher quota or use separate keys per service
Detailed fix by platform
JavaScript
- Retry with Retry-After + exponential backoff:javascript
async function fetchWithRetry(url, opts = {}, attempt = 0) { const res = await fetch(url, opts); if (res.status !== 429 || attempt >= 5) return res; const retryAfter = Number(res.headers.get('Retry-After')); const wait = retryAfter ? retryAfter * 1000 : Math.min(30000, 2 ** attempt * 500) + Math.random() * 250; await new Promise(r => setTimeout(r, wait)); return fetchWithRetry(url, opts, attempt + 1); }
Python
- requests + urllib3 Retry:python
from requests.adapters import HTTPAdapter from urllib3.util.retry import Retry s = requests.Session() s.mount("https://", HTTPAdapter(max_retries=Retry(total=5, backoff_factor=1, status_forcelist=[429, 503], respect_retry_after_header=True)))
Nginx
- If your own Nginx returns 429/503, review
limit_req zone=… burst=… nodelaysettings.
How to diagnose
- Headers — Retry-After and X-RateLimit-Remaining values?
- Volume — How many requests per second are you actually sending?
- Scope — Is the limit per key, per user or per IP?
- Retries — Are retries multiplying traffic?
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026