Air Quality API
The Air Quality API provides the latest air quality information for any city or geographic location in the world. It provides not only the holistic Air Quality Index (AQI) but also concentrations for major pollutants:
- Carbon monoxide (CO)
- Nitrogen dioxide (NO2)
- Ozone (O3)
- Sulphur dioxide (SO2)
- PM2.5 particulates
- PM10 particulates
API Status
/v1/airquality GET
https://api.api-ninjas.com/v1/airquality
Get air quality by city or location coordinates (latitude/longitude). Returns the air quality index (AQI) and concentrations of major pollutants.
Parameters
latrequiredLatitude of desired location.
lonrequiredLongitude of desired location.
cityrequiredCity name.
stateoptionalUS state (for United States cities only).
countryoptionalCountry name.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Sample Request Live Demo!
https://api.api-ninjas.com/v1/airquality?city=LondonHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{
"overall_aqi": 55,
"CO": {
"concentration": 223.64,
"aqi": 2
},
"PM10": {
"concentration": 3.62,
"aqi": 3
},
"SO2": {
"concentration": 5.13,
"aqi": 7
},
"PM2.5": {
"concentration": 1.82,
"aqi": 5
},
"O3": {
"concentration": 60.8,
"aqi": 55
},
"NO2": {
"concentration": 9.68,
"aqi": 12
}
}Code Examples
1
2
curl -X GET "https://api.api-ninjas.com/v1/airquality?city=london" \
-H "X-Api-Key: YOUR_API_KEY"If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.