HTTP 429 Too Many Requests
The user has sent too many requests in a given amount of time (rate limiting).
4xx Client Error
429
Too Many Requests
Description
The 429 Too Many Requests status code indicates that the user has sent too many requests in a given amount of time ("rate limiting"). The response representations should include details explaining the condition, and may include a Retry-After header indicating how long to wait before making a new request. Rate limiting is an important mechanism to protect servers from being overwhelmed and to ensure fair usage among clients. The Retry-After header can contain either a date or the number of seconds to wait. Implementations vary widely, with some APIs also including custom headers like X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset.
When Is It Used?
Returned when a client exceeds the API rate limit. Common with REST APIs, login endpoints (to prevent brute force), and any service that throttles requests. Most APIs include rate limit headers to help clients manage their request frequency.
Example Response
HTTP/1.1 429 Too Many Requests
Retry-After: 60
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1708473600
Content-Type: application/json
{"error": "rate_limit_exceeded", "message": "Too many requests. Please wait 60 seconds."}