麒麟资源导航网自用API数据接口调用服务平台、平台稳定、快速、 API 接口服务
支持六百多个城市查询,多种查询方式和多天预报。
接口地址: https://api.qlwc.cn/api/weather
返回格式: JSON
请求方式: GET
请求示例: https://api.qlwc.cn/api/weather?city=北京 调用测试
请求参数说明:
参数名称 | 是否必填 | 参数类型 | 接口说明 | 接口测试 |
---|---|---|---|---|
city | 否 | 北京&days=7 | 查询7天例如:?city=北京&days=7 | 调用测试 |
city | 否 | 北京&days=15 | 查询15天例如:?city=北京&days=15 | 调用测试 |
city | 否 | 北京 | 查询今天例如:?city=北京 | 调用测试 |
ip | 否 | 180.149.130.16 | 通过IP查询例如:?ip=180.149.130.16 | 调用测试 |
返回参数说明:
参数名称 | 参数类型 | 接口说明 |
---|
返回示例:
{ "msg": "查询成功", "city": "北京", "api_city": "北京市", "source": "天气API", "city_id": "101010100", "update_time": "2025-04-21 12:10:46", "current": { "temperature": "16.2℃", "condition": "小雨", "wind": "东北风 2级", "humidity": "62%", "air_quality": "良", "update_time": "2025-04-21 11:39:21" }, "forecast": [ { "date": "2025-04-21", "day_of_week": "星期一", "condition": "小雨", "high": "高温 18℃", "low": "低温 11℃", "wind_direction": "东北风", "wind_strength": "2级", "sunrise": "05:27", "sunset": "18:58", "notice": "雨虽小,注意保暖别感冒" } ] }
参数名称 | 参数值 | 操作 |
---|---|---|
{ "msg": "查询成功", "city": "北京", "api_city": "北京市", "source": "天气API", "city_id": "101010100", "update_time": "2025-04-21 12:10:46", "current": { "temperature": "16.2℃", "condition": "小雨", "wind": "东北风 2级", "humidity": "62%", "air_quality": "良", "update_time": "2025-04-21 11:39:21" }, "forecast": [ { "date": "2025-04-21", "day_of_week": "星期一", "condition": "小雨", "high": "高温 18℃", "low": "低温 11℃", "wind_direction": "东北风", "wind_strength": "2级", "sunrise": "05:27", "sunset": "18:58", "notice": "雨虽小,注意保暖别感冒" } ] }
错误码格式说明:
名称 | 类型 | 说明 |
---|
代码示例:
### 示例1:查询指定城市天气
http://api.qlwc.cn/weather/index.php?city=北京
### 示例2:查询指定IP地址所在城市的天气
http://api.qlwc.cn/weather/index.php?ip=114.114.114.114
### 示例3:获取未来7天天气预报
http://api.qlwc.cn/weather/index.php?city=上海&days=7
### 示例4:自动获取当前IP所在城市的天气
http://api.qlwc.cn/weather/index.php