Documentation Index
Fetch the complete documentation index at: https://mintlify.com/NASAARSET/PM2.5_AQ_Online_2026/llms.txt
Use this file to discover all available pages before exploring further.
F_get_OpenAQ_from_API retrieves ground-based air quality monitor measurements
from the OpenAQ v3 REST API for any combination of
pollutants, monitor types, geographic region, and time period. The function
handles pagination automatically, converts all measurements to a consistent
unit (µg/m³), and returns a tidy pandas.DataFrame indexed by (lat, lon, time) — the same format expected by F_compute_metrics.
Use this function to build the observed side of a satellite-vs-ground
validation workflow. It is the standard way to pull OpenAQ data throughout the
ARSET PM2.5 case-study notebooks, and its output DataFrame can be merged
directly with collocated satellite estimates produced by
F_subset_and_combine.
Parameters
Minimum (western) longitude of the bounding box, in decimal degrees.
Minimum (southern) latitude of the bounding box, in decimal degrees.
Maximum (eastern) longitude of the bounding box, in decimal degrees.
Maximum (northern) latitude of the bounding box, in decimal degrees.
Start of the time window. Must be a
numpy.datetime64 object. Measurements
before this timestamp are excluded from the result.End of the time window. Must be a
numpy.datetime64 object. Measurements
after this timestamp are excluded from the result.List of pollutant variable names to query. The full set supported by the
internal
All returned concentration values are normalised to µg/m³ regardless of
the original reporting unit (ppm, ppb, or µg/m³).
d_params lookup is:| Name | OpenAQ parameter |
|---|---|
'PM2.5' | PM 2.5 |
'PM10' | PM 10 |
'CO' | Carbon monoxide |
'O3' | Ozone |
'NO2' | Nitrogen dioxide |
'SO2' | Sulfur dioxide |
'BC' | Black carbon |
If
True, results from reference-grade regulatory monitors (FEM/FRM
instruments) are included. Set to False to exclude them.If
True, results from low-cost sensor networks are included alongside
(or instead of) reference monitors. Low-cost data may have higher
uncertainty; use with care in validation studies.Your OpenAQ API key. Defaults to the
s_key_openAQ variable defined at the
top of the notebook. Register for a free key at
openaq.org.Return Value
A
pandas.DataFrame with a three-level MultiIndex of (lat, lon, time).
Each row represents one hourly measurement at one monitor location. Columns
include at minimum the requested pollutant name(s) (e.g., 'PM2.5').Returns None if no monitors or measurements are found in the specified
region and time window.API Endpoints Used
The function makes sequential requests to three OpenAQ v3 endpoints:| Step | Endpoint | Purpose |
|---|---|---|
| 1 | GET https://api.openaq.org/v3/parameters | Resolve pollutant name → numeric parameter ID |
| 2 | GET https://api.openaq.org/v3/locations?limit=1000&page={n_page}&bbox=... | List monitor locations inside the bounding box |
| 3 | GET https://api.openaq.org/v3/sensors/{n_sensor_id}/measurements?limit=1000&page={n_page}&datetime_from=...&datetime_to=... | Download time-series measurements per sensor |
Usage Example
Fetch hourly PM2.5 readings from reference monitors in the Biobío region of Chile for January 2023:Fetching multiple pollutants with low-cost sensors
The OpenAQ v3 API requires authentication for sustained use. Unauthenticated
requests are subject to very low rate limits. Set
s_key to your personal
API key or store it in the s_key_openAQ notebook variable before calling
this function. Register at openaq.org.Unit conversion is applied automatically. Values originally reported in
ppm or ppb are converted to µg/m³ using standard temperature
and pressure (STP) factors before the DataFrame is assembled. No manual
unit handling is required.
Related
F_compute_metrics— pass the returned DataFrame directly as the ground-truth input for satellite validation metrics.F_get_SINCA_from_web— an alternative data source for Chilean ground monitors not covered by OpenAQ.F_plot_map— visualise monitor locations and concentrations on a map usinga_data_plot_point.- OpenAQ Data Source — background on the OpenAQ platform and data quality tiers.
