Why rate limits exist
A rate limit is a cap on how many requests you can send to an API in a given time window — say 100 requests per minute. APIs use them to prevent abuse, keep the service stable for everyone, and control costs. Hit the cap and the API responds with HTTP status 429 Too Many Requests.
How limits are usually expressed
Most APIs return headers telling you where you stand, such as X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset (when the window resets). Reading these lets you slow down before you get blocked.
Handling 429 gracefully
- Respect Retry-After: if the response includes a
Retry-Afterheader, wait exactly that long before retrying. - Exponential backoff: if you must retry, wait progressively longer (1s, 2s, 4s...) with a little randomness to avoid stampedes.
- Cache responses so you don't re-request data you already have.
- Batch requests where the API supports it.
The mistake to avoid
Retrying a 429 immediately in a tight loop makes things worse — you burn your quota and can get temporarily banned. Always back off.
Frequently Asked Questions
What does HTTP 429 mean?
It means 'Too Many Requests' — you've exceeded the API's rate limit and should slow down before retrying.
What is exponential backoff?
A retry strategy where you wait progressively longer between attempts (1s, 2s, 4s...) to give the service time to recover.
How do I know my rate limit?
Check the API's documentation and the X-RateLimit-* response headers, which report your limit, remaining requests, and reset time.