实时天气
接口地址 https://apis.kit9.cn/api/weather/api.php
请求方式 GET/POST
返回格式 JSON
HTTP/HTTPS 支持
请求示例 https://apis.kit9.cn/api/weather/api.php?city=上海
参数说明
| 参数 | 必填 | 类型 | 说明 |
|---|---|---|---|
| city | 是 | String | 市/县 |
返回参数
| 名称 | 类型 | 说明 | ||
|---|---|---|---|---|
| code | number | 状态码 200为正常,其它为异常 | ||
| msg | string | 状态说明 | ||
| data | array | 数组 | ||
| date | string | 今天日期 | ||
| weather | string | 当日天气 | ||
| temperature | string | 当日气温 | ||
| temp | string | 当前温度 | ||
| wind_direction | string | 当日风向 | ||
| wind_scale | string | 当日风级 | ||
| humidity | string | 湿度 | ||
| air | string | 空气质量 | ||
| air_level | string | 空气质量等级 | ||
| air_level_name | string | 空气质量名称 | ||
| expectedStatus | string | 降雨预警 | ||
返回示例
{
"code": 200,
"msg": "success",
"data": {
"date": "2024-02-07",
"weather": "晴",
"temperature": "1/5°",
"temp": "5°",
"wind_direction": "北风",
"wind_scale": "0",
"humidity": "63",
"air": "70",
"air_level": "2",
"air_level_name": "良",
"expectedStatus": "未来两小时无降水"
}
}