时空 AQI, 空气质量发布平台
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
public
src
.gitignore
README.md
package-lock.json
package.json
yarn.lock

README.md

时空 AQI

空气质量发布网站

本项目用于系统性的学习 React 框架而开发。

启动

yarn
yarn start

基于 时空 AQI 开放接口

时空 AQI 服务 API 文档

说明

本服务基于 pm25.in 的数据,并在自己服务器搭建 API 服务,因服务器性能一般,所以请不要恶意攻击。

更多接口需求请联系 chinesejar@outlook.com

接口地址

http://api.timereader.cn

注意: 临时域名

城市 API

获取所有城市数据

GET /city
{
    "status": "success",
    "count": 375,
    "data": [
        {
            "name": "七台河"
        },
        ...,
        {
            "name": "三亚"
        }
    ]
}

获取对应 name 参数的城市数据

GET /city?name={city name}
{
    "status": "success",
    "count": 1,
    "data": [
        {
            "name": "北京"
        }
    ]
}

监测站 API

获取所有监测站数据

GET /station
{
    "status": "success",
    "count": 1628,
    "data": [
        {
            "station_name": "新建 ",
            "station_code": "2261A",
            "city": "七台河"
        },
        ..,
        {
            "station_name": "环保局",
            "station_code": "2260A",
            "city": "七台河"
        }
    ]
}

获取对应 name 参数的监测站数据

GET /station?name={station name}
{
    "status": "success",
    "count": 15,
    "data": [
        {
            "station_name": "环保局",
            "station_code": "2260A",
            "city": "七台河"
        },
        ...,
        {
            "station_name": "环保局",
            "station_code": "1047A",
            "city": "邯郸"
        }
    ]
}

获取对应 code 参数的监测站数据

GET /station?code={station code}
{
    "status": "success",
    "count": 1,
    "data": [
        {
            "station_name": "环保局",
            "station_code": "2260A",
            "city": "七台河"
        }
    ]
}

获取对应 city 参数的监测站数据

GET /station?city={city}
{
    "status": "success",
    "count": 23,
    "data": [
        {
            "station_name": " 淮河道",
            "station_code": "1019A",
            "city": "天津"
        },
        ...,
        {
            "station_name": "跃进路",
            "station_code": "1021A",
            "city": "天津"
        }
    ]
}

空气质量 API

获取所有城市空气质量数据

GET /aqi/city
{
    "status": "success",
    "count": 372,
    "data": [
        {
            "aqi": 18,
            "area": "林芝地区",
            "co": 0.35,
            "co_24h": 0.35,
            "no2": 6,
            "no2_24h": 7,
            "o3": 51,
            "o3_24h": 57,
            "o3_8h": 35,
            "o3_8h_24h": 36,
            "pm10": 16,
            "pm10_24h": 20,
            "pm2_5": 4,
            "pm2_5_24h": 4,
            "quality": "",
            "level": "优",
            "so2": "一级",
            "so2_24h": 3,
            "primary_pollutant": 3,
            "time_point": "2017-08-16 16:00:00"
        },
        ...,
        {
            "aqi": 29,
            "area": "日喀则地区",
            "co": 0.35,
            "co_24h": 0.45,
            "no2": 2,
            "no2_24h": 11,
            "o3": 68,
            "o3_24h": 77,
            "o3_8h": 56,
            "o3_8h_24h": 56,
            "pm10": 27,
            "pm10_24h": 31,
            "pm2_5": 6,
            "pm2_5_24h": 9,
            "quality": "",
            "level": "优",
            "so2": "一级",
            "so2_24h": 5,
            "primary_pollutant": 5,
            "time_point": "2017-08-16 16:00:00"
        }
    ]
}

获取对应 name 城市空气质量数据

