APIs cap how many requests you can make per second, minute or day. Going over gets you a 429 "Too Many Requests", sometimes with a Retry-After header saying how long to wait. Short term: wait and retry with increasing gaps. Long term: make fewer calls by caching results, batching requests, and removing loops that call the API once per item, or buy a higher limit.
What's the problem
Calls to an API fail with 429, "rate limit exceeded" or "quota exceeded", usually under load, during imports, or after a change that makes more calls.
Why it happens
- Calling the API in a loop, one request per item instead of one batch.
- No caching, so the same data is fetched again and again.
- Retrying instantly after failures, which multiplies requests.
- More users or traffic than your plan covers.
- Sharing one API key across many services or environments.
How to fix it
- Check the response for
Retry-Afterand any headers showing your remaining quota. - Retry with backoff: wait the time given, or increasing gaps, never instantly.
- Cache responses that don't change often.
- Batch requests where the API supports it.
- Spread work out: queue big jobs instead of running them all at once.
- Check your plan's limits and upgrade or request more if your normal use exceeds them.
What Preventionlabs checks
One click runs the full report on your domain. For this problem it shows whether your site loads, how fast, and where its redirects go. With Cloudflare connected, it also shows which pages returned server errors (5xx) to visitors, and when; errors thrown by your Workers code; recent deploys and account changes, with their times. It doesn't call your API with your app's own requests or read your logs, so test the failing request directly as well.
Run your free reportYour first report is free, no card needed. Then A$50 a month, up to 10 domains. Read-only: it never changes anything.
Sources
- MDN Web Docs: 429 Too Many Requestsreference
The HTTP 429 Too Many Requests client error response status code indicates the client has sent too many requests in a given amount of time.
- MDN Web Docs: Retry-After headerreference
The HTTP Retry-After response header indicates how long the user agent should wait before making a follow-up request.