What status code should you return when a client exceeds a rate limit, and how do headers like Retry-After help?
Last updated
Return
429 Too Many Requests, a 4xx client error meaning too many requests were sent in a time window.Retry-Aftergives seconds or an HTTP date to wait, so well-behaved clients back off automatically instead of hammering the server.X-RateLimit-Limit,X-RateLimit-RemainingandX-RateLimit-Resetexpose quota state before a 429 occurs.
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/429
- https://enterno.io/en/articles/http-429-too-many-requests
- https://docs.github.com/en/rest/using-the-rest-api/troubleshooting-the-rest-api
- https://www.throttleproxy.com/docs/rate-limits/github
- https://dev.to/onlineproxy_io/error-429-too-many-requests-why-it-occurs-and-how-to-fix-it-man
- https://dev.to/zuplo/http-429-too-many-requests-learn-to-manage-request-limits-3k15
- https://medium.com/@automatewithdevbox/429-f9ba890926e9
- https://javascript.plainenglish.io/api-rate-limiting-how-to-use-free-apis-without-getting-blocked-d9de2e871774