实时空气质量

实时空气质量API,支持中国3240市县区以及1700个国控站点实时空气质量的查询,包括AQI数值、空气质量等级、首要污染物、PM10、PM2.5、臭氧、二氧化氮、二氧化硫、一氧化碳数值。

请求URL #

  • 商业版https://api.qweather.com/v7/air/now?[请求参数]
  • 开发版https://devapi.qweather.com/v7/air/now?[请求参数]

请求参数 #

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

key

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

location

需要查询地区的LocationID或以英文逗号分隔的经度,纬度坐标(十进制),LocationID可通过城市搜索服务获取。例如 location=101010100location=116.41,39.92

lang

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

gzip

对API接口进行压缩,可以极大的减少API接口访问延迟,减少缓存空间,提高接口连接成功率。默认开启gzip

  • y 使用gzip方式压缩,默认
  • n 不使用压缩

返回数据 #

// 北京空气质量实况 
// 商业版:https://api.qweather.com/v7/air/now?location=101010100&key=你的KEY
// 开发版:https://devapi.qweather.com/v7/air/now?location=101010100&key=你的KEY

{
  "code": "200",
  "updateTime": "2021-02-16T14:42+08:00",
  "fxLink": "http://hfx.link/2ax4",
  "now": {
    "pubTime": "2021-02-16T14:00+08:00",
    "aqi": "28",
    "level": "1",
    "category": "优",
    "primary": "NA",
    "pm10": "28",
    "pm2p5": "5",
    "no2": "3",
    "so2": "2",
    "co": "0.2",
    "o3": "76"
  },
  "station": [
    {
      "pubTime": "2021-02-16T14:00+08:00",
      "name": "密云镇",
      "id": "CNA3697",
      "aqi": "20",
      "level": "1",
      "category": "优",
      "primary": "NA",
      "pm10": "4",
      "pm2p5": "4",
      "no2": "4",
      "so2": "3",
      "co": "0.2",
      "o3": "63"
    },
    {
      "pubTime": "2021-02-16T14:00+08:00",
      "name": "丰台小屯",
      "id": "CNA3696",
      "aqi": "57",
      "level": "2",
      "category": "良",
      "primary": "PM10",
      "pm10": "63",
      "pm2p5": "6",
      "no2": "4",
      "so2": "2",
      "co": "0.2",
      "o3": "73"
    },
    {
      "pubTime": "2021-02-16T14:00+08:00",
      "name": "怀柔新城",
      "id": "CNA3695",
      "aqi": "25",
      "level": "1",
      "category": "优",
      "primary": "NA",
      "pm10": "7",
      "pm2p5": "3",
      "no2": "2",
      "so2": "3",
      "co": "0.1",
      "o3": "78"
    },
    {
      "pubTime": "2021-02-16T14:00+08:00",
      "name": "延庆石河营",
      "id": "CNA3694",
      "aqi": "26",
      "level": "1",
      "category": "优",
      "primary": "NA",
      "pm10": "15",
      "pm2p5": "3",
      "no2": "4",
      "so2": "2",
      "co": "0.4",
      "o3": "83"
    },
    {
      "pubTime": "2021-02-16T14:00+08:00",
      "name": "大兴旧宫",
      "id": "CNA3675",
      "aqi": "31",
      "level": "1",
      "category": "优",
      "primary": "NA",
      "pm10": "31",
      "pm2p5": "5",
      "no2": "2",
      "so2": "1",
      "co": "0.2",
      "o3": "73"
    },
    {
      "pubTime": "2021-02-16T14:00+08:00",
      "name": "房山燕山",
      "id": "CNA3674",
      "aqi": "26",
      "level": "1",
      "category": "优",
      "primary": "NA",
      "pm10": "19",
      "pm2p5": "4",
      "no2": "3",
      "so2": "4",
      "co": "0.2",
      "o3": "83"
    },
    {
      "pubTime": "2021-02-16T14:00+08:00",
      "name": "通州东关",
      "id": "CNA3673",
      "aqi": "22",
      "level": "1",
      "category": "优",
      "primary": "NA",
      "pm10": "15",
      "pm2p5": "4",
      "no2": "1",
      "so2": "3",
      "co": "0.3",
      "o3": "70"
    },
    {
      "pubTime": "2021-02-16T14:00+08:00",
      "name": "丰台云岗",
      "id": "CNA3672",
      "aqi": "45",
      "level": "1",
      "category": "优",
      "primary": "NA",
      "pm10": "45",
      "pm2p5": "5",
      "no2": "1",
      "so2": "1",
      "co": "0.2",
      "o3": "82"
    },
    {
      "pubTime": "2021-02-16T14:00+08:00",
      "name": "门头沟三家店",
      "id": "CNA3671",
      "aqi": "66",
      "level": "2",
      "category": "良",
      "primary": "PM10",
      "pm10": "82",
      "pm2p5": "6",
      "no2": "2",
      "so2": "1",
      "co": "0.2",
      "o3": "76"
    },
    {
      "pubTime": "2021-02-16T14:00+08:00",
      "name": "密云新城",
      "id": "CNA3418",
      "aqi": "23",
      "level": "1",
      "category": "优",
      "primary": "NA",
      "pm10": "11",
      "pm2p5": "3",
      "no2": "2",
      "so2": "3",
      "co": "0.2",
      "o3": "73"
    },
    {
      "pubTime": "2021-02-16T14:00+08:00",
      "name": "平谷新城",
      "id": "CNA3417",
      "aqi": "24",
      "level": "1",
      "category": "优",
      "primary": "NA",
      "pm10": "7",
      "pm2p5": "3",
      "no2": "1",
      "so2": "2",
      "co": "0.2",
      "o3": "74"
    },
    {
      "pubTime": "2021-02-16T14:00+08:00",
      "name": "延庆夏都",
      "id": "CNA3281",
      "aqi": "25",
      "level": "1",
      "category": "优",
      "primary": "NA",
      "pm10": "15",
      "pm2p5": "3",
      "no2": "2",
      "so2": "1",
      "co": "0.2",
      "o3": "80"
    },
    {
      "pubTime": "2021-02-16T14:00+08:00",
      "name": "古城",
      "id": "CNA1012",
      "aqi": "56",
      "level": "2",
      "category": "良",
      "primary": "PM10",
      "pm10": "61",
      "pm2p5": "8",
      "no2": "2",
      "so2": "1",
      "co": "0.2",
      "o3": "76"
    },
    {
      "pubTime": "2021-02-16T14:00+08:00",
      "name": "奥体中心",
      "id": "CNA1011",
      "aqi": "24",
      "level": "1",
      "category": "优",
      "primary": "NA",
      "pm10": "23",
      "pm2p5": "3",
      "no2": "4",
      "so2": "2",
      "co": "0.2",
      "o3": "74"
    },
    {
      "pubTime": "2021-02-16T14:00+08:00",
      "name": "昌平镇",
      "id": "CNA1010",
      "aqi": "24",
      "level": "1",
      "category": "优",
      "primary": "NA",
      "pm10": "17",
      "pm2p5": "5",
      "no2": "2",
      "so2": "1",
      "co": "0.2",
      "o3": "75"
    },
    {
      "pubTime": "2021-02-16T14:00+08:00",
      "name": "怀柔镇",
      "id": "CNA1009",
      "aqi": "25",
      "level": "1",
      "category": "优",
      "primary": "NA",
      "pm10": "10",
      "pm2p5": "8",
      "no2": "2",
      "so2": "3",
      "co": "0.2",
      "o3": "77"
    },
    {
      "pubTime": "2021-02-16T14:00+08:00",
      "name": "顺义新城",
      "id": "CNA1008",
      "aqi": "33",
      "level": "1",
      "category": "优",
      "primary": "NA",
      "pm10": "33",
      "pm2p5": "5",
      "no2": "1",
      "so2": "3",
      "co": "0.2",
      "o3": "73"
    },
    {
      "pubTime": "2021-02-16T14:00+08:00",
      "name": "海淀区万柳",
      "id": "CNA1007",
      "aqi": "34",
      "level": "1",
      "category": "优",
      "primary": "NA",
      "pm10": "34",
      "pm2p5": "6",
      "no2": "6",
      "so2": "1",
      "co": "0.2",
      "o3": "75"
    },
    {
      "pubTime": "2021-02-16T14:00+08:00",
      "name": "官园",
      "id": "CNA1006",
      "aqi": "25",
      "level": "1",
      "category": "优",
      "primary": "NA",
      "pm10": "25",
      "pm2p5": "5",
      "no2": "4",
      "so2": "3",
      "co": "0.2",
      "o3": "78"
    },
    {
      "pubTime": "2021-02-16T14:00+08:00",
      "name": "农展馆",
      "id": "CNA1005",
      "aqi": "28",
      "level": "1",
      "category": "优",
      "primary": "NA",
      "pm10": "28",
      "pm2p5": "4",
      "no2": "2",
      "so2": "3",
      "co": "0.2",
      "o3": "85"
    },
    {
      "pubTime": "2021-02-16T14:00+08:00",
      "name": "天坛",
      "id": "CNA1004",
      "aqi": "29",
      "level": "1",
      "category": "优",
      "primary": "NA",
      "pm10": "29",
      "pm2p5": "10",
      "no2": "2",
      "so2": "1",
      "co": "0.2",
      "o3": "78"
    },
    {
      "pubTime": "2021-02-16T14:00+08:00",
      "name": "东四",
      "id": "CNA1003",
      "aqi": "30",
      "level": "1",
      "category": "优",
      "primary": "NA",
      "pm10": "30",
      "pm2p5": "7",
      "no2": "2",
      "so2": "3",
      "co": "0.1",
      "o3": "80"
    },
    {
      "pubTime": "2021-02-16T14:00+08:00",
      "name": "定陵",
      "id": "CNA1002",
      "aqi": "23",
      "level": "1",
      "category": "优",
      "primary": "NA",
      "pm10": "22",
      "pm2p5": "3",
      "no2": "2",
      "so2": "1",
      "co": "0.2",
      "o3": "73"
    },
    {
      "pubTime": "2021-02-16T14:00+08:00",
      "name": "万寿西宫",
      "id": "CNA1001",
      "aqi": "29",
      "level": "1",
      "category": "优",
      "primary": "NA",
      "pm10": "29",
      "pm2p5": "5",
      "no2": "3",
      "so2": "1",
      "co": "0.3",
      "o3": "75"
    }
  ],
  "refer": {
    "sources": [
      "cnemc"
    ],
    "license": [
      "commercial license"
    ]
  }
}
参数 描述
code

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

updateTime

当前API的最近更新时间

fxLink

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

now.pubTime

空气质量数据发布时间

now.aqi

空气质量指数

now.level

空气质量指数等级

now.category

空气质量指数级别

now.primary

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

now.pm10

PM10

now.pm2p5

PM2.5

now.no2

二氧化氮

now.so2

二氧化硫

now.co

一氧化碳

now.o3

臭氧

station.name

监测站名称,仅在国控站点的城市中返回

station.id

监测站ID

station.pubTime

空气质量数据发布时间

station.aqi

空气质量指数

station.level

空气质量指数等级

station.category

空气质量指数级别

station.primary

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

station.pm10

PM10

station.pm2p5

PM2.5

station.no2

二氧化氮

station.so2

二氧化硫

station.co

一氧化碳

station.o3

臭氧

refer.sources

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

refer.license

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

station字段仅在具有空气质量监测站的地级市返回

空气质量指数等级 #

数值 等级 级别 级别颜色
0-50 一级 绿色
51-100 二级 黄色
101-150 三级 轻度污染 橙色
151-200 四级 中度污染 红色
201-300 五级 重度污染 紫色
>300 六级 严重污染 褐红色