天气预报和实况
# 天气预报和实况
# 基本信息
API Path /giot/v2/v7/weather/{weatherType}
请求协议 HTTP
请求方法 GET
Query参数:
| 参数名 | 说明 | 必填 | 类型 | 限制 | 示例 |
|---|---|---|---|---|---|
| location | 查询地区的LocationID或以英文逗号分隔的经度,纬度坐标(十进制),例如 location=101010100 或 location=116.41,39.92 | 是 | [string] |
Rest参数:
| 参数名 | 说明 | 必填 | 类型 | 值可能性 | 限制 | 示例 |
|---|---|---|---|---|---|---|
| weatherType | 天气类型: now, 3d, 7d, 15d | 是 | [string] |
返回结果
成功示例:
{
"fxLink": "http://hfx.link/1tjo1",
"code": "200",
"refer": {
"license": [
"no commercial use"
],
"sources": [
"Weather China"
]
},
"now": {
"vis": "21",
"temp": "30",
"obsTime": "2021-07-20T15:45+08:00",
"icon": "101",
"wind360": "180",
"windDir": "南风",
"pressure": "1007",
"feelsLike": "30",
"cloud": "98",
"precip": "0.0",
"dew": "23",
"humidity": "58",
"text": "多云",
"windSpeed": "20",
"windScale": "4"
},
"updateTime": "2021-07-20T15:52+08:00"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
失败示例:
{"code":"400"}
1
上次更新: 2021-12-01 16:48:01