Time Machine for Air Quality
Get the last 10 days of air quality history data.
Let’s say, today is December 30, you can get data from Dec. 20 to Dec. 29.
Request URL
https://api.qweather.com/v7/historical/air
Request parameters
All parameters are separated by &
. If no optional parameters are set, the default value will be used.
-
location
(required)The location to be queried, only support LocationID and LocationID can be obtained by GeoAPI. For example:location=101010100
-
date
(required)Set the date, up to the most recent 10 days. The date format is yyyyMMdd. Example:date=20200531
-
lang
Multi-language setting, please see Language to find out how our multi-language works and how to set up.
Request Example
Replace your_token
with your JWT or learn more about Authentication
Response
The response is in JSON format and is Gzip compressed.
{
"code": "200",
"fxLink": "http://hfx.link/2ax6",
"airHourly": [
{
"pubTime": "2020-07-25 00:00",
"aqi": "52",
"level": "2",
"category": "良",
"primary": "PM10",
"pm10": "54",
"pm2p5": "22",
"no2": "31",
"so2": "2",
"co": "0.5",
"o3": "85"
},
{
"pubTime": "2020-07-25 01:00",
"aqi": "52",
"level": "2",
"category": "良",
"primary": "PM10",
"pm10": "54",
"pm2p5": "22",
"no2": "45",
"so2": "2",
"co": "0.5",
"o3": "59"
},
{
"pubTime": "2020-07-25 02:00",
"aqi": "52",
"level": "2",
"category": "良",
"primary": "PM10",
"pm10": "53",
"pm2p5": "22",
"no2": "48",
"so2": "3",
"co": "0.5",
"o3": "53"
},
{
"pubTime": "2020-07-25 03:00",
"aqi": "49",
"level": "1",
"category": "优",
"primary": "NA",
"pm10": "49",
"pm2p5": "23",
"no2": "48",
"so2": "3",
"co": "0.5",
"o3": "48"
},
{
"pubTime": "2020-07-25 04:00",
"aqi": "51",
"level": "2",
"category": "良",
"primary": "PM10",
"pm10": "51",
"pm2p5": "23",
"no2": "56",
"so2": "3",
"co": "0.5",
"o3": "38"
},
{
"pubTime": "2020-07-25 05:00",
"aqi": "52",
"level": "2",
"category": "良",
"primary": "PM10",
"pm10": "53",
"pm2p5": "24",
"no2": "57",
"so2": "3",
"co": "0.5",
"o3": "32"
},
{
"pubTime": "2020-07-25 06:00",
"aqi": "51",
"level": "2",
"category": "良",
"primary": "PM10",
"pm10": "52",
"pm2p5": "22",
"no2": "52",
"so2": "3",
"co": "0.5",
"o3": "35"
},
{
"pubTime": "2020-07-25 07:00",
"aqi": "55",
"level": "2",
"category": "良",
"primary": "PM10",
"pm10": "59",
"pm2p5": "25",
"no2": "47",
"so2": "2",
"co": "0.6",
"o3": "41"
},
{
"pubTime": "2020-07-25 08:00",
"aqi": "60",
"level": "2",
"category": "良",
"primary": "PM10",
"pm10": "69",
"pm2p5": "27",
"no2": "41",
"so2": "3",
"co": "0.6",
"o3": "59"
},
{
"pubTime": "2020-07-25 09:00",
"aqi": "61",
"level": "2",
"category": "良",
"primary": "PM10",
"pm10": "72",
"pm2p5": "30",
"no2": "36",
"so2": "4",
"co": "0.7",
"o3": "88"
},
{
"pubTime": "2020-07-25 10:00",
"aqi": "62",
"level": "2",
"category": "良",
"primary": "PM10",
"pm10": "74",
"pm2p5": "29",
"no2": "32",
"so2": "4",
"co": "0.8",
"o3": "125"
},
{
"pubTime": "2020-07-25 11:00",
"aqi": "58",
"level": "2",
"category": "良",
"primary": "PM10",
"pm10": "66",
"pm2p5": "30",
"no2": "25",
"so2": "4",
"co": "0.8",
"o3": "164"
},
{
"pubTime": "2020-07-25 12:00",
"aqi": "68",
"level": "2",
"category": "良",
"primary": "O3",
"pm10": "61",
"pm2p5": "29",
"no2": "23",
"so2": "3",
"co": "0.7",
"o3": "174"
},
{
"pubTime": "2020-07-25 13:00",
"aqi": "83",
"level": "2",
"category": "良",
"primary": "O3",
"pm10": "52",
"pm2p5": "27",
"no2": "22",
"so2": "3",
"co": "0.7",
"o3": "186"
},
{
"pubTime": "2020-07-25 14:00",
"aqi": "97",
"level": "2",
"category": "良",
"primary": "O3",
"pm10": "41",
"pm2p5": "25",
"no2": "18",
"so2": "3",
"co": "0.6",
"o3": "197"
},
{
"pubTime": "2020-07-25 15:00",
"aqi": "98",
"level": "2",
"category": "良",
"primary": "O3",
"pm10": "51",
"pm2p5": "24",
"no2": "19",
"so2": "2",
"co": "0.5",
"o3": "198"
},
{
"pubTime": "2020-07-25 16:00",
"aqi": "83",
"level": "2",
"category": "良",
"primary": "O3",
"pm10": "54",
"pm2p5": "24",
"no2": "20",
"so2": "2",
"co": "0.5",
"o3": "186"
},
{
"pubTime": "2020-07-25 17:00",
"aqi": "74",
"level": "2",
"category": "良",
"primary": "O3",
"pm10": "59",
"pm2p5": "24",
"no2": "21",
"so2": "2",
"co": "0.6",
"o3": "179"
},
{
"pubTime": "2020-07-25 18:00",
"aqi": "73",
"level": "2",
"category": "良",
"primary": "O3",
"pm10": "62",
"pm2p5": "24",
"no2": "22",
"so2": "2",
"co": "0.6",
"o3": "178"
},
{
"pubTime": "2020-07-25 19:00",
"aqi": "58",
"level": "2",
"category": "良",
"primary": "PM10",
"pm10": "66",
"pm2p5": "25",
"no2": "24",
"so2": "3",
"co": "0.6",
"o3": "166"
},
{
"pubTime": "2020-07-25 20:00",
"aqi": "58",
"level": "2",
"category": "良",
"primary": "PM10",
"pm10": "66",
"pm2p5": "27",
"no2": "28",
"so2": "3",
"co": "0.6",
"o3": "147"
},
{
"pubTime": "2020-07-25 21:00",
"aqi": "66",
"level": "2",
"category": "良",
"primary": "PM10",
"pm10": "82",
"pm2p5": "31",
"no2": "29",
"so2": "3",
"co": "0.7",
"o3": "127"
},
{
"pubTime": "2020-07-25 22:00",
"aqi": "67",
"level": "2",
"category": "良",
"primary": "PM10",
"pm10": "83",
"pm2p5": "32",
"no2": "26",
"so2": "4",
"co": "0.8",
"o3": "125"
},
{
"pubTime": "2020-07-25 23:00",
"aqi": "70",
"level": "2",
"category": "良",
"primary": "PM10",
"pm10": "89",
"pm2p5": "37",
"no2": "28",
"so2": "4",
"co": "0.9",
"o3": "120"
}
],
"refer": {
"sources": [
"QWeather"
],
"license": [
"QWeather Developers License"
]
}
}
-
code
See Status Code -
fxLink
Responsive web page of this data, for embedded in website or APP -
airHourly.pubTime
The data release time from the data source -
airHourly.aqi
Air Quality Index -
airHourly.level
AQI level -
airHourly.category
AQI category -
airHourly.primary
The main pollutant. Iflevel=1
, returnNA
-
airHourly.pm10
PM10 -
airHourly.pm2p5
PM2.5 -
airHourly.no2
Nitrogen dioxide -
airHourly.so2
Sulfur dioxide -
airHourly.co
Carbon monoxide -
airHourly.o3
Ozone -
refer.sources
Data source and other statements, may be null -
refer.license
Data license, may be null