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:
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.
lat requiredLatitude of desired location.
lon requiredLongitude of desired location.
city requiredCity name.
state optionalUS state (for United States cities only).
country optionalCountry name.
X-Api-Key requiredAPI Key associated with your account.
https://api.api-ninjas.com/v1/airquality?city=LondonHeaders
X-Api-KeyLog in or sign up to get your API Key1
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
}
}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.