Overview
APIs often enforce rate limits to prevent abuse and ensure stability. This section explains how rate limits work, the relevant headers, and how to handle cases when the limit is exceeded. Rate limits are applied per client IP address over a one-minute window. The maximum number of requests allowed in that window may change, and the current value is returned in thex-ratelimit-limit header of every response, so your client should read it from there instead of hardcoding a value.
Rate limit Headers
Every successful response includes the following headers to help you manage your request quota:These values are indicative and may vary slightly between consecutive responses. Treat a
429 response and its retry-after header as the source of truth.Example Headers
When the limit is reached
If you exceed the allowed number of requests, the API responds with HTTP 429 Too Many Requests and includes aretry-after header with the number of seconds to wait before making new requests.
Example Response
Headers:code field to detect this error. The message text is intended for humans and may change.
Best practices for handling rate limits
- Wait the number of seconds indicated by
retry-afterbefore retrying after a429. - Implement exponential backoff with jitter for repeated
429responses. - Spread bulk operations over time instead of sending them in bursts.
- Cache responses when possible to reduce unnecessary requests.