Difference between revisions of "自动站数据接口"

From Caiyun Wiki
Jump to: navigation, search
(Created page with " 请求样例: http://api.caiyunapp.com/v1/surf/nearest/?token=TOKEN&lng=110.8840&lat=21.6594")
 
Line 1: Line 1:
 +
==授权与认证==
 +
请先至彩云开放平台[https://dashboard.caiyunapp.com/user/sign_up/ 注册],注册后可以获得 token 。
  
请求样例:
+
使用本接口,开发者token需要额外开通权限,请联系商务:'''api@caiyunapp.com'''
  
http://api.caiyunapp.com/v1/surf/nearest/?token=TOKEN&lng=110.8840&lat=21.6594
+
把您的 token 拼到 API 请求的 URL 中,如: [http://api.caiyunapp.com/v1/surf/nearest/?token=TOKEN&lng=110.8840&lat=21.6594 <code>http://api.caiyunapp.com/v1/surf/nearest/?token=TAkhjf8d1nlSlspN&lng=110.8840&lat=21.6594</code>]
 +
 
 +
其中 TAkhjf8d1nlSlspN 就是一个共用测试 token 。不要把私有token 告诉任何人!
 +
 
 +
== 请求样例 ==
 +
[http://api.caiyunapp.com/v1/surf/nearest/?token=TOKEN&lng=110.8840&lat=21.6594 <code>http://api.caiyunapp.com/v1/surf/nearest/?token=TAkhjf8d1nlSlspN&lng=110.8840&lat=21.6594</code>]
 +
 
 +
== 返回结构和说明 ==
 +
<syntaxhighlight lang="json" line="1" start="1">
 +
{
 +
  "status":"ok",
 +
  "result":[
 +
    {
 +
      "Station_Id_d":733855,
 +
      "location":{
 +
        "type":"Point",
 +
        "coordinates":[
 +
          117.980599999999996,
 +
          32.0886
 +
        ]
 +
      },
 +
      "PRE_1h":"0",
 +
      "TEM":"17.9",
 +
      "VIS":null
 +
    },
 +
    {
 +
      "Station_Id_d":737567,
 +
      "location":{
 +
        "type":"Point",
 +
        "coordinates":[
 +
          117.908299999999997,
 +
          30.622499999999999
 +
        ]
 +
      },
 +
      "PRE_1h":"0",
 +
      "TEM":"18.5",
 +
      "VIS":null
 +
    },
 +
  ]
 +
}
 +
</syntaxhighlight>

Revision as of 03:30, 28 October 2020

授权与认证

请先至彩云开放平台注册,注册后可以获得 token 。

使用本接口,开发者token需要额外开通权限,请联系商务:api@caiyunapp.com

把您的 token 拼到 API 请求的 URL 中,如: http://api.caiyunapp.com/v1/surf/nearest/?token=TAkhjf8d1nlSlspN&lng=110.8840&lat=21.6594

其中 TAkhjf8d1nlSlspN 就是一个共用测试 token 。不要把私有token 告诉任何人!

请求样例

http://api.caiyunapp.com/v1/surf/nearest/?token=TAkhjf8d1nlSlspN&lng=110.8840&lat=21.6594

返回结构和说明

 1 {
 2   "status":"ok",
 3   "result":[
 4     {
 5       "Station_Id_d":733855,
 6       "location":{
 7         "type":"Point",
 8         "coordinates":[
 9           117.980599999999996,
10           32.0886
11         ]
12       },
13       "PRE_1h":"0",
14       "TEM":"17.9",
15       "VIS":null
16     },
17     {
18       "Station_Id_d":737567,
19       "location":{
20         "type":"Point",
21         "coordinates":[
22           117.908299999999997,
23           30.622499999999999
24         ]
25       },
26       "PRE_1h":"0",
27       "TEM":"18.5",
28       "VIS":null
29     },
30   ]
31 }