Rate Limits
Learn about API rate limits, how to check your rate limit status and what to do if you exceed them.
Limits
Rate limits are imposed based on the number of requests within a time period from all users, and are applied per server.
Exceeding the limit
If you exceed the rate limit you will receive an HTTP 429 response code. This indicates that you need to stop making requests until your rate limit has been reset.
You should wait at least the number of seconds specified by the RateLimit-Reset HTTP header before retrying the request.
Checking your rate limit status
Every API response will include rate limit information in the HTTP headers. The headers returned follow the RateLimiter header fields for HTTP draft 9.
| Header | Description | Example value |
|---|---|---|
RateLimit-Policy | Describes the rate limit policy. E.g.: a quota (q) of 10 requests in a window (w) of 10 seconds. | "per_server";q=10;w=10 |
RateLimit | The maximum number of requests you can make. E.g.: the remaining (r) requests in a time window (t) reset in 10 seconds. | "per_server";r=5;t=10 |
Staying under the rate limit
You can avoid hitting rate limits by implement the following best practices:
Avoid concurrent requests
Make API request serially instead of concurrently. This can be achieved using a queue system for requests.
Pause between requests
Implementing a small delay between making requests can help avoid hitting rate limits. For example you could add a 1 second delay between API requests.
Make use of rate limit HTTP headers
Ensure that your processes handle the rate limit headers correctly:
- Check
RateLimitheader prior to making subsequent requests. If this value is approaching 0, wait a short period of time before making more requests. - If the value of
RateLimitisq=0;w=10, don't make any requests until you have waited for the number of seconds specified by the time window in the response. In this example, 10 seconds.
Cache data to avoid repeated requests
Caching data can help avoid making repeated requests within a short space of time.
Updated 3 months ago
