Overview

OpenAQ is an open-source platform providing access to air quality data aggregated from thousands of government and research-grade monitoring stations worldwide. It requires a free API key for higher usage, but unauthenticated requests are also allowed at low rate limits. Developers can query historical and real-time PM2.5, NO2, ozone, and other pollutant measurements by location or country.

Beginner Tip

Register for a free API key at openaq.org to increase your rate limit from 60 to 1,000 requests per hour. Start by exploring /locations to find monitoring stations near you, then use the location ID in /measurements to fetch actual pollutant readings.

Available Data

The kind of data this API exposes, based on its documentation. We could not call the endpoint to confirm the exact field names.

Use case: Integrate open air quality data data into web and mobile applications
OpenAQ data via REST API

Example Response

Illustrative shape only — we were not able to call this endpoint (it requires credentials or exposes no public sample URL), so the fields below show the kind of data this API returns rather than a recorded response.

JSON Response · Illustrative
{
  "status": "success",
  "data": {
    "result": "Data from OpenAQ",
    "description": "Open air quality data",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

results Array of location or measurement objects matching the query
results[].id Unique identifier for the monitoring location, used to query measurements at that station
results[].name Name or identifier of the monitoring station
results[].country Country information including ISO code and full name where the station is located
results[].coordinates Latitude and longitude of the monitoring station
meta.total Total number of records matching the query before pagination

Implementation Example

Calls a real endpoint of this API. Replace any placeholder credentials with your own key.

Request
const url = "https://api.openaq.org/v3/locations?country_id=US&limit=10";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

429 Too Many Requests Exceeded the unauthenticated rate limit of 60 requests per hour
Register at openaq.org for a free API key and include it as an X-API-Key header to get a higher rate limit
Empty results array The filters applied return no matching locations or measurements
Try broader filters — remove date ranges first, check valid country codes, or use a different parameter (radius instead of city name)
422 Validation Error Invalid parameter values such as a malformed date string or unsupported parameter name
Use ISO 8601 date format (e.g. 2024-01-01T00:00:00Z) and refer to the OpenAQ v3 API docs for valid parameter names and formats

Metadata Score Breakdown

Estimated from metadata — endpoint not independently tested

This score is estimated from observable metadata — HTTPS support, authentication model, declared CORS, and documentation reachability — because the API requires authentication or exposes no publicly testable endpoint. The five-signal breakdown is only shown for live-tested APIs.

Metadata estimate · endpoint not independently tested

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS UNKNOWN
Category Environment
Difficulty Intermediate
Listing details not endpoint-verified

Related Tags

Similar APIs

View All →