Getting Started
OpenAQ provides a REST API for programmatic access to the OpenAQ database.
Usage
The OpenAQ API is currently available in two versions:
-
Legacy version 1 - only includes reference/government sources, i.e. does not include low-cost sensors
-
Current version 2 - includes full OpenAQ dataset and additional query features compared to version 1
Interactive reference documentation of both versions of the REST API is available in the reference section.
API Key
An API Key is not currently required for accessing the OpenAQ API. Starting July 1 2023 an API Key will be required to access the OpenAQ API at the current rate limit. Key-less access will still be available but at a significantly lower rate limit.
Register for an API Key at https://api.openaq.org/register. Once registered with a valid email the API key will be sent directly to your email. Do not share this key, each key is allocated a usage rate and sahring key will impact the amount of requests available.
To use the API Key in requests to the OpenAQ API add the key to the request header using the X-API-Key
key. e.g.
curl --header "X-API-Key: 1234567890ASDFGHJK" https://api.openaq.org/v2/locations
Updated 2 months ago