Appearance
getLivesWeatherByAdcode
获取高德实时天气
使用说明
请求头必须带token信息。
请求方式
GET
请求参数
json
{
"adcode": "59255"
}
CityCodeReq
名称 | 位置 | 类型 | 必选 | 中文名 | 说明 |
---|---|---|---|---|---|
tokenauthorization | header | string | 否 | none | |
body | body | object | 否 | none | |
» adcode | body | 高德城市编码 | 是 | none |
返回数据
Resp
名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
---|---|---|---|---|---|
» code | string | true | none | 返回编码0是成功 | none |
» msg | string | true | none | 返回消息 | none |
» data | 集合 | true | none | none | |
»» province | string | true | none | 省 | none |
»» city | string | true | none | 市 | none |
»» district | string | true | none | 区 | none |
»» adcode | string | true | none | 城市编码 | none |
»» weather | string | true | none | 天气 | none |
»» dictCode | string | true | none | 天气编码 | none |
»» temperature | string | true | none | 温度 | none |
»» winddirection | string | true | none | 风向 | none |
»» windpower | string | true | none | 风力 | none |
»» humidity | string | true | none | 湿度 | none |
»» reporttime | string | true | none | 时间 | none |
»» maxTemp | string | true | none | 最高温 | none |
»» minTemp | string | true | none | 最低温 | none |
示例
请求示例
json
{
"cityCode": "430100"
}
返回示例
json
{
"code": "0",
"msg": "操作成功",
"data": {
"province": "湖南",
"city": "长沙市",
"district": null,
"adcode": "430100",
"weather": "晴",
"dictCode": "0",
"temperature": "13",
"winddirection": "西",
"windpower": "4",
"humidity": "34",
"reporttime": "2023-12-01 15:35:23",
"maxTemp": "11",
"minTemp": "8"
}
}
高德城市编码
错误码
错误码 | 错误码取值 | 解决方案 |
---|---|---|
0-100006 | 鉴权参数为空 | 请确保传递入参。 |
0-101079 | 账号被禁用请联系管理员 | 联系管理员 |
0-101080 | 账号已失效 | 联系管理员 |
0-101081 | 当前账号暂未分配权限 | 联系管理员 |