The air quality index API endpoint provides the current air quality index value for locations globally. This endpoint includes the air quality index (AQI), the associated category, and the standard category color for the requested location.
The AQI value is calculated based on the US AirNow formulas. If other air quality calculations, such as for China, India, Europe, Germany, and the UK, or individual pollutant information is needed please review the Air Quality Endpoint, available with the Air Quality Essentials Add-on.
The following actions are supported with the airquality/index endpoint:
:id | Requesting data by using the :id action is used for returning data for a particular item that has an ID associated with it. This is the primary method for requesting general weather information for a single location (observations, forecasts, advisories, etc.) as the location's name or a zip code serves as the id. Other endpoints may expect a certain value for the ID, such as storm cells whose ID value is a combination of the radar site identifier and unique identifier assigned to every storm cell. Refer to an endpoint's detailed documentation for specific information regarding how to use the :id action. |
route | The route action returns data for points along a given route. This can be useful to obtain weather information along a transportation route, trails and more. The route is a series of locations, usually latitude/longitudes provided via the p query parameter or for longer routes via GeoJSON within a POST request. The route will return an array of GeoJSON points with the requested data for each point. |
The following parameters are optional unless otherwise noted:
p | p=:place |
Defines the location to query data for. Refer to the list of supported place value formats. |
The /[:endpoint]/[:action]?
portion within the query template below can be exchanged with any of the examples. Also, please note you will need to input your client credentials in the [ID]
and [SECRET]
fields which can be found under the Apps section of the members area.
https://api.aerisapi.com/[:endpoint]/[:action]?client_id=[ID]&client_secret=[SECRET]
Returns the air quality index for Beijing, China/airquality/index/beijing,cn?
Returns the air quality index for zip code 55403 (Minneapolis, MN)/airquality/index/55403?
Returns the air quality index for the specified latitude, longitude./airquality/index/44.9778,-93.265?
The following is an example of what each object in the response will consist of. Depending on your requested action, the response may contain multiple instances of this object within an array.
{
"success": true,
"error": null,
"response": [{
"id": null,
"loc": {
"lat": 39.9042,
"long": 116.4074
},
"place": {
"name": "beijing",
"state": "bj",
"country": "cn"
},
"periods": [{
"dateTimeISO": "2018-05-30T06:00:00+08:00",
"timestamp": 1527631200,
"aqi": 69,
"category": "moderate",
"color": "FFFF00",
"method": "airnow"
}],
"profile": {
"tz": "Asia\/Harbin",
"sources": [{
"name": "China National Environmental Monitoring Centre"
}, {
"name": "StateAir.net"
}, {
"name": "OpenAQ"
}, {
"name": "CAMS"
}],
"stations":null
}
}]
}
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
-93.26384,
44.97997
]
},
"properties": {
"id": null,
"loc": {
"lat": 44.97997,
"long": -93.26384
},
"place": {
"name": "minneapolis",
"state": "mn",
"country": "us"
},
"periods": [
{
"dateTimeISO": "2023-09-21T09:00:00-05:00",
"timestamp": 1695304800,
"aqi": 50,
"category": "good",
"color": "00E400",
"method": "airnow"
}
],
"profile": {
"tz": "America/Chicago",
"sources": [
{
"name": "AirNow (EPA)"
},
{
"name": "Minnesota Pollution Control Agency"
},
{
"name": "CAMS"
},
{
"name": "Vaisala Xweather"
}
],
"stations": null
}
}
}
]
}
The following properties will be provided in every response object:
periods | (array) Array of air quality observations |
periods.#.timestamp | (number) UNIX timestamp of the period. |
periods.#.dateTimeISO | (number) ISO 8601 date of the period. |
periods.#.aqi | (number) The standardized Air Quality Index value from 0 - 500. See AirNow |
periods.#.category | (number) The Air Quality category based on the AQI: See AirNow - good - moderate - usg (Unhealthy for Sensitive Groups) - unhealthy - very Unhealthy - hazardous |
periods.#.color | (string) The 6 character hexadecimal color code for the specific category. See AirNow |
periods.#.method | (string) The calculations used. Always 'airnow' |
profile.sources | (array) Array of sources for the air quality information for this location |
profile.sources.#.name | (number) The name of the source |
loc.long | (number) The longitude coordinate of the record. |
loc.lat | (number) The latitude coordinate of the record. |
place.name | (string) The place or nearest place to the record. |
place.state | (string) The state abbreviation in which the record is located. This may be null depending on the country. |
place.country | (string) The country abbreviation in which the record is located. |
profile.tz | (string) The timezone name association with the record's location. |
Last modified: October 02, 2023