实时空气质量(new)

平台: API

实时空气质量API提供指定地点的实时空气质量数据,精度为1x1公里。

  • 基于各个国家或地区当地标准的AQI、AQI等级、颜色和首要污染物
  • 和风天气通用AQI
  • 污染物浓度值、分指数
  • 健康建议
  • 相关联的监测站信息

我们推荐阅读空气质量信息文档,以便了解指数类型、污染物、支持的国家等信息。

请求URL

https://api.qweather.com/airquality/v1/current/{latitude}/{longitude}?{查询参数}

如果是免费订阅,将上述API Host更改为devapi.qweather.com。参考免费订阅可用的数据

路径参数

  • latitude(必选)所需位置的纬度。十进制,最多支持小数点后两位。例如 39.92
  • longitude(必选)所需位置的经度。十进制,最多支持小数点后两位。例如 116.41

查询参数

  • key(必选)用户认证key,请参考如何获取你的KEY。支持数字签名方式进行认证。例如 key=123456789ABC
  • lang多语言设置,请阅读多语言文档,了解我们的多语言是如何工作、如何设置以及数据是否支持多语言。

请求示例

curl -L -X GET --compressed 'https://api.qweather.com/airquality/v1/current/39.90/116.40?key=YOUR_KEY'

返回数据

返回数据是JSON格式并进行了Gzip压缩

{
  "metadata": {
    "tag": "d75a323239766b831889e8020cba5aca9b90fca5080a1175c3487fd8acb06e84"
  },
  "indexes": [
    {
      "code": "us-epa",
      "name": "AQI (US)",
      "aqi": 46,
      "aqiDisplay": "46",
      "level": "1",
      "category": "Good",
      "color": {
        "red": 0,
        "green": 228,
        "blue": 0,
        "alpha": 1
      },
      "primaryPollutant": {
        "code": "pm2p5",
        "name": "PM 2.5",
        "fullName": "Fine particulate matter (<2.5µm)"
      },
      "health": {
        "effect": "No health effects.",
        "advice": {
          "generalPopulation": "Everyone can continue their outdoor activities normally.",
          "sensitivePopulation": "Everyone can continue their outdoor activities normally."
        }
      }
    },
    {
      "code": "qaqi",
      "name": "QAQI",
      "aqi": 0.9,
      "aqiDisplay": "0.9",
      "level": "1",
      "category": "Excellent",
      "color": {
        "red": 80,
        "green": 240,
        "blue": 230,
        "alpha": 1
      },
      "primaryPollutant": {
        "code": "pm2p5",
        "name": "PM 2.5",
        "fullName": "Fine particulate matter (<2.5µm)"
      },
      "health": {
        "effect": "No health implications.",
        "advice": {
          "generalPopulation": "Enjoy your outdoor activities.",
          "sensitivePopulation": "Enjoy your outdoor activities."
        }
      }
    }
  ],
  "pollutants": [
    {
      "code": "pm2p5",
      "name": "PM 2.5",
      "fullName": "Fine particulate matter (<2.5µm)",
      "concentration": {
        "value": 11.0,
        "unit": "μg/m3"
      },
      "subIndexes": [
        {
          "code": "us-epa",
          "aqi": 46,
          "aqiDisplay": "46"
        },
        {
          "code": "qaqi",
          "aqi": 0.9,
          "aqiDisplay": "0.9"
        }
      ]
    },
    {
      "code": "pm10",
      "name": "PM 10",
      "fullName": "Inhalable particulate matter (<10µm)",
      "concentration": {
        "value": 12.0,
        "unit": "μg/m3"
      },
      "subIndexes": [
        {
          "code": "us-epa",
          "aqi": 12,
          "aqiDisplay": "12"
        },
        {
          "code": "qaqi",
          "aqi": 0.5,
          "aqiDisplay": "0.5"
        }
      ]
    },
    {
      "code": "no2",
      "name": "NO2",
      "fullName": "Nitrogen dioxide",
      "concentration": {
        "value": 6.77,
        "unit": "ppb"
      },
      "subIndexes": [
        {
          "code": "us-epa",
          "aqi": 7,
          "aqiDisplay": "7"
        },
        {
          "code": "qaqi",
          "aqi": 0.1,
          "aqiDisplay": "0.1"
        }
      ]
    },
    {
      "code": "o3",
      "name": "O3",
      "fullName": "Ozone",
      "concentration": {
        "value": 0.02,
        "unit": "ppb"
      },
      "subIndexes": [
        {
          "code": "us-epa",
          "aqi": 21,
          "aqiDisplay": "21"
        },
        {
          "code": "qaqi",
          "aqi": 0.2,
          "aqiDisplay": "0.2"
        }
      ]
    },
    {
      "code": "co",
      "name": "CO",
      "fullName": "Carbon monoxide",
      "concentration": {
        "value": 0.25,
        "unit": "ppm"
      },
      "subIndexes": [
        {
          "code": "us-epa",
          "aqi": 3,
          "aqiDisplay": "3"
        },
        {
          "code": "qaqi",
          "aqi": 0.1,
          "aqiDisplay": "0.1"
        }
      ]
    }
  ],
  "stations": [
    {
      "id": "P51762",
      "name": "North Holywood"
    },
    {
      "id": "P58056",
      "name": "Pasadena"
    },
    {
      "id": "P57327",
      "name": "Los Angeles - N. Main Street"
    }
  ]
}
  • metadata.tag 数据标签
  • indexes.code 空气质量指数Code
  • indexes.name 空气质量指数的名字
  • indexes.aqi 空气质量指数的值
  • indexes.aqiDisplay 空气质量指数的值的文本显示
  • indexes.level 空气质量指数等级,可能为空
  • indexes.category 空气质量指数类别,可能为空
  • indexes.color.red 空气质量指数的颜色,RGBA中的red
  • indexes.color.green 空气质量指数的颜色,RGBA中的green
  • indexes.color.blue 空气质量指数的颜色,RGBA中的blue
  • indexes.color.alpha 空气质量指数的颜色,RGBA中的alpah
  • indexes.primaryPollutant.code 首要污染物的Code,可能为空
  • indexes.primaryPollutant.name 首要污染物的名字,可能为空
  • indexes.primaryPollutant.fullName 首要污染物的全称,可能为空
  • indexes.health.effect 空气质量对健康的影响,可能为空
  • indexes.health.advice.generalPopulation 对一般人群的健康指导意见,可能为空
  • indexes.health.advice.sensitivePopulation 对敏感人群的健康指导意见,可能为空
  • pollutants.code 污染物的Code
  • pollutants.name 污染物的名字
  • pollutants.fullName 污染物的全称
  • pollutants.concentration.value 污染物的浓度值
  • pollutants.concentration.unit 污染物的浓度值的单位
  • pollutants.subIndexes.code 污染物的分指数的Code,可能为空
  • pollutants.subIndexes.aqi 污染物的分指数的数值,可能为空
  • pollutants.subIndexes.aqiDisplay 污染物的分指数数值的显示名称
  • stations.id AQI相关联的监测站Location ID,可能为空
  • stations.name AQI相关联的监测站名称