OpenAQ Air Quality Data Search avatar

OpenAQ Air Quality Data Search

Pricing

from $1.00 / 1,000 measurement fetcheds

Go to Apify Store
OpenAQ Air Quality Data Search

OpenAQ Air Quality Data Search

Search global air quality data from OpenAQ. Get real-time and historical PM2.5, PM10, ozone, NO2, SO2, CO pollution levels from 100+ countries. Filter by country, city, GPS coordinates, date range, and pollutant type. Export structured data as JSON or CSV.

Pricing

from $1.00 / 1,000 measurement fetcheds

Rating

0.0

(0)

Developer

ryan clinton

ryan clinton

Maintained by Community

Actor stats

0

Bookmarked

3

Total users

1

Monthly active users

4 hours ago

Last modified

Share

OpenAQ Air Quality Data Search is an Apify actor that retrieves real-time and historical air pollution measurements from the OpenAQ platform -- the world's largest open-source database of air quality data. It connects to the OpenAQ v3 API to pull structured readings from thousands of government-run monitoring stations across 100+ countries, covering six key pollutants: PM2.5, PM10, ozone (O3), nitrogen dioxide (NO2), sulfur dioxide (SO2), and carbon monoxide (CO).

Each record includes the concentration value, measurement units, station metadata, GPS coordinates, UTC and local timestamps, and the original data provider. Two modes are supported -- latest readings for real-time snapshots and historical date-range queries for time-series analysis. Whether you need to track urban pollution, compare air quality across countries, build research datasets, or automate pollution alerts, this actor provides a clean pipeline from the global OpenAQ network to a structured Apify dataset. A free OpenAQ API key is all you need.


  • No coding required -- Skip API pagination, sensor mapping, and data normalization. Configure your search in the console and get clean results.
  • Managed cloud infrastructure -- Run on Apify without provisioning servers. Schedule recurring runs for continuous monitoring.
  • Instant export and integration -- Push results to Google Sheets, Slack, S3, webhooks, or Zapier using built-in connectors.
  • Free data source -- The OpenAQ API key costs nothing. Daily collection runs under $1 per month on Apify's free tier.
  • Consistent, flat output -- Every record follows the same 17-field schema regardless of country or network.
  • Programmatic access -- Trigger runs via the Apify REST API or official Python and JavaScript clients.

Key features

  • Six pollutant parameters -- Query PM2.5, PM10, ozone, NO2, SO2, or CO concentrations from a single interface with standardized output fields.
  • 100+ country coverage -- Access real-time pollution data from government monitoring stations worldwide using ISO 3166-1 alpha-2 country codes.
  • Geographic proximity search -- Find stations near any latitude/longitude coordinate within a configurable radius up to 25 km for localized assessments.
  • City-level filtering -- Narrow results to a specific city with intelligent partial matching on station names and locality fields.
  • Two operating modes -- Retrieve the latest available readings for a real-time snapshot, or specify a date range for historical time-series data.
  • Structured, normalized output -- Each record includes 17 fields: station name, city, country, GPS coordinates, pollutant type, value, unit, UTC/local timestamps, monitor type, and data source.
  • Configurable result limits -- Control output volume from 1 to 1,000 records per run to fit your use case and budget.
  • Dry-run mode -- Run without an API key to preview the output schema and sample data before configuring production queries.
  • Summary logging -- Each run logs value range (min/max/average), countries covered, and unique station count for quick validation.
  • Lightweight execution -- Runs on 256 MB memory in 10--30 seconds with no browser rendering or heavy computation.

How to use

Apify Console

  1. Get a free API key. Visit explore.openaq.org, create a free account, and copy your API key from account settings.
  2. Open the actor. Navigate to the OpenAQ Air Quality Data Search page on the Apify Store and click "Start".
  3. Enter your API key. Paste it into the "OpenAQ API Key" field. The field is encrypted and marked as secret.
  4. Set your filters. Choose a country code, optionally enter a city name, select a pollutant, and configure any date range or coordinate filters.
  5. Run and export. Click "Start" and wait for results in the Dataset tab. Download as JSON, CSV, or Excel, or use integrations for automated delivery.

API (Python)

