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

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

返回格式: JSON

请求方式: GET

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

接口定制: 点此加入用户群

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

接口备注:点击前往三日天气API

请求参数说明:

名称 必填 类型 说明
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": "29",
        "tempn": "26",
        "weather": "小雨",
        "wind": "东南风转东北风",
        "windSpeed": "<3级",
        "time": "2024-07-27 08:00",
        "warning": {},
        "current": {
            "city": "北京",
            "cityEnglish": "beijing",
            "humidity": "53%",
            "wind": "东北风",
            "windSpeed": "2级",
            "pressure": "1000",
            "visibility": "20km",
            "weather": "晴",
            "weatherEnglish": "Sunny",
            "temp": "33.3",
            "fahrenheit": "91.9",
            "tempn": "26",
            "air": "43",
            "air_pm25": "43",
            "date": "07月27日(星期六)",
            "time": "15:45"
        },
        "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": "白天能见度差不需要佩戴太阳镜"
            },
            {
                "name": "紫外线强度指数",
                "index": "最弱",
                "tips": "辐射弱,涂擦SPF8-12防晒护肤品。"
            },
            {
                "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": "涂抹8-12SPF防晒护肤品。"
            },
            {
                "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);