Difference between revisions of "空气污染实况接口"
Liuzhonghua (talk | contribs) (Created page with "{{彩云天气 API 版本状态}} =='''授权与认证'''== 请先至彩云开放平台[https://dashboard.caiyunapp.com/user/sign_up/ 注册],注册后可以获得 token...") |
Liuzhonghua (talk | contribs) (Tag: Visual edit) |
||
Line 1: | Line 1: | ||
− | |||
=='''授权与认证'''== | =='''授权与认证'''== | ||
Line 5: | Line 4: | ||
请先至彩云开放平台[https://dashboard.caiyunapp.com/user/sign_up/ 注册],注册后可以获得 token 。 | 请先至彩云开放平台[https://dashboard.caiyunapp.com/user/sign_up/ 注册],注册后可以获得 token 。 | ||
− | 把您的 token 拼到 API 请求的 URL 中,如 | + | 把您的 token 拼到 API 请求的 URL 中,如: [http://api.caiyunapp.com/v1/aqi?token=TAkhjf8d1nlSlspN http://api.caiyunapp.com/v1/aqi?<code>token=TAkhjf8d1nlSlspN</code>] |
− | |||
− | |||
− | |||
− | </code> | ||
其中 TAkhjf8d1nlSlspN 就是一个共用测试 token 。不要把私有token 告诉任何人! | 其中 TAkhjf8d1nlSlspN 就是一个共用测试 token 。不要把私有token 告诉任何人! | ||
=='''请求样例'''== | =='''请求样例'''== | ||
− | + | <blockquote>[http://api.caiyunapp.com/v1/aqi?token=TAkhjf8d1nlSlspN http://api.caiyunapp.com/v1/aqi?<code>token=TAkhjf8d1nlSlspN</code>]</blockquote> | |
− | |||
− | <blockquote> | ||
− | |||
− | |||
− | |||
=='''返回结构和说明'''== | =='''返回结构和说明'''== | ||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
− | + | status "ok" | |
− | + | category "aqi_latest_obs_city" | |
− | + | result | |
− | + | 0000A02880 | |
− | + | co 1.1 | |
− | + | pm10 134 | |
− | + | quality "轻度污染" | |
− | + | area "成都市" | |
− | + | o3 null | |
− | + | station_code "2880A" | |
− | + | lon 104.0238889 | |
− | + | lat 30.65638889 | |
− | + | so2 8 | |
− | + | no2 49 | |
− | + | time_point "2019-01-14T17:00:00Z+08:00" | |
− | + | position_name "大石西路" | |
− | + | aqi 120 | |
− | + | primary_pollutant "细颗粒物(PM2.5)" | |
− | + | pm25 91 | |
− | + | 0000A02317 | |
− | + | co 1.4 | |
− | + | pm10 null | |
− | + | quality "中度污染" | |
− | + | area "宣城市" | |
− | + | o3 26 | |
− | + | station_code "2317A" | |
− | + | lon 118.7386 | |
− | + | lat 30.9742 | |
− | + | so2 14 | |
− | + | no2 64 | |
− | + | time_point "2019-01-14T17:00:00Z+08:00" | |
− | + | position_name "敬亭山子站" | |
− | + | aqi 180 | |
− | + | primary_pollutant "细颗粒物(PM2.5)" | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
[[Category:API 产品]] | [[Category:API 产品]] |
Revision as of 04:55, 15 January 2019
授权与认证
请先至彩云开放平台注册,注册后可以获得 token 。
把您的 token 拼到 API 请求的 URL 中,如: http://api.caiyunapp.com/v1/aqi?token=TAkhjf8d1nlSlspN
其中 TAkhjf8d1nlSlspN 就是一个共用测试 token 。不要把私有token 告诉任何人!
请求样例
http://api.caiyunapp.com/v1/aqi?token=TAkhjf8d1nlSlspN
返回结构和说明
status "ok"
category "aqi_latest_obs_city"
result
0000A02880
co 1.1
pm10 134
quality "轻度污染"
area "成都市"
o3 null
station_code "2880A"
lon 104.0238889
lat 30.65638889
so2 8
no2 49
time_point "2019-01-14T17:00:00Z+08:00"
position_name "大石西路"
aqi 120
primary_pollutant "细颗粒物(PM2.5)"
pm25 91
0000A02317
co 1.4
pm10 null
quality "中度污染"
area "宣城市"
o3 26
station_code "2317A"
lon 118.7386
lat 30.9742
so2 14
no2 64
time_point "2019-01-14T17:00:00Z+08:00"
position_name "敬亭山子站"
aqi 180
primary_pollutant "细颗粒物(PM2.5)"