维梦API - 提供免费接口调用平台
工具 · 天气查询
用于查询某城市的天气
拥有非常全面的天气数据,可以根据IP查询

接口地址: https://api.52vmy.cn/api/query/tian

返回格式: JSON

请求方式: GET

请求示例: https://api.52vmy.cn/api/query/tian?city=北京市

接口定制: 点此联系管理员QQ 3037370935

默认QPS: 每2秒最多5次 Token可无视QPS

接口备注:点此查看三日天气

请求参数说明:

名称 必填 类型 说明
city string 城市
ip string IP地址
type string 返回格式默认JSON可选text

返回参数说明:

名称 类型 说明
weather string 天气
degree string 温度
max_degree string 最高温度
min_degree string 最低温度
windn string 风向
windr string 风力
humidity string 湿度
precipitation string 降水概率
pressure string 气压
sunup string 日出时间
sunset string 日落时间
tips string 提示语

返回示例:

{
    "code": 200,
    "msg": "成功",
    "data": {
        "city": "北京",
        "cityEnglish": "beijing",
        "temp": "27",
        "tempn": "21",
        "weather": "晴",
        "wind": "东南风",
        "windSpeed": "<3级",
        "time": "2024-05-17 08:00",
        "warning": {},
        "current": {
            "city": "北京",
            "cityEnglish": "beijing",
            "humidity": "35%",
            "wind": "东南风",
            "windSpeed": "2级",
            "pressure": "999",
            "visibility": "17km",
            "weather": "晴",
            "weatherEnglish": "Sunny",
            "temp": "31.2",
            "fahrenheit": "88.2",
            "tempn": "21",
            "air": "101",
            "air_pm25": "101",
            "date": "05月17日(星期五)",
            "time": "14:00"
        },
        "living": [
            {
                "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": "需注意远离过敏源,适当采取防护措施。"
            },
            {
                "name": "美发指数",
                "index": "一般",
                "tips": "注意清洁,建议选用防晒滋润型护发品。"
            },
            {
                "name": "雨伞指数",
                "index": "不带伞",
                "tips": "天气较好,不用带雨伞。"
            },
            {
                "name": "防晒指数",
                "index": "极强",
                "tips": "需涂擦SPF大于20,PA++,护肤品。"
            },
            {
                "name": "化妆指数",
                "index": "防脱水防晒",
                "tips": "请选用防脱水防晒指数高的化妆品。"
            },
            {
                "name": "中暑指数",
                "index": "无中暑风险",
                "tips": "天气舒适,令人神清气爽的一天,不用担心中暑的困扰。"
            },
            {
                "name": "交通指数",
                "index": "良好",
                "tips": "气象条件良好,车辆可以正常行驶。"
            },
            {
                "name": "干燥指数",
                "index": "非常干燥",
                "tips": "空气干燥,极易引起皮肤水分流失,建议涂抹防晒霜,多喝水保持身体滋润。"
            }
        ]
    }
}

请求参数设置:

参数名称 参数值



				

错误码格式说明:

名称 类型 说明

PHP代码示例:

$city = $_GET["city"];
$ip = $_GET["ip"];
$type = $_GET["type"];
$url = "https://api.52vmy.cn/api/query/tian?city=".$city."&ip=".$ip."&type=".$type;
echo file_get_contents($url);