from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("XXDvwdapkYoEC8dyx").call(run_input={
"apiKey": "YOUR_OPENAQ_KEY",
"country": "US",
"city": "Los Angeles",
"parameter": "pm25",
"maxResults": 50,
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(f"{item['locationName']}: {item['value']} {item['unit']}")

API (JavaScript)

import { ApifyClient } from "apify-client";
const client = new ApifyClient({ token: "YOUR_APIFY_TOKEN" });
const run = await client.actor("XXDvwdapkYoEC8dyx").call({
apiKey: "YOUR_OPENAQ_KEY",
country: "GB",
city: "London",
parameter: "no2",
maxResults: 50,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => console.log(`${item.locationName}: ${item.value} ${item.unit}`));

Input parameters

ParameterTypeRequiredDefaultDescription
apiKeyStringYes--Your free OpenAQ API key from explore.openaq.org. Without it, the actor runs in dry-run mode.
countryStringNoUSISO 3166-1 alpha-2 country code (e.g., US, GB, IN, CN, DE). Leave empty for worldwide.
cityStringNo--Filter stations by city or locality name. Uses partial matching on station names and locality fields.
parameterSelectNopm25Pollutant to measure: pm25, pm10, o3, no2, so2, or co.
dateFromStringNo--Start date in YYYY-MM-DD format for historical data. Omit for latest readings.
dateToStringNo--End date in YYYY-MM-DD format for historical data. Omit for latest readings.
latitudeNumberNo--Latitude for proximity search. Use with longitude and optionally radius.
longitudeNumberNo--Longitude for proximity search. Use with latitude and optionally radius.
radiusIntegerNo25000Search radius in meters from coordinates. Range: 1--25,000 (25 km).
maxResultsIntegerNo100Maximum measurement records to return. Range: 1--1,000.

Input JSON example

{
"apiKey": "YOUR_OPENAQ_KEY",
"country": "IN",
"city": "Delhi",
"parameter": "pm25",
"dateFrom": "2025-12-01",
"dateTo": "2025-12-31",
"maxResults": 200
}

Tips

  • PM2.5 has the best global coverage. Other parameters like SO2 or CO may have fewer reporting stations in some regions.
  • Coordinate search is ideal for hyperlocal analysis -- pair latitude/longitude with a small radius to find the nearest stations to a school, hospital, or factory.
  • Omit date fields for real-time data. The actor fetches the latest available reading from each station when no date range is specified.

Output

Each run produces a dataset of air quality measurement records with 17 fields per record.

Output JSON example

[
{
"locationId": 2178,
"locationName": "Del Norte",
"city": "Albuquerque",
"country": "United States",
"countryCode": "US",
"latitude": 35.1353,
"longitude": -106.5847,
"parameter": "pm25",
"parameterDisplayName": "PM2.5",
"value": 8.3,
"unit": "ug/m3",
"dateUtc": "2025-01-15T12:00:00Z",
"dateLocal": "2025-01-15T05:00:00-07:00",
"isMonitor": true,
"isMobile": false,
"sourceName": "AirNow",
"extractedAt": "2025-01-15T14:30:00.000Z"
},
{
"locationId": 8714,
"locationName": "Anand Vihar",
"city": "Delhi",
"country": "India",
"countryCode": "IN",
"latitude": 28.6508,
"longitude": 77.3152,
"parameter": "pm25",
"parameterDisplayName": "PM2.5",
"value": 156.4,
"unit": "ug/m3",
"dateUtc": "2025-01-15T10:30:00Z",
"dateLocal": "2025-01-15T16:00:00+05:30",
"isMonitor": true,
"isMobile": false,
"sourceName": "CPCB",
"extractedAt": "2025-01-15T14:30:00.000Z"
}
]

Output fields

FieldTypeDescription
locationIdIntegerOpenAQ station identifier
locationNameStringMonitoring station name
cityStringCity or locality of the station
countryStringFull country name
countryCodeStringISO alpha-2 country code
latitudeNumberStation latitude
longitudeNumberStation longitude
parameterStringPollutant code (pm25, no2, o3, etc.)
parameterDisplayNameStringDisplay name (PM2.5, NO2, etc.)
valueNumberMeasured concentration
unitStringUnit (typically ug/m3 or ppm)
dateUtcStringMeasurement timestamp in UTC
dateLocalStringMeasurement timestamp in local timezone
isMonitorBooleanReference-grade monitor flag
isMobileBooleanMobile station flag
sourceNameStringData provider (AirNow, DEFRA, CPCB, etc.)
extractedAtStringActor extraction timestamp

Use cases

  • Urban pollution monitoring -- Track PM2.5 and NO2 across major cities to identify pollution hotspots and assess trends.
  • Health impact research -- Build historical datasets for epidemiological studies linking pollution to respiratory outcomes.
  • Regulatory compliance -- Monitor whether pollutant concentrations in industrial zones stay within WHO or national thresholds.
  • Environmental journalism -- Gather data-driven evidence on pollution sources, seasonal patterns, and cross-border events.
  • Real estate analysis -- Compare air quality across neighborhoods for property buyers and renters.
  • Smart city dashboards -- Feed live readings into municipal dashboards and public-facing community displays.
  • Wildfire smoke tracking -- Monitor PM2.5 spikes during wildfire season to assess smoke dispersion and health impact.
  • Academic research -- Collect structured time-series data for climate science, atmospheric modeling, and ML projects.
  • Supply chain risk -- Evaluate air quality at manufacturing sites and logistics hubs impacting worker health.
  • Community alerts -- Automate notifications when local pollution exceeds safe thresholds via scheduled runs and webhooks.

API and integration

Python

from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("XXDvwdapkYoEC8dyx").call(run_input={
"apiKey": "YOUR_OPENAQ_KEY",
"country": "DE",
"parameter": "o3",
"maxResults": 100,
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(f"{item['locationName']} ({item['countryCode']}): {item['value']} {item['unit']}")

JavaScript

import { ApifyClient } from "apify-client";
const client = new ApifyClient({ token: "YOUR_APIFY_TOKEN" });
const run = await client.actor("XXDvwdapkYoEC8dyx").call({
apiKey: "YOUR_OPENAQ_KEY",
country: "IN",
city: "Mumbai",
parameter: "pm10",
maxResults: 100,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(`Retrieved ${items.length} measurements`);

cURL

curl -X POST "https://api.apify.com/v2/acts/XXDvwdapkYoEC8dyx/runs?token=YOUR_APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"apiKey": "YOUR_OPENAQ_KEY",
"country": "US",
"city": "Chicago",
"parameter": "pm25",
"maxResults": 50
}'

Integrations

  • Google Sheets -- Export air quality data to spreadsheets for visualization and sharing.
  • Slack / Email -- Send alerts when pollutant levels exceed health thresholds.
  • Amazon S3 / Google Cloud Storage -- Archive historical measurements for long-term analysis.
  • Webhooks -- Push new readings to your own API endpoint for real-time processing.
  • Zapier / Make -- Connect air quality data to thousands of apps without code.

How it works

The actor follows a multi-stage pipeline to retrieve and normalize air quality data from the OpenAQ v3 API.

  1. Input validation -- Maps the selected pollutant to an OpenAQ parameter ID (e.g., pm25 to ID 2, no2 to ID 7).
  2. Location discovery -- Queries /locations with country code, parameter ID, and optional coordinate/radius filters.
  3. City filtering -- Client-side partial matching on station names and locality fields.
  4. Latest mode -- Without date range, fetches the most recent reading via /locations/{id}/latest.
  5. Historical mode -- With dateFrom/dateTo, fetches sensor measurements via /sensors/{id}/measurements.
  6. Normalization -- Transforms responses into a flat 17-field schema consistent across all networks.
  7. Output -- Pushes records to the Apify dataset and logs a summary (value range, countries, station count).
Input Parameters
|
v
[ Validate & Map Pollutant to ID ]
|
v
[ GET /locations (country, coords, parameter_id) ]
|
v
[ City Filter (partial match) ]
|
+----+----+
| |
v v
No Date Date Range
Range Specified
| |
v v
GET GET
/locations /sensors/{id}/
/{id}/ measurements
latest |
| |
+----+----+
|
v
[ Normalize to 17 output fields ]
|
v
Apify Dataset + Summary Log

Performance and cost

ScenarioStationsResultsMemoryDurationEst. Cost
Single city, latest PM2.55--1510--15256 MB~10 sec~$0.001
Country-wide US, latest NO250--200100256 MB~15 sec~$0.002
City + date range, 1 month10--30200256 MB~20 sec~$0.003
Worldwide PM2.5, max results500+1,000256 MB~30 sec~$0.005
Daily scheduled run (30 days)varies100/day256 MB~15 sec/run~$0.06/mo

The OpenAQ API key is completely free with no usage fees. All costs above are Apify platform compute credits only.


Limitations

  • API key required -- A free OpenAQ API key is mandatory for fetching real data. Without it, the actor runs in dry-run mode with sample output only.
  • Maximum 1,000 results per run -- The actor caps output at 1,000 measurement records. For larger datasets, run multiple queries with different filters.
  • Radius limit of 25 km -- Geographic proximity search is capped at 25,000 meters from the specified coordinates.
  • Data freshness varies -- Most government monitoring networks report with a 1--6 hour delay. The dateUtc field shows the actual measurement time.
  • City filtering is client-side -- City name matching uses partial string comparison on station names and locality fields, which may miss stations with unconventional naming.
  • Six pollutants only -- The actor supports PM2.5, PM10, O3, NO2, SO2, and CO. Other parameters available in OpenAQ (e.g., BC, NH3) are not currently mapped.
  • Station coverage varies by region -- Developed countries typically have denser monitoring networks. Rural and developing regions may have sparse or no coverage for certain pollutants.

Responsible use

  • Verify critical decisions against primary sources. For regulatory compliance or public health advisories, cross-check data against the original government monitoring network (e.g., EPA AirNow, DEFRA, CPCB). The sourceName field identifies the original provider.
  • Respect OpenAQ terms of service. OpenAQ provides data under open licenses for public benefit. Do not use the data in ways that misrepresent pollution levels or mislead the public.
  • Attribute data sources appropriately. When publishing or sharing air quality data collected through this actor, credit both OpenAQ and the original monitoring network.
  • Use scheduled runs responsibly. While the API is free, avoid unnecessary high-frequency polling. Hourly or daily collection is sufficient for most monitoring use cases.
  • Contextualize measurements properly. Raw pollutant concentrations require context -- always reference WHO guidelines or national air quality standards when interpreting values.

FAQ

Do I need to pay for an OpenAQ API key?

No. The OpenAQ API key is completely free. Visit explore.openaq.org, create an account, and generate your key at no cost. OpenAQ is a nonprofit organization providing universally accessible air quality data.

What countries are covered?

OpenAQ aggregates data from government networks in 100+ countries, including the US (EPA/AirNow), UK (DEFRA), India (CPCB), China (MEE), Germany (UBA), France, Australia, Brazil, and more.

How current is the data?

Without date filters, the actor fetches the latest reading from each station. Most networks report with a 1--6 hour delay. The dateUtc field shows the exact measurement time.

What is dry-run mode?

Running without an API key outputs sample data and instructions for obtaining a free key. This lets you preview the output schema before production use.

What is the difference between PM2.5 and PM10?

PM2.5 measures fine particles 2.5 micrometers or smaller that penetrate deep into lungs and bloodstream -- the most health-critical pollutant. PM10 covers coarser particles up to 10 micrometers, including dust and pollen. Both are measured in micrograms per cubic meter.

Can I get historical data?

Yes. Set dateFrom and dateTo in YYYY-MM-DD format. The actor switches to the sensor-level measurements endpoint for date-range queries.

How do I search near a specific address?

Convert your address to coordinates using a geocoding service or the Nominatim Geocoder actor, then provide latitude, longitude, and radius.

Why are some stations missing?

Station availability depends on the network's reporting status. Some stations go offline for maintenance, and not all stations measure every pollutant. Try broadening your radius or switching to PM2.5, which has the widest coverage.

Can I schedule recurring collection?

Yes. Use Apify's scheduling feature to run the actor hourly, daily, or at any custom interval. Results accumulate in your dataset, building a comprehensive pollution time-series.

What units are the measurements in?

Most pollutants are reported in micrograms per cubic meter (ug/m3). Carbon monoxide may use parts per million (ppm). The unit field in each record specifies the exact unit.

How do I compare readings against health guidelines?

The WHO annual PM2.5 guideline is 5 ug/m3, and the 24-hour guideline is 15 ug/m3. The US EPA AQI uses different breakpoints. Cross-reference the value and parameter fields with the appropriate standard for your region.

Can I use the Apify API?

Yes. Use actor ID XXDvwdapkYoEC8dyx or slug ryanclinton/openaq-air-quality with the REST API, Python client, or JS client.


ActorDescription
NOAA Weather Alert MonitorCombine severe weather alerts with air quality data for comprehensive environmental monitoring.
GDACS Disaster AlertsTrack natural disasters like wildfires and volcanic eruptions that directly impact air quality levels.
Weather Forecast SearchPair air pollution data with weather forecasts for environmental and health impact analysis.
Nominatim GeocoderConvert street addresses to latitude/longitude coordinates for precise location-based station searches.
UK Flood WarningsMonitor UK flood warnings alongside air quality data for multi-hazard environmental dashboards.
World Bank Development IndicatorsCorrelate air pollution levels with economic development indicators for cross-country research.