获取天气信息
GET
location/weather最后修改时间: 2 年前
责任人:
请求参数
Query 参数
adcode
string
可选
城市代码(如果不提,系统自动)
type
string
可选
base=实况天气;all=预报天气
示例值:
all
cache
string
是否获取缓存数据
示例值:
true
示例代码
返回响应
请求成功(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
code
integer
状态码
msg
string
信息
data
string | integer | boolean | array | object | number | null
数据
示例
{
"code": 200,
"msg": "数据请求成功!",
"data": {
"status": "1",
"count": "1",
"info": "OK",
"infocode": "10000",
"forecasts": [
{
"city": "源城区",
"adcode": "441602",
"province": "广东",
"reporttime": "2022-09-28 13:30:19",
"casts": [
{
"date": "2022-09-28",
"week": "3",
"dayweather": "多云",
"nightweather": "多云",
"daytemp": "35",
"nighttemp": "24",
"daywind": "北",
"nightwind": "北",
"daypower": "≤3",
"nightpower": "≤3"
},
{
"date": "2022-09-29",
"week": "4",
"dayweather": "多云",
"nightweather": "多云",
"daytemp": "35",
"nighttemp": "24",
"daywind": "北",
"nightwind": "北",
"daypower": "≤3",
"nightpower": "≤3"
},
{
"date": "2022-09-30",
"week": "5",
"dayweather": "多云",
"nightweather": "多云",
"daytemp": "35",
"nighttemp": "24",
"daywind": "北",
"nightwind": "北",
"daypower": "≤3",
"nightpower": "≤3"
},
{
"date": "2022-10-01",
"week": "6",
"dayweather": "晴",
"nightweather": "多云",
"daytemp": "36",
"nighttemp": "23",
"daywind": "北",
"nightwind": "北",
"daypower": "≤3",
"nightpower": "≤3"
}
]
}
]
}
}
最后修改时间: 2 年前