历史空气质量

获取最近10天的中国空气质量历史数据。

例如今天是12月30日,最多可获取12月20日至12月29日的空气质量历史数据。

如需要更长时间的城市历史数据或格点历史数据,请与我们联系

请求URL

https://datasetapi.qweather.com/v7/historical/air?[请求参数]

请求参数

请求参数包括必选和可选参数,如不填写可选参数将使用其默认值,参数之间使用&进行分隔。

location

需要查询的地区,仅支持LocationID,LocationID可通过城市搜索服务获取。例如 location=101010100

date

选择日期,最多可选择最近10天(不包含今天)的数据。日期格式为yyyyMMdd,例如 date=20200531

key

用户认证key,请参考如何获取你的KEY。支持数字签名方式进行认证。例如 key=123456789ABC

lang

多语言设置,默认中文,当数据不匹配你设置的语言时,将返回英文或其本地语言结果。

返回数据

// 北京空气质量历史数据 
// 商业版 https://api.qweather.com/v7/historical/air?location=101010100&date=20200725&key=你的KEY
// 请将示例中的date更换成最近10天的日期

{
  "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.com"
    ],
    "license": [
      "commercial license"
    ]
  }
}
参数 描述
code

API状态码,具体含义请参考状态码

fxLink

当前数据的响应式页面,便于嵌入网站或应用

airHourly.pubTime

空气质量数据发布时间

airHourly.aqi

空气质量指数

airHourly.level

空气质量指数等级

airHourly.category

空气质量指数级别

airHourly.primary

空气质量的主要污染物,空气质量为优时,返回值为NA

airHourly.pm10

PM10

airHourly.pm2p5

PM2.5

airHourly.no2

二氧化氮

airHourly.so2

二氧化硫

airHourly.co

一氧化碳

airHourly.o3

臭氧

refer.sources

原始数据来源,或数据源说明,可能为空

refer.license

数据许可或版权声明,可能为空