The air quality API endpoint provides current information for locations globally. When available, nearby air quality stations will be used to interpolate air quality values for more accurate readings. This endpoint includes the air quality index (AQI), category, dominant pollutant, and information for a variety of pollutants when available.
Check out our Air Quality Release Blog for additional information.
Use our wizard to try out this endpoint
The following actions are supported with the airquality 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:
filter | filter=:string |
Predefined filters for limiting the results. The filter value can be a single, comma-delimited or a semicolon delimited string of filter names. |
fields | fields=:string |
Provides a comma separated list of values for the API to return. This parameter is often used to limit the amount of data returned. See Reducing Output. |
format | format=:string |
Defines the API output format. The available options include:format=json - Standard JSON output. This is the default.format=geojson - API will output GeoJSON.If obtaining GeoJSON and using the fields parameter, be sure to include loc to ensure geographical references are available in the response.
|
plimit | plimit=:total |
Applied only on the periods property, the total number of periods to return as an integer. The maximum plimit for this endpoint is 250. |
pskip | pskip=:number |
Applied only on the periods property, used to skip over a specific number of periods in the data set. |
psort | psort=:string |
Applied only on the periods property, used to sort results based on certain fields contained within the periods. |
The following filters can be passed to the filter parameter to reduce the results that are returned:
china | Utilize the Chinese Government AQI categories, in place of the default AirNOW categories For more information on various Air Quality Index standards, please visit the wiki page. |
india | Utilize the India AQI categories, in place of the default AirNOW categories For more information on various Air Quality Index standards, please visit the wiki page. |
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 estimated air quality information for Beijing, China/airquality/beijing,cn?
Returns the estimated air quality information for zip code 55403 (Minneapolis, MN)/airquality/55403?
Returns the estimated air quality information for the specified latitude, longitude./airquality/44.9778,-93.265?
Returns the estimated air quality information for Beijing, China using the China defines air quality categories./airquality/beijing,cn?filter=china&
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",
"dominant": "o3",
"pollutants": [{
"type": "o3",
"name": "ozone",
"valuePPB": 61,
"valueUGM3": 122.3333,
"aqi": 69,
"category": "moderate",
"color": "FFFF00",
"method": "airnow"
}, {
"type": "pm2.5",
"name": "particle matter (<2.5µm)",
"valuePPB": null,
"valueUGM3": 14.6,
"aqi": 56,
"category": "moderate",
"color": "FFFF00",
"method": "airnow"
}, {
"type": "pm10",
"name": "particle matter (<10µm)",
"valuePPB": null,
"valueUGM3": 36.7778,
"aqi": 33,
"category": "good",
"color": "00E400",
"method": "airnow"
}, {
"type": "co",
"name": "carbon monoxide",
"valuePPB": 348.8889,
"valueUGM3": 400,
"aqi": 4,
"category": "good",
"color": "00E400",
"method": "airnow"
}, {
"type": "no2",
"name": "nitrogen dioxide",
"valuePPB": 36,
"valueUGM3": 68.4444,
"aqi": 33,
"category": "good",
"color": "00E400",
"method": "airnow"
}, {
"type": "so2",
"name": "sulfur dioxide",
"valuePPB": 0.3333,
"valueUGM3": 2.2222,
"aqi": 0,
"category": "good",
"color": "00E400",
"method": "airnow"
}]
}],
"profile": {
"tz": "Asia\/Harbin",
"sources": [{
"name": "China National Environmental Monitoring Centre"
}, {
"name": "StateAir.net"
}, {
"name": "OpenAQ"
}, {
"name": "CAMS"
}],
"stations": ["AQCN_1004a", "AQCN_1001a", "AQCN_1006a", "AQCN_1003a", "AQO_cn85f6cf3", "AQCN_1005a", "AQCN_1011a", "AQCN_1007a", "AQCN_1012a", "AQCN_1010a"]
}
}]
}
{
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [116.4074, 39.9042]
},
"properties": {
"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",
"dominant": "o3",
"pollutants": [{
"type": "o3",
"name": "ozone",
"valuePPB": 61,
"valueUGM3": 122.3333,
"aqi": 69,
"category": "moderate",
"color": "FFFF00",
"method": "airnow"
}, {
"type": "pm2.5",
"name": "particle matter (<2.5µm)",
"valuePPB": null,
"valueUGM3": 14.6,
"aqi": 56,
"category": "moderate",
"color": "FFFF00",
"method": "airnow"
}, {
"type": "pm10",
"name": "particle matter (<10µm)",
"valuePPB": null,
"valueUGM3": 36.7778,
"aqi": 33,
"category": "good",
"color": "00E400",
"method": "airnow"
}, {
"type": "co",
"name": "carbon monoxide",
"valuePPB": 348.8889,
"valueUGM3": 400,
"aqi": 4,
"category": "good",
"color": "00E400",
"method": "airnow"
}, {
"type": "no2",
"name": "nitrogen dioxide",
"valuePPB": 36,
"valueUGM3": 68.4444,
"aqi": 33,
"category": "good",
"color": "00E400",
"method": "airnow"
}, {
"type": "so2",
"name": "sulfur dioxide",
"valuePPB": 0.3333,
"valueUGM3": 2.2222,
"aqi": 0,
"category": "good",
"color": "00E400",
"method": "airnow"
}]
}],
"profile": {
"tz": "Asia\/Harbin",
"sources": [{
"name": "China National Environmental Monitoring Centre"
}, {
"name": "StateAir.net"
}, {
"name": "OpenAQ"
}, {
"name": "CAMS"
}],
"stations": ["AQCN_1004a", "AQCN_1001a", "AQCN_1006a", "AQCN_1003a", "AQO_cn85f6cf3", "AQCN_1005a", "AQCN_1011a", "AQCN_1007a", "AQCN_1012a", "AQCN_1010a"]
}
}
}]
}
The following properties will be provided in every response object:
periods | (array) Array of interpolated air quality data by time interval |
periods.#.timestamp | (number) UNIX timestamp of the period. |
periods.#.dateTimeISO | (string) ISO 8601 date of the period. |
periods.#.aqi | (number) The standardized Air Quality Index value from 0 - 500. See AirNow |
periods.#.category | (string) The Air Quality category based on the AQI: See AirNow - good - moderate - usg (Unhealthy for Sensitive Groups) - unhealthy - very Unhealthy - hazardous If using filter=china , the following categories are utilized:More info on China AQI / Categories. - excellent - good - slightly polluted - lightly polluted - moderately polluted - severely polluted If using the filter=india , the following categories are utilizes:More info on India AQI / Categories. - good - satisfactory - moderately polluted - poor - very poor - severe |
periods.#.color | (string) The 6 character hexadecimal color code for the specific category. See AirNow |
periods.#.method | (string) The method used for the AQI calculation: - airnow = Used the EPA AirNow AQI specification (default) - china = Used the China AQI specification (filter=china) - india = Used the India AQI specification (filter=india) |
periods.#.dominant | (string) The dominant pollutant. Normally set to one of the following: - co (Carbon Monoxide) - no2 (Nitrogen Dioxide) - o3 (Ozone) - pm10 (Particle Matter <10µm) - pm2.5 (Particle Matter <2.5µm) - so2 (Sulfur Dioxide) |
periods.#.pollutants | (array) Array of pollutants |
periods.#.pollutants.#.type | (string) The type abbreviation of the pollutant: co = carbon monoxide no2 = nitrogen dioxide o3 = ozone pm1 = partical matter (<1µm) pm10 = partical matter (<10µm) pm2.5 = partical matter (<2.5µm) so2 = sulfer dioxide Note that not all air quality stations provide information on all pollutants. |
periods.#.pollutants.#.name | (string) Name of the pollutant |
periods.#.pollutants.#.valuePPB | (number) The pollutant measurement in parts per billion. Null if this unit is not utilized pm2.5 & pm10 do not utilize PPB. |
periods.#.pollutants.#.valueUGM3 | (number) The pollutant measurement in parts per micrograms per cubic meter. Null if this unit is not utilized |
periods.#.pollutants.#.aqi | (number) The pollutant measurement converted to the common AQI value, from 0 to 500 |
periods.#.pollutants.#.category | (string) The Air Quality category based on the AQI: See AirNow - good - moderate - usg (Unhealthy for Sensitive Groups) - unhealthy - very Unhealthy - hazardous If using filter=china , the following categories are utilized:More info on China AQI / Categories. - excellent - good - slightly polluted - lightly polluted - moderately polluted - severely polluted If using the filter=india , the following categories are utilizes:More info on India AQI / Categories. - good - satisfactory - moderately polluted - poor - very poor - severe |
periods.#.pollutants.#.color | (string) The 6 character hexadecimal color code for the specific category. See AirNow |
profile.sources | (array) Array of sources for the air quality information for this location |
profile.sources.#.name | (string) The name of the source |
profile.stations | (array) Array of the observation station IDs used in the interpolated data |
place.city | (string) The city name of your requested location |
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: September 21, 2023