Rate limits
OpenAQ limits the number of API requests you can make in a set time to ensure fair access for all users and prevent overuse.
OpenAQ provides a very generous rate limit. If your needs exceed this rate limit, we offer a custom pricing option for a higher rate limit.
General use | Custom use |
---|---|
Free | Contact us for pricing |
Rate limits
| Rate limits
|
Sign up | Contact us |
Requirements & Terms:
| Requirements & Terms:
|
If a rate limit is exceeded, the API returns a 429 “Too many requests” HTTP status code. To continue, wait until the next rate limit period starts as described in OpenAQ’s rate limit policy. Avoid making more requests during this time to prevent further errors.
Rate limit headers
The OpenAQ API includes response headers to help you manage request rates and adhere to limits. These headers give information about your current request usage, remaining capacity, and reset times, allowing you to plan your API calls effectively.
x-ratelimit-used | Shows the number of requests that have been made during the current rate limit period. This header helps users track their usage and avoid exceeding limits. |
x-ratelimit-reset | Provides a timestamp indicating when the rate limit period will reset. This header helps users plan when to start making requests again. |
x-ratelimit-limit | Specifies the maximum number of requests allowed within the current rate limit period. This header helps users understand the upper bound for the number of requests they can make. |
x-ratelimit-remaining | Indicates the number of requests remaining before reaching the rate limit. This header helps users avoid hitting the limit and encountering rate limit errors. |
Example headers
In the example HTTP response above, the rate limit headers reveal:
- You can make a total of 10 requests in this period.
- You have used 1 request so far.
- You have 9 requests remaining before reaching the limit.
- The limit will reset in 60 seconds, at which point the request count will start over.