Air Quality Daily Forecast
Air Quality Daily Forecast API for Chinese cities, including AQI, air quality levels, primary pollutants.
Request URL
https://api.qweather.com/v7/air/5d?[params]
For Free subscription, change the API Host to devapi.qweather.com
. See data available for Free subscription.
Request Parameters
All parameters are separated by &
. If no optional parameters are set, the default value will be used.
-
key
(required)API authentication key, please refer to How To Get Your Key. Support Signature Authentication. Example:key=12334567890ABC
-
location
(required)The location to be queried, support LocationID or comma-separated longitude and latitude (decimal, up to 2 decimal places), LocationID can be obtained by GeoAPI. Example:location=101010100
orlocation=116.41,39.92
-
lang
Multi-language setting, see Language code for available value. If data does not match the language you set, it will return results in English or its native language.
Request Example
Air quality daily forecast for Beijing
curl -L -X GET --compressed 'https://api.qweather.com/v7/air/5d?location=101010100&key=YOUR_KEY'
Response
The response is in JSON format and is Gzip compressed, all fields are Strings.
{
"code": "200",
"updateTime": "2021-02-16T10:42+08:00",
"fxLink": "http://hfx.link/2ax4",
"daily": [
{
"fxDate": "2021-02-16",
"aqi": "46",
"level": "1",
"category": "优",
"primary": "NA"
},
{
"fxDate": "2021-02-17",
"aqi": "47",
"level": "1",
"category": "优",
"primary": "NA"
},
{
"fxDate": "2021-02-18",
"aqi": "67",
"level": "2",
"category": "良",
"primary": "PM2.5"
},
{
"fxDate": "2021-02-19",
"aqi": "101",
"level": "3",
"category": "轻度污染",
"primary": "PM2.5"
},
{
"fxDate": "2021-02-20",
"aqi": "120",
"level": "3",
"category": "轻度污染",
"primary": "PM2.5"
}
],
"refer": {
"sources": [
"cnemc"
],
"license": [
"QWeather Developers License"
]
}
}
-
code
See Status Code -
updateTime
API last update time -
fxLink
Responsive web page of this data, for embedded in website or APP -
daily.fxDate
Forecast date -
daily.aqi
Air Quality Index -
daily.level
AQI level -
daily.category
AQI category -
daily.primary
The main pollutant. Iflevel=1
, returnNA
-
refer.sources
Data source and other statements, may be null -
refer.license
Data license, may be null
Air Quality Index Level
See Air Quality Info.