GET /aqi/city?name={city}
{
    "status": "success",
    "count": 1,
    "data": [
        {
            "aqi": 292,
            "area": "北京",
            "co": 2.058,
            "co_24h": 1.7,
            "no2": 72,
            "no2_24h": 71,
            "o3": 149,
            "o3_24h": 193,
            "o3_8h": 148,
            "o3_8h_24h": 148,
            "pm10": 265,
            "pm10_24h": 222,
            "pm2_5": 241,
            "pm2_5_24h": 224,
            "quality": "颗粒物(PM2.5)",
            "level": "重度污染",
            "so2": "五级",
            "so2_24h": 10,
            "primary_pollutant": 10,
            "time_point": "2018-04-02 19:00:00"
        }
    ]
}

获取所有监测站空气质量数据

GET /aqi/station
{
    "status": "success",
    "count": 1628,
    "data": [
        {
            "aqi": 288,
            "area": "北京",
            "co": 2.1,
            "co_24h": 1.7,
            "no2": 65,
            "no2_24h": 74,
            "o3": 133,
            "o3_24h": 179,
            "o3_8h": 130,
            "o3_8h_24h": 130,
            "pm10": 257,
            "pm10_24h": 240,
            "pm2_5": 238,
            "pm2_5_24h": 209,
            "position_name": "万寿西宫",
            "primary_pollutant": "细颗粒物(PM2.5)",
            "quality": "重度污染",
            "so2": 10,
            "so2_24h": 11,
            "time_point": "2018-04-02 19:00:00"
        },
        ...,
        {
            "aqi": 277,
            "area": "北京",
            "co": 1.8,
            "co_24h": 1.5,
            "no2": 72,
            "no2_24h": 57,
            "o3": 167,
            "o3_24h": 213,
            "o3_8h": 166,
            "o3_8h_24h": 166,
            "pm10": 0,
            "pm10_24h": 162,
            "pm2_5": 227,
            "pm2_5_24h": 218,
            "position_name": "定陵",
            "primary_pollutant": "细颗粒物(PM2.5)",
            "quality": "重度污染",
            "so2": 9,
            "so2_24h": 8,
            "time_point": "2018-04-02 19:00:00"
        }
    ]
}

获取对应 city 的监测站空气质量数据

GET /aqi/station?name={city name}
{
    "status": "success",
    "count": 12,
    "data": [
        {
            "aqi": 288,
            "area": "北京",
            "co": 2.1,
            "co_24h": 1.7,
            "no2": 65,
            "no2_24h": 74,
            "o3": 133,
            "o3_24h": 179,
            "o3_8h": 130,
            "o3_8h_24h": 130,
            "pm10": 257,
            "pm10_24h": 240,
            "pm2_5": 238,
            "pm2_5_24h": 209,
            "position_name": "万寿西宫",
            "primary_pollutant": "细颗粒物(PM2.5)",
            "quality": "重度污染",
            "so2": 10,
            "so2_24h": 11,
            "time_point": "2018-04-02 19:00:00"
        },
        ...,
        {
            "aqi": 277,
            "area": "北京",
            "co": 1.8,
            "co_24h": 1.5,
            "no2": 72,
            "no2_24h": 57,
            "o3": 167,
            "o3_24h": 213,
            "o3_8h": 166,
            "o3_8h_24h": 166,
            "pm10": 0,
            "pm10_24h": 162,
            "pm2_5": 227,
            "pm2_5_24h": 218,
            "position_name": "定陵",
            "primary_pollutant": "细颗粒物(PM2.5)",
            "quality": "重度污染",
            "so2": 9,
            "so2_24h": 8,
            "time_point": "2018-04-02 19:00:00"
        }
    ]
}

排行 API

sort 表示排行类型,有以下两种情况

  • best(空气质量最好)
  • worst(空气质量最差)

默认为 best

获取城市空气质量排行

GET /rank/city?sort={sort type}&limit={limit count}
{
    "status": "success",
    "data": [
        {
            "aqi": 500,
            "area": "阿克苏地区",
            "co": 0.45,
            "co_24h": 0.75,
            "no2": 10,
            "no2_24h": 34,
            "o3": 90,
            "o3_24h": 100,
            "o3_8h": 90,
            "o3_8h_24h": 90,
            "pm10": 2967,
            "pm10_24h": 2133,
            "pm2_5": 523,
            "pm2_5_24h": 407,
            "quality": "颗粒物(PM2.5),颗粒物(PM10)",
            "level": "严重污染",
            "so2": "六级",
            "so2_24h": 4,
            "primary_pollutant": 6,
            "time_point": "2018-04-05 19:00:00"
        },
        ...,
        {
            "aqi": 500,
            "area": "海南州",
            "co": 0.5,
            "co_24h": 0.4,
            "no2": 3,
            "no2_24h": 7,
            "o3": 105,
            "o3_24h": 106,
            "o3_8h": 98,
            "o3_8h_24h": 103,
            "pm10": 1118,
            "pm10_24h": 665,
            "pm2_5": 203,
            "pm2_5_24h": 146,
            "quality": "颗粒物(PM10)",
            "level": "严重污染",
            "so2": "六级",
            "so2_24h": 8,
            "primary_pollutant": 7,
            "time_point": "2018-04-05 19:00:00"
        }
    ]
}

获取监测站空气质量排行

字段类型同上

GET /rank/station?sort={sort type}&limit={limit count}
{
    "status": "success",
    "data": [
        {
            "aqi": 288,
            "area": "北京",
            "co": 2.1,
            "co_24h": 1.7,
            "no2": 65,
            "no2_24h": 74,
            "o3": 133,
            "o3_24h": 179,
            "o3_8h": 130,
            "o3_8h_24h": 130,
            "pm10": 257,
            "pm10_24h": 240,
            "pm2_5": 238,
            "pm2_5_24h": 209,
            "position_name": "万寿西宫",
            "primary_pollutant": "细颗粒物(PM2.5)",
            "quality": "重度污染",
            "so2": 10,
            "so2_24h": 11,
            "time_point": "2018-04-02 19:00:00"
        },
        ...,
        {
            "aqi": 277,
            "area": "北京",
            "co": 1.8,
            "co_24h": 1.5,
            "no2": 72,
            "no2_24h": 57,
            "o3": 167,
            "o3_24h": 213,
            "o3_8h": 166,
            "o3_8h_24h": 166,
            "pm10": 0,
            "pm10_24h": 162,
            "pm2_5": 227,
            "pm2_5_24h": 218,
            "position_name": "定陵",
            "primary_pollutant": "细颗粒物(PM2.5)",
            "quality": "重度污染",
            "so2": 9,
            "so2_24h": 8,
            "time_point": "2018-04-02 19:00:00"
        }
    ]
}

历史数据 API

获取城市历史空气质量数据

按城市名获取过去 12 小时空气质量数据,降序。

GET /history/city?name={city name}
{
    "data": [
        {
            "primary_pollutant": "\u9897\u7c92\u7269(PM2.5)",
            "pm2_5": 72,
            "pm10": 98,
            "o3_24h": 100,
            "level": "\u4e8c\u7ea7",
            "o3_8h_24h": 47,
            "time_point": "2018-04-09 10:00:00",
            "pm10_24h": 93,
            "no2_24h": 50,
            "o3_8h": 21,
            "so2_24h": 9,
            "so2": 27,
            "quality": "\u826f",
            "area": "\u5317\u4eac",
            "no2": 58,
            "co": 1.567,
            "pm2_5_24h": 49,
            "o3": 54,
            "co_24h": 0.75,
            "aqi": 97
        },
        ...,
        {
            "primary_pollutant": "\u9897\u7c92\u7269(PM10)",
            "pm2_5": 59,
            "pm10": 116,
            "o3_24h": 100,
            "level": "\u4e8c\u7ea7",
            "o3_8h_24h": 89,
            "time_point": "2018-04-08 23:00:00",
            "pm10_24h": 85,
            "no2_24h": 47,
            "o3_8h": 77,
            "so2_24h": 6,
            "so2": 8,
            "quality": "\u826f",
            "area": "\u5317\u4eac",
            "no2": 57,
            "co": 0.717,
            "pm2_5_24h": 39,
            "o3": 45,
            "co_24h": 0.558,
            "aqi": 84
        }
    ],
    "status": "success"
}