天气查询-API接口
天气查询和那个天实时天气差不多

接口地址: https://api.xcvts.cn/api/weather/tqcx

返回格式: JSON

请求方式: GET

请求示例: https://api.xcvts.cn/api/weather/tqcx 调用测试

请求参数说明:

名称 是否必填 类型 说明 接口测试
city TEXT 要查询的天气位置,不填此参数,默认直接访问获取您当地天气 调用测试

返回参数说明:

名称 类型 说明

返回示例:

{
    "code": 200,
    "msg": "天气查询成功",
    "data": {
        "location": {
            "city": "Pi",
            "province": "Sichuan",
            "country": "China",
            "latitude": "30.800",
            "longitude": "103.883",
            "ip": "58.246.155.135"
        },
        "current_weather": {
            "temperature": "27.5°C",
            "weather_code": 3,
            "weather_text": "阴天",
            "wind_direction": 309,
            "wind_direction_text": "西北",
            "wind_speed": "6.9km/h",
            "wind_power": "2级(轻风)",
            "humidity": "68%",
            "feels_like": "29.5°C",
            "time": "2025-06-19T13:15",
            "local_time": "2025-06-19 13:15"
        },
        "forecast": [
            {
                "date": "2025-06-19",
                "max_temperature": "29.5°C",
                "min_temperature": "23°C",
                "weather_code": 61,
                "weather_text": "小雨",
                "sunrise": "2025-06-19T06:01",
                "sunset": "2025-06-19T20:09"
            },
            {
                "date": "2025-06-20",
                "max_temperature": "31.1°C",
                "min_temperature": "23.4°C",
                "weather_code": 61,
                "weather_text": "小雨",
                "sunrise": "2025-06-20T06:01",
                "sunset": "2025-06-20T20:10"
            },
            {
                "date": "2025-06-21",
                "max_temperature": "29.8°C",
                "min_temperature": "20.9°C",
                "weather_code": 61,
                "weather_text": "小雨",
                "sunrise": "2025-06-21T06:02",
                "sunset": "2025-06-21T20:10"
            }
        ]
    },
    "tips": "天气数据由小尘API提供,网址:API.XCVTS.CN",
    "time": "2025-06-19 13:29:10"
}

请求参数设置:

参数名称 参数值


{
    "code": 200,
    "msg": "天气查询成功",
    "data": {
        "location": {
            "city": "Pi",
            "province": "Sichuan",
            "country": "China",
            "latitude": "30.800",
            "longitude": "103.883",
            "ip": "58.246.155.135"
        },
        "current_weather": {
            "temperature": "27.5°C",
            "weather_code": 3,
            "weather_text": "阴天",
            "wind_direction": 309,
            "wind_direction_text": "西北",
            "wind_speed": "6.9km/h",
            "wind_power": "2级(轻风)",
            "humidity": "68%",
            "feels_like": "29.5°C",
            "time": "2025-06-19T13:15",
            "local_time": "2025-06-19 13:15"
        },
        "forecast": [
            {
                "date": "2025-06-19",
                "max_temperature": "29.5°C",
                "min_temperature": "23°C",
                "weather_code": 61,
                "weather_text": "小雨",
                "sunrise": "2025-06-19T06:01",
                "sunset": "2025-06-19T20:09"
            },
            {
                "date": "2025-06-20",
                "max_temperature": "31.1°C",
                "min_temperature": "23.4°C",
                "weather_code": 61,
                "weather_text": "小雨",
                "sunrise": "2025-06-20T06:01",
                "sunset": "2025-06-20T20:10"
            },
            {
                "date": "2025-06-21",
                "max_temperature": "29.8°C",
                "min_temperature": "20.9°C",
                "weather_code": 61,
                "weather_text": "小雨",
                "sunrise": "2025-06-21T06:02",
                "sunset": "2025-06-21T20:10"
            }
        ]
    },
    "tips": "天气数据由小尘API提供,网址:API.XCVTS.CN",
    "time": "2025-06-19 13:29:10"
}

错误码格式说明:

名称 类型 说明

代码示例: