请求参数
参数名称 | 位置 | 类型 | 是否必须 | 示例 | 描述 |
---|
apptoken | head | string | 是 | 您自己的应用token | 请求验证令牌 |
type | body | string | 是 | “district” | 类型:地区 |
value | body | string | 是 | "500100" | 需要查询的地区区号 |
返回示例
//成功返回参数
{
"code": 200,
"data": {
"weather": {
"location": {//当前地区信息
"country": "中国",//当前国家
"province": "重庆市",//当前省份
"city": "重庆市",//当前城市
"name": "重庆",//城市简称
"id": "500100"//区号
},
"now": {
"text": "中雨",//今日天气
"temp": 8,//今日温度(摄氏度)
"feels_like": 8,
"rh": 88,
"wind_class": "3级",//风等级
"wind_dir": "西风",//风向
"uptime": "20221227140000"//更新时间
},
"forecasts": [
{
"text_day": "小雨",
"text_night": "小雨",
"high": 8,
"low": 7,
"wc_day": "<3级",
"wd_day": "西北风",
"wc_night": "<3级",
"wd_night": "西北风",
"date": "2022-12-27",
"week": "星期二"
},
{
"text_day": "小雨",
"text_night": "阴",
"high": 9,
"low": 7,
"wc_day": "<3级",
"wd_day": "西南风",
"wc_night": "<3级",
"wd_night": "北风",
"date": "2022-12-28",
"week": "星期三"
},
{
"text_day": "阴",
"text_night": "多云",
"high": 11,
"low": 5,
"wc_day": "<3级",
"wd_day": "北风",
"wc_night": "<3级",
"wd_night": "东风",
"date": "2022-12-29",
"week": "星期四"
},
{
"text_day": "多云",
"text_night": "阴",
"high": 12,
"low": 10,
"wc_day": "<3级",
"wd_day": "东风",
"wc_night": "<3级",
"wd_night": "东北风",
"date": "2022-12-30",
"week": "星期五"
},
{
"text_day": "小雨",
"text_night": "小雨",
"high": 13,
"low": 9,
"wc_day": "<3级",
"wd_day": "北风",
"wc_night": "<3级",
"wd_night": "西风",
"date": "2022-12-31",
"week": "星期六"
}
]
}
},
"message": "获取成功"
}
//失败返回参数
{
"code":201,
"data":[],
"message":"账户余额不足"//失败提示信息
}
返回参数
参数名称 | 类型 | 是否必须 | 示例 | 描述 |
---|
country | string | 是 | 中国 | 国家名称 |
province | string | 是 | 重庆 | 省市地区 |
city | string | 是 | 重庆 | 城市 |
name | string | 是 | 重庆 | 区域简称 |
id | int | 是 | 500100 | 区号 |
text | string | 是 | 小雨 | 当前天气状况 |
temp | string | 是 | 添加 | 当前温度 |
feels_like | string | 是 | 8 | 体感温度 |
rh | string | 是 | 6 | 相对湿度 |
wind_class | string | 是 | 2级 | 当前风力 |
wind_dir | string | 是 | 东北风 | 当前风向 |
uptime | string | 是 | 20221228120000 | 更新时间 |
text_day | string | 是 | 阴 | 白天天气 |
text_night | string | 是 | 阴 | 夜晚天气 |
high | string | 是 | 14 | 最高温度 |
low | string | 是 | 6 | 最低温度 |
wc_day | string | 是 | <3级 | 白天风力 |
wd_day | string | 是 | 东北风 | 白天风向 |
wc_night | string | 是 | <3级 | 夜晚风力 |
wd_night | string | 是 | 东北风 | 夜晚风向 |
date | string | 是 | 2022-12-30 | 查询日期 |
week | string | 是 | 星期五 | 星期几 |