已复制到剪贴板
首页 全部接口 API文档 文章 贡献者 友链 关于
GET 免费

获取天气

基于城市ID获取实时天气信息,包含当前温度、湿度、空气质量、PM2.5/PM10、感冒指数以及昨天和未来4天的天气预报数据。接口免费使用,每8小时CDN缓存更新一次。

接口信息

GET https://api.xunjinlu.fun/api/weather/index.php
备用 https://api.whrx.chat/api/weather/index.php
请求方法
GET
所属分类
实用工具
频率限制
100/h
热度指数
6
提交时间
2026-03-08 14:46:49
API来源
尋鯨錄
接口检测
检测接口是否正常响应
接口反馈

如果接口调用出现问题,请在此反馈

免责声明

本工具提供的数据和结果仅供参考,不保证其准确性、完整性和实时性。 使用本工具产生的任何后果由用户自行承担,与本站无关。 如涉及第三方数据,请以官方来源为准。

请求参数
[
    {
        "name": "cityId",
        "type": "string",
        "required": true,
        "description": "城市ID编码,如101030100(天津),需从city.json获取对应城市code"
    },
    {
        "name": "format",
        "type": "string",
        "required": false,
        "description": "返回格式,默认json,可选xml"
    }
]
响应示例
{
    "code": 200,
    "message": "success",
    "data": {
        "update_time": "2026-03-08 14:30:00",
        "city_info": {
            "city": "天津市",
            "city_id": "101030100",
            "parent": "天津",
            "weather_update_time": "14:25"
        },
        "current": {
            "date": "20260308",
            "temperature": "24",
            "humidity": "22%",
            "pm25": 15,
            "pm10": 46,
            "quality": "优",
            "cold_index": "各类人群可自由活动"
        },
        "yesterday": {
            "date": "07",
            "ymd": "2026-03-07",
            "week": "星期六",
            "sunrise": "06:30",
            "high": "高温 25.0℃",
            "low": "低温 15.0℃",
            "sunset": "18:15",
            "aqi": 108,
            "fx": "西北风",
            "fl": "4-5级",
            "type": "晴",
            "notice": "愿你拥有比阳光明媚的心情"
        },
        "forecast": [
            {
                "date": "08",
                "ymd": "2026-03-08",
                "week": "星期日",
                "sunrise": "06:28",
                "high": "高温 26.0℃",
                "low": "低温 16.0℃",
                "sunset": "18:16",
                "aqi": 55,
                "fx": "东南风",
                "fl": "3-4级",
                "type": "多云",
                "notice": "愿你拥有比阳光明媚的心情"
            }
        ]
    },
    "time": "2026-03-08 14:30:25"
}
详细文档
# 天气API接口文档 ## 接口概述 基于公开天气API封装的PHP代理接口,提供标准JSON格式天气数据,支持当前天气、空气质量、未来5天预报查询。 ## 接口地址 ``` GET https://api.xunjinlu.fun/api/weather/index.php?cityId={cityId} ``` ## 请求参数 | 参数名 | 类型 | 必填 | 说明 | |--------|------|------|------| | cityId | string | 是 | 9位城市ID,如101030100(天津) | | form...

暂无AI生成的文档

请联系管理员生成

在线测试
https://api.xunjinlu.fun/api/weather/index.php
等待中
// 结果将在此处显示...
推荐接口
GET 实用工具

网易云歌词

网易云音乐歌词获取API,根据音乐ID获取对应歌曲的LRC格式歌词和YRC格式(逐字歌词)数据。基于落月API(vkeys.cn)构建,支持获取网易云音乐平台的歌词信息。