返回多日的天气情况,数据来源于国家天气,数据实时更新
接口地址: https://api.xcvts.cn/api/weather/txtq
返回格式: JSON
请求方式: GET
请求示例: https://api.xcvts.cn/api/weather/txtq?province=广东省&city=深圳市&county=宝安区 调用测试
请求参数说明:
| 名称 | 是否必填 | 类型 | 说明 | 接口测试 |
|---|---|---|---|---|
| province | 是 | 省份 | 省份名称 | 调用测试 |
| city | 是 | 城市 | 城市名称 | 调用测试 |
| county | 是 | 区/县 | 无 | 调用测试 |
返回参数说明:
| 名称 | 类型 | 说明 |
|---|
返回示例:
{
"data": {
"air": {
"aqi": 31,
"aqi_level": 1,
"aqi_name": "优",
"co": "?",
"no2": "?",
"o3": "?",
"pm10": "?",
"pm2.5": "?",
"so2": "?",
"update_time": "20240731200000"
},
"alarm": {
},
"forecast_1h": {
"0": {
"degree": "27",
"update_time": "20240731210000",
"weather": "阵雨",
"weather_code": "03",
"weather_short": "阵雨",
"weather_url": "",
"wind_direction": "南风",
"wind_power": "1-3"
},
"1": {
"degree": "27",
"update_time": "20240731220000",
"weather": "阵雨",
"weather_code": "03",
"weather_short": "阵雨",
"weather_url": "",
"wind_direction": "南风",
"wind_power": "1-3"
},
请求参数设置:
| 参数名称 | 参数值 |
|---|---|
{
"data": {
"air": {
"aqi": 31,
"aqi_level": 1,
"aqi_name": "优",
"co": "?",
"no2": "?",
"o3": "?",
"pm10": "?",
"pm2.5": "?",
"so2": "?",
"update_time": "20240731200000"
},
"alarm": {
},
"forecast_1h": {
"0": {
"degree": "27",
"update_time": "20240731210000",
"weather": "阵雨",
"weather_code": "03",
"weather_short": "阵雨",
"weather_url": "",
"wind_direction": "南风",
"wind_power": "1-3"
},
"1": {
"degree": "27",
"update_time": "20240731220000",
"weather": "阵雨",
"weather_code": "03",
"weather_short": "阵雨",
"weather_url": "",
"wind_direction": "南风",
"wind_power": "1-3"
},
错误码格式说明:
| 名称 | 类型 | 说明 |
|---|
代码示例: