天气查询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": "999",
        "tempn": "29",
        "weather": "阴转晴",
        "wind": "东北风转微风",
        "windSpeed": "3-4级转<3级",
        "time": "2026-08-19 08:00",
        "warning": {},
        "current": {
            "city": "广州",
            "cityEnglish": "guangzhou",
            "humidity": "82%",
            "wind": "北风",
            "windSpeed": "1级",
            "visibility": "30km",
            "weather": "晴",
            "weatherEnglish": "Sunny",
            "temp": "29.4",
            "fahrenheit": "84.9",
            "air": "25",
            "air_pm25": "25",
            "date": "08月19日(星期三)",
            "time": "20:30",
            "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": "涂擦SPF20以上,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": "需涂擦SPF大于20,PA++,护肤品。"
            },
            {
                "name": "化妆指数",
                "index": "去油防晒",
                "tips": "请选用水质无油粉底霜。"
            },
            {
                "name": "干燥指数",
                "index": "适宜",
                "tips": "温湿条件适宜,风速不大,皮肤无需特殊保养,只做日常护理即可。"
            }
        ]
    }
}

错误码格式说明:

名称类型说明

调用示例: