Skip to content

空气污染

覆盖范围见 覆盖范围 文档,逐小时更新

站点实况

bash
curl "https://api.caiyunapp.com/v1/aqi/latest?token=TOKEN"
json
{
  "status": "ok",
  "category": "aqi_latest_obs_city",
  "result": {
    "0000A03460": {
      "lon": 117.4067,
      "lat": 40.0583,
      "area": "天津市",
      "position_name": "北环路",
      "province_name": "天津市",
      "station_code": "0000A03460",
      "time_point": "2021-12-29T14:00:00Z+08:00",
      "aqi": 21,
      "pm25": 3,
      "pm10": 15,
      "co": 0.5,
      "so2": 6,
      "o3": 66,
      "no2": 5,
      "quality": "优",
      "primary_pollutant": null
    }
    // ...
  }
}

城市实况排名

bash
curl "http://api.caiyunapp.com/v1/aqi/ranking?number=10&type=desc&field=pm25&token=TOKEN"
  • number: 返回多少个城市的数据,默认 100,最大 200
  • field: 根据哪个变量排名,默认 pm25,可选 pm25, pm10, o3, co, no2, so2, aqi
  • type: 排序方向,默认 asc, 可选 asc, desc
json
{
  "status": "ok",
  "category": "aqi_latest_obs_city_ranking",
  "result": [
    {
      "lon": 129.5029,
      "lat": 48.471,
      "area": "伊春市",
      "position_name": "汤旺河国家公园(对照点)",
      "province_name": "黑龙江省",
      "station_code": "0000A02254",
      "time_point": "2021-12-29T14:00:00Z+08:00",
      "aqi": 4,
      "pm25": 0,
      "pm10": 2,
      "co": 0.4,
      "so2": 6,
      "o3": 70,
      "no2": 1,
      "quality": "优",
      "primary_pollutant": null
    }
  ]
}

区域实况图

支持过去 48 小时拼图,支持亚洲和北美两个区域的拼图

bash
curl "https://api.caiyunapp.com/v1/aqi/images?token=TOKEN"
json
{
  "status": "ok",
  "category": "aqi_latest_obs_image",
  "images": [
    [
      "http://cdn-s.caiyunapp.com/weather/pm25_rt_as_20211227_08.png?auth_key=xxxxx",
      1640592000,
      [-10, 60, 56, 146]
    ],
    // ...
    [
      "http://cdn-s.caiyunapp.com/weather/pm25_rt_as_20211229_07.png?auth_key=xxxxx",
      1640761200,
      [-10, 60, 56, 146]
    ]
  ]
}

坐标顺序为

  • 图片最南处纬度 lat0
  • 图片最西处经度 lon0
  • 图片最北处纬度 lat1
  • 图片最东处经度 lon1