实时空气质量
实时空气质量API,支持中国3000+市县区以及1700+国控站点实时空气质量的查询,包括AQI数值、空气质量等级、首要污染物、PM10、PM2.5、臭氧、二氧化氮、二氧化硫、一氧化碳数值。
注意:空气质量API v1(新版)现已发布,请尝试使用并升级到新版本。
请求URL
https://api.qweather.com/v7/air/now
如果是免费订阅,将上述API Host更改为devapi.qweather.com
。参考免费订阅可用的数据。
请求参数
请求参数包括必选和可选参数,参数之间使用&
进行分隔。
-
location
(必选)需要查询地区的LocationID或以英文逗号分隔的经度,纬度坐标(十进制,最多支持小数点后两位),LocationID可通过GeoAPI获取。例如location=101010100
或location=116.41,39.92
-
lang
多语言设置,请阅读多语言文档,了解我们的多语言是如何工作、如何设置以及数据是否支持多语言。
请求示例
请将your_token
替换为你的JWT或了解身份认证
返回数据
返回数据是JSON格式并进行了Gzip压缩。
{
"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": [
"QWeather Developers License"
]
}
}
提示:
station
字段,即监测站数据仅限在空气质量监测站列表中的城市返回。
-
code
请参考状态码 -
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
数据许可或版权声明,可能为空