API Documentation
The /air-quality endpoint returns pollutant and AQI data as JSON for any location. Provide coordinates and select variables. Default: 5 days starting at midnight today. Parameters:
latitude longitude Floating point RequiredWGS84 latitude and longitude. Comma-separated for multiple locations, e.g. &latitude=52.52,48.85&longitude=13.41,2.35. Multi-location responses return a list; CSV/XLSX add location_id.
hourly String arrayComma-separated list of hourly variables, or use multiple &hourly= parameters.
current String arrayVariables for current conditions (latest values).
timeformat String Default: iso8601Use unixtime for Unix epoch seconds (GMT). For daily values, add utc_offset_seconds to get the correct local date.
timezone String Default: GMTTime zone for local timestamps (data starts at 00:00 local). Use any IANA time zone. Set auto to resolve from coordinates. Comma-separated for multiple locations.
past_days Integer (0-92) Default: 0Include past days (e.g. yesterday) in the response.
forecast_days Integer (0-7) Default: 5Number of forecast days (default 5, max 7).
forecast_hours past_hours Integer (>0)Number of hourly timesteps. Uses the current hour as reference instead of midnight.
start_date end_date String (yyyy-mm-dd)Date range in ISO format, e.g. 2022-06-30.
start_hour end_hour String (yyyy-mm-ddThh:mm)Time range for hourly data in ISO format, e.g. 2022-06-30T12:00.
cell_selection String Default: nearestGrid-cell selection: land, sea, or nearest (default).
api_key StringYour API key for authenticated requests.
New optional parameters may be added over time. Required parameters will not change for API stability.
Hourly Parameter Definition
Available hourly air quality variables. Most are instantaneous at the given hour.
pm10 pm2_5 μg/m³Particulate matter with diameter smaller than 10 µm (PM10) and smaller than 2.5 µm (PM2.5) close to surface (10 meter above ground)
carbon_monoxide nitrogen_dioxide sulphur_dioxide ozone μg/m³Atmospheric gases close to surface (10 meter above ground)
carbon_dioxide ppmCO2 close to surface (10 meter above ground)
ammonia μg/m³Ammonia concentration. Only available for Europe.
aerosol_optical_depth DimensionlessAerosol optical depth at 550 nm of the entire atmosphere to indicate haze.
methane μg/m³Methane close to surface (10 meter above ground)
dust μg/m³Saharan dust particles close to surface level (10 meter above ground).
uv_index uv_index_clear_sky IndexUV index considering clouds and clear sky.
alder_pollen birch_pollen grass_pollen mugwort_pollen olive_pollen ragweed_pollen Grains/m³Pollen for various plants. Only available in Europe as provided by CAMS European Air Quality forecast.
european_aqi european_aqi_pm2_5 european_aqi_pm10 european_aqi_nitrogen_dioxide european_aqi_ozone european_aqi_sulphur_dioxide European AQIEuropean Air Quality Index (AQI) calculated for different particulate matter and gases individually. The consolidated european_aqi returns the maximum of all individual indices. Ranges from 0-20 (good), 20-40 (fair), 40-60 (moderate), 60-80 (poor), 80-100 (very poor) and exceeds 100 for extremely poor conditions.
us_aqi us_aqi_pm2_5 us_aqi_pm10 us_aqi_nitrogen_dioxide us_aqi_ozone us_aqi_sulphur_dioxide us_aqi_carbon_monoxide U.S. AQIUnited States Air Quality Index (AQI) calculated for different particulate matter and gases individually. The consolidated us_aqi returns the maximum of all individual indices. Ranges from 0-50 (good), 51-100 (moderate), 101-150 (unhealthy for sensitive groups), 151-200 (unhealthy), 201-300 (very unhealthy) and 301-500 (hazardous).
JSON Return Object
On success a JSON object will be returned.
{
"latitude": 52.52,
"longitude": 13.419,
"elevation": 44.812,
"generationtime_ms": 2.2119,
"utc_offset_seconds": 0,
"timezone": "Europe/Berlin",
"timezone_abbreviation": "CEST",
"hourly": {
"time": ["2022-07-01T00:00", "2022-07-01T01:00", "2022-07-01T02:00", ...],
"pm10": [1, 1.7, 1.7, 1.5, 1.5, 1.8, 2.0, 1.9, 1.3, ...]
},
"hourly_units": {
"pm10": "μg/m³"
},
}latitude longitude Floating pointWGS84 of the center of the weather grid-cell which was used to generate this forecast. This coordinate might be a few kilometres away from the requested coordinate.
generationtime_ms Floating pointGeneration time of the weather forecast in milliseconds. This is mainly used for performance monitoring and improvements.
utc_offset_seconds IntegerApplied timezone offset from the &timezone= parameter.
timezone timezone_abbreviation StringTimezone identifier (e.g. Europe/Berlin) and abbreviation (e.g. CEST)
hourly ObjectFor each selected weather variable, data will be returned as a floating point array. Additionally a time array will be returned with ISO8601 timestamps.
hourly_units ObjectFor each selected weather variable, the unit will be listed here.
Errors
In case an error occurs, for example a URL parameter is not correctly specified, a JSON error object is returned with a HTTP 400 status code.
{
"error": true,
"reason": "Cannot initialize WeatherVariable from invalid String value
temperature_2m for key hourly"
}