API介绍
接口地址:https://www.vxras.com/api/v1/weather
请求方式:GET
| 参数名 | 类型 | 必填 | 位置 | 默认值 | 示例 | 说明 |
| city | string | 否 | 自动 | Shanghai | 城市 | |
| days | string | 否 | 自动 | 天数 | ||
| lat | string | 否 | 自动 | 维度 | ||
| lon | string | 否 | 自动 | 经度 |
返回字段
| 字段名 | 类型 | 说明 |
返回示例
{
"code": 200,
"message": "success",
"data": {
"location": {
"name": "上海",
"country": "中国",
"latitude": 31.22222,
"longitude": 121.45806
},
"current": {
"temperature": 12.4,
"humidity": 91,
"weather_code": 1,
"time": "2025-11-16T01:15"
},
"daily": [
{
"date": "2025-11-16",
"temp_max": 22.1,
"temp_min": 12,
"weather_code": 3
},
{
"date": "2025-11-17",
"temp_max": 16.2,
"temp_min": 6.5,
"weather_code": 61
},
{
"date": "2025-11-18",
"temp_max": 8.5,
"temp_min": 1.9,
"weather_code": 3
},
{
"date": "2025-11-19",
"temp_max": 10.4,
"temp_min": -0.1,
"weather_code": 0
},
{
"date": "2025-11-20",
"temp_max": 13,
"temp_min": 1,
"weather_code": 2
}
]
}
}| 响应码 | 说明 |
| 响应码 | 说明 |
| 500 | 缺少必要参数/服务器错误 |
暂无评论内容