稳定、快速、免费的 API 接口服务
天气查询API
接口地址: https://api.suyanw.cn/api/weather.php
返回格式: 请看返回示例
请求方式: GET
请求示例: https://api.suyanw.cn/api/weather.php?city=广州
请求参数说明:
| 名称 | 必填 | 说明 |
|---|---|---|
| city | 是 | 需要查询的地区名 |
| type | 否 | 返回格式,默认json可选text |
系统级错误:
| 名称 | 说明 |
|---|---|
| 400 | 请求错误! |
| 403 | 请求被服务器拒绝! |
| 405 | 客户端请求的方法被禁止! |
| 408 | 请求时间过长! |
| 500 | 服务器内部出现错误! |
| 501 | 服务器不支持请求的功能,无法完成请求! |
| 503 | 系统维护中! |
返回示例:
{
"code": 1,
"text": "获取成功",
"data": {
"city": "广州",
"cityEnglish": "guangzhou",
"temp": "26",
"tempn": "20",
"weather": "多云",
"wind": "微风",
"windSpeed": "<3级",
"time": "2026-11-17 08:00",
"warning": {},
"current": {
"city": "广州",
"cityEnglish": "guangzhou",
"humidity": "93%",
"wind": "东风",
"windSpeed": "1级",
"visibility": "16km",
"weather": "多云",
"weatherEnglish": "Cloudy",
"temp": "21.5",
"fahrenheit": "70.7",
"air": "38",
"air_pm25": "38",
"date": "11月17日(星期二)",
"time": "07:25",
"image": "http://api.suyanw.cn/api/data/weather/image/云.png"
},
"living": [
{
"name": "穿衣指数",
"index": "热",
"tips": "适合穿T恤、短薄外套等夏季服装。"
},
{
"name": "路况指数",
"index": "干燥",
"tips": "天气较好,路面较干燥,路况较好。"
},
{
"name": "钓鱼指数",
"index": "较适宜",
"tips": "天气稍热会对垂钓产生一定影响。"
},
{
"name": "晨练指数",
"index": "适宜",
"tips": "天气不错,空气清新。"
},
{
"name": "夜生活指数",
"index": "较适宜",
"tips": "只要您稍作准备就可以放心外出。"
},
{
"name": "感冒指数",
"index": "较易发",
"tips": "天凉,湿度大,较易感冒。"
},
{
"name": "逛街指数",
"index": "适宜",
"tips": "这种好天气去逛街可使身心畅快放松。"
},
{
"name": "空气污染扩散条件指数",
"index": "中",
"tips": "易感人群应适当减少室外活动。"
},
{
"name": "旅游指数",
"index": "适宜",
"tips": "天气较好,丝毫不会影响您出行的心情。"
},
{
"name": "舒适度指数",
"index": "较舒适",
"tips": "晴好的天气,午后略闷热,早晚凉爽。"
},
{
"name": "啤酒指数",
"index": "适宜",
"tips": "天气炎热,可适量饮用啤酒,不要过量。"
},
{
"name": "划船指数",
"index": "适宜",
"tips": "天气较好,适宜划船及嬉玩水上运动。"
},
{
"name": "太阳镜指数",
"index": "很必要",
"tips": "建议佩戴透射比2级且UV400的遮阳镜"
},
{
"name": "紫外线强度指数",
"index": "弱",
"tips": "辐射较弱,涂擦SPF12-15、PA+护肤品。"
},
{
"name": "风寒指数",
"index": "无",
"tips": "温度未达到风寒所需的低温,稍作防寒准备即可。"
},
{
"name": "放风筝指数",
"index": "适宜",
"tips": "好天气,放风筝可以舒展筋骨放松身心。"
},
{
"name": "空调开启指数",
"index": "较少开启",
"tips": "体感舒适,不需要开启空调。"
},
{
"name": "晾晒指数",
"index": "适宜",
"tips": "天气不错,抓紧时机让衣物晒太阳吧。"
},
{
"name": "洗车指数",
"index": "较适宜",
"tips": "无雨且风力较小,易保持清洁度。"
},
{
"name": "心情指数",
"index": "较好",
"tips": "温度适宜,心情会不错。"
},
{
"name": "中暑指数",
"index": "无中暑风险",
"tips": "天气舒适,令人神清气爽的一天,不用担心中暑的困扰。"
},
{
"name": "交通指数",
"index": "良好",
"tips": "气象条件良好,车辆可以正常行驶。"
},
{
"name": "约会指数",
"index": "较适宜",
"tips": "不用担心天气来调皮捣乱而影响了兴致。"
},
{
"name": "运动指数",
"index": "较适宜",
"tips": "请适当降低运动强度,并及时补充水分。"
},
{
"name": "过敏指数",
"index": "较易发",
"tips": "需注意远离过敏源,适当采取防护措施。"
},
{
"name": "美发指数",
"index": "一般",
"tips": "天热,头皮皮脂分泌多,注意清洁。"
},
{
"name": "雨伞指数",
"index": "不带伞",
"tips": "天气较好,不用带雨伞。"
},
{
"name": "防晒指数",
"index": "较弱",
"tips": "涂抹12-15SPF,PA+护肤品。"
},
{
"name": "化妆指数",
"index": "去油",
"tips": "请选用露质面霜打底,水质无油粉底霜。"
},
{
"name": "干燥指数",
"index": "适宜",
"tips": "温湿条件适宜,风速不大,皮肤无需特殊保养,只做日常护理即可。"
}
]
}
}
错误码格式说明:
| 名称 | 类型 | 说明 |
|---|---|---|
| 无 | 无 | 无 |
调用示例:
无