天气查询1
获取天气

接口地址: https://api.4qb.cn/api/weather_1

返回格式: JSON/TEXT

请求方式: GET/POST

请求示例: https://api.4qb.cn/api/weather_1?city=北京&type=json

请求参数说明:

名称 必填 类型 说明
city 1 string 查询天气的地区名称,支持中文城市名(如:北京、上海市),无需加省/市后缀
type 0 string 返回数据格式,可选值:json(默认)、text(纯文本),不填则返回JSON格式

返回参数说明:

名称 类型 说明
code int 返回状态码:1成功 / -1参数错误 / -2地区不支持 / -3解析失败
text string 返回提示文本
data.city string 城市名称(如:北京)
data.cityEnglish string 城市英文名称(如:beijing)
data.temp string 白天温度
data.tempn string 夜间温度
data.weather string 天气状况(如:晴)
data.wind string 风向(如:西南风转北风)
data.windSpeed string 风速(如:<3级)
data.time string 数据更新基准时间(如:2026-02-17 08:00)
data.warning.windSpeed string 预警风速
data.warning.wind string 预警风向
data.warning.color string 预警颜色等级
data.warning.warning string 预警内容
data.warning.time string 预警时间
data.current.city string 实时天气-城市名称
data.current.cityEnglish string 实时天气-城市英文名称
data.current.humidity string 实时天气-湿度(如:7%)
data.current.wind string 实时天气-风向
data.current.windSpeed string 实时天气-风速
data.current.visibility string 实时天气-能见度(如:23km)
data.current.weather string 实时天气-天气状况
data.current.weatherEnglish string 实时天气-天气英文
data.current.temp string 实时天气-当前温度(如:12.3)
data.current.fahrenheit string 实时天气-华氏温度(如:54.1)
data.current.air string 实时天气-空气质量指数
data.current.air_pm25 string 实时天气-PM2.5数值
data.current.date string 实时天气-日期(如:02月17日(星期二))
data.current.time string 实时天气-时间(如:14:50)
data.current.image string 实时天气-图标URL
data.living.name string 生活指数-名称(如:路况指数)
data.living.index string 生活指数-等级(如:干燥)
data.living.tips string 生活指数-建议(如:天气较好,路面较干燥)

返回示例:

				    {
  "code": 1,
  "text": "获取成功",
  "data": {
    "city": "北京",
    "cityEnglish": "beijing",
    "temp": "5",
    "tempn": "0",
    "weather": "晴",
    "wind": "西南风转北风",
    "windSpeed": "\u003C3级",
    "time": "2026-02-17 08:00",
    "warning": {

    },
    "current": {
      "city": "北京",
      "cityEnglish": "beijing",
      "humidity": "7%",
      "wind": "西南风",
      "windSpeed": "2级",
      "visibility": "23km",
      "weather": "晴",
      "weatherEnglish": "Sunny",
      "temp": "12.3",
      "fahrenheit": "54.1",
      "air": "39",
      "air_pm25": "39",
      "date": "02月17日(星期二)",
      "time": "14:50",
      "image": "https://api.4qb.cn/assets/weather_image/云.png"
    },
    "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": "建议佩戴透射比为1级的遮阳镜"
      },
      {
        "name": "紫外线强度指数",
        "index": "强",
        "tips": "涂擦SPF大于15、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": "涂擦15-20SPF,PA++护肤品。"
      },
      {
        "name": "化妆指数",
        "index": "保湿防晒",
        "tips": "请选用滋润保湿型化妆品。"
      },
      {
        "name": "中暑指数",
        "index": "无中暑风险",
        "tips": "天气舒适,对易中暑人群来说非常友善。"
      },
      {
        "name": "交通指数",
        "index": "良好",
        "tips": "气象条件良好,车辆可以正常行驶。"
      },
      {
        "name": "干燥指数",
        "index": "干燥",
        "tips": "气温偏高,空气干燥,皮肤水分流失较多,应预防可能出现的皮肤瘙痒等情况,涂抹高保湿补水的护肤品,不要穿紧身衣服。"
      }
    ]
  }
}				    

请求参数设置:

参数名称 参数值


{
  "code": 1,
  "text": "获取成功",
  "data": {
    "city": "北京",
    "cityEnglish": "beijing",
    "temp": "5",
    "tempn": "0",
    "weather": "晴",
    "wind": "西南风转北风",
    "windSpeed": "\u003C3级",
    "time": "2026-02-17 08:00",
    "warning": {

    },
    "current": {
      "city": "北京",
      "cityEnglish": "beijing",
      "humidity": "7%",
      "wind": "西南风",
      "windSpeed": "2级",
      "visibility": "23km",
      "weather": "晴",
      "weatherEnglish": "Sunny",
      "temp": "12.3",
      "fahrenheit": "54.1",
      "air": "39",
      "air_pm25": "39",
      "date": "02月17日(星期二)",
      "time": "14:50",
      "image": "https://api.4qb.cn/assets/weather_image/云.png"
    },
    "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": "建议佩戴透射比为1级的遮阳镜"
      },
      {
        "name": "紫外线强度指数",
        "index": "强",
        "tips": "涂擦SPF大于15、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": "涂擦15-20SPF,PA++护肤品。"
      },
      {
        "name": "化妆指数",
        "index": "保湿防晒",
        "tips": "请选用滋润保湿型化妆品。"
      },
      {
        "name": "中暑指数",
        "index": "无中暑风险",
        "tips": "天气舒适,对易中暑人群来说非常友善。"
      },
      {
        "name": "交通指数",
        "index": "良好",
        "tips": "气象条件良好,车辆可以正常行驶。"
      },
      {
        "name": "干燥指数",
        "index": "干燥",
        "tips": "气温偏高,空气干燥,皮肤水分流失较多,应预防可能出现的皮肤瘙痒等情况,涂抹高保湿补水的护肤品,不要穿紧身衣服。"
      }
    ]
  }
}

错误码格式说明:

名称 类型 说明
code int 错误状态码:-1参数错误 / -2地区不支持 / -3解析失败
text string 错误提示文本(如:请输入地区)

代码示例: