稳定、快速、免费的 API 接口服务
获取最近五天天气状况
接口地址: https://api.ahfi.cn/api/weather
返回格式: JSON
请求方式: GET
请求示例: https://api.ahfi.cn/api/weather?city=西安
请求参数说明:
名称 | 必填 | 类型 | 说明 |
---|---|---|---|
city | 是 | String | 查询词,市/县不能为空,例如西安或长安县 |
返回参数说明:
名称 | 类型 | 说明 |
---|---|---|
time | String | 日期 |
wind | String | 风 |
winddirection | String | 方向风 |
high | String | 高温 |
low | String | 低温 |
weather | String | 天气 |
返回示例:
{ "code": 1, "msg": "获取成功", "data": [ { "time": "27日星期天", "wind": "", "winddirection": "东北风", "high": "高温 15℃", "low": "低温 6℃", "weather": "阴" }, { "time": "28日星期一", "wind": "", "winddirection": "西北风", "high": "高温 12℃", "low": "低温 2℃", "weather": "多云" }, { "time": "1日星期二", "wind": "", "winddirection": "北风", "high": "高温 16℃", "low": "低温 2℃", "weather": "多云" }, { "time": "2日星期三", "wind": "", "winddirection": "西南风", "high": "高温 17℃", "low": "低温 3℃", "weather": "多云" }, { "time": "3日星期四", "wind": "", "winddirection": "东北风", "high": "高温 17℃", "low": "低温 5℃", "weather": "阴" } ], "tips": { "ganmao": "感冒低发期,天气舒适,请注意多吃蔬菜水果,多喝水哦。", "wendu": "12" } }
错误码格式说明:
名称 | 类型 | 说明 |
---|
代码示例: