Rate Limiting Headers
In every API response, the following rate-limiting headers will be included to inform you of your current usage:| Header | Description |
|---|---|
X-Ratelimit-Limit | The maximum number of requests allowed in a given time window (120 requests). |
X-Ratelimit-Remaining | The number of requests remaining in the current time window. |
X-Ratelimit-Reset | The time (in seconds) until the rate limit resets, indicating when the counter will be reset. |
Example Response Headers:
For example, after making 50 requests in the current time window, the headers would look like this:- X-Ratelimit-Limit: 120 — You can make up to 120 requests per minute.
- X-Ratelimit-Remaining: 70 — You have 70 requests left in the current minute.
- X-Ratelimit-Reset: 45 — The rate limit will reset in 45 seconds.
Rate Limiting - What You Receive When Hitting the Limit
When you exceed the allowed rate limit for your API key (120 requests per minute), the API will respond with a 429 Too Many Requests HTTP status code. In addition to the status code, the response will contain the following information:HTTP Response
Best practices
Handling Rate Limiting
To handle rate limiting gracefully:- Always check the X-Ratelimit-Remaining header to determine how many requests are left before you hit the limit.
- Use the X-Ratelimit-Reset header to determine when your limit will reset and plan accordingly.
- Implement retries with backoff strategies if you hit the rate limit. For example, retry after the reset time specified in X-Ratelimit-Reset.
