天气预报-天气查询-全国天气预报-实时天气查询-天气预报查询-24小时天气查询

简介: 这是一款功能全面的天气API服务,支持按地名、IP、经纬度、景点等多种方式查询实时天气、24小时预报、7/15/40天趋势及历史天气数据,涵盖温度、降水、风力、湿度、AQI、灾害预警等30+指标,广泛适用于出行、生活、健康类APP。

前言

天气查询通过调用气象接口服务,获取指定地区的实时天气、未来预报、温度、降水、风力、湿度、空气质量、灾害预警等气象数据。可通过地名、地名对应ID、坐标区域、IP地址、景点名称ID、电话区号或邮编来查询天气情况。可查询到当前天气、未来24小时天气、未来7天、15天、40天内的天气情况的数据。

天气查询应用场景如下:

1.出行类APP/小程序
打车、导航、公交、旅游软件,根据用户定位展示实时天气,提示雨雪、大风等天气,辅助规划出行路线。
2.生活服务APP
天气软件、日历、健康类应用,推送天气预警,提醒用户增减衣物、防范高温、寒潮。

API介绍

天气查询包括十个API,分别为:天气查询-按地名、天气查询-按IP、天气查询-按经纬度、天气查询-按景点、天气查询-查询地名id、天气查询-查询景点id、天气查询-24小时、天气查询-未来7天内指定日期、天气查询-未来15天、天气查询-历史天气

绿色玻璃科技风格天气查询应用图.png

天气查询.png

天气查询-按地名

根据地名查询当前和未来7天的天气。

请求说明

名称 类型 必须 说明
area String 否 地名 地名不能带有“市”、“县”,比如查杭州,area传入“杭州”,而不是传入“杭州市”
areaId String 否 地名Id

返回样例

{
   
  "code": 200, // 详见code返回码说明
  "msg": "成功", // code 对应的描述
  "taskNo": "51168811490923554212", // 本次请求号
  "data": {
   
    "area": "北京", // 地名 详见 地名说明
    "areaId": "101010100", // 地名id 详见 地名说明
    "province": "北京", // 省份
    "city": "北京", // 城市
    "now": {
    // 当前实时天气
      "sd": "61%", // 湿度
      "aqi": "87", // 空气质量
      "weather": "晴", // 天气
      "weather_pic": "xxxx/weather-icon/d00.png", // 天气图标
      "temperature": "10", // 温度
      "wind_direction": "东北风", // 风向
      "wind_power": "1级" // 风级
    },
    "dayWeathers": [ // 未来7天天气,按日期从早到晚排序
      {
   
        "daytime": "20211116", // 日期
        "day_weather": "晴",  // 白天天气
        "day_weather_code": "00", // 白天天气编号,详见天气编号
        "day_weather_pic": "xxxx/weather-icon/d00.png", // 白天天气图标
        "day_high_temperature": "12", // 白天最高温度
        "day_wind_direction": "西南风",  // 白天风向
        "day_wind_power": "<3级", // 白天风级
        "night_weather": "多云", // 夜间天气
        "night_weather_code": "01", // 夜间天气编号
        "night_weather_pic": "xxxx/weather-icon/n01.png", // 夜间天气图标
        "night_low_temperature": "1", // 夜间最低温度
        "night_wind_direction": "西南风",  // 夜间风向
        "night_wind_power": "<3级"    // 夜间风级
      },
      {
   
        "daytime": "20211117",
        "day_weather_code": "00",
        "day_high_temperature": "13",
        "day_weather": "晴",
        "day_wind_power": "<3级",
        "day_weather_pic": "xxxx/weather-icon/d00.png",
        "day_wind_direction": "西南风",
        "night_wind_power": "<3级",
        "night_low_temperature": "0",
        "night_wind_direction": "西南风",
        "night_weather_pic": "xxxx/weather-icon/n00.png",
        "night_weather_code": "00",
        "night_weather": "晴"
      },
      {
   
        "daytime": "20211118",
        "day_weather_code": "00",
        "day_high_temperature": "12",
        "day_weather": "晴",
        "day_wind_power": "<3级",
        "day_weather_pic": "xxxx/weather-icon/d00.png",
        "day_wind_direction": "南风",
        "night_low_temperature": "2",
        "night_wind_direction": "北风",
        "night_weather_pic": "xxxx/weather-icon/n00.png",
        "night_weather_code": "00",
        "night_weather": "晴",
        "night_wind_power": "<3级"
      },
      {
   
        "daytime": "20211119",
        "day_weather_code": "01",
        "day_high_temperature": "10",
        "day_weather": "多云",
        "day_wind_power": "<3级",
        "day_weather_pic": "xxxx/weather-icon/d01.png",
        "day_wind_direction": "北风",
        "night_low_temperature": "3",
        "night_wind_direction": "北风",
        "night_weather_pic": "xxxx/weather-icon/n01.png",
        "night_weather_code": "01",
        "night_weather": "多云",
        "night_wind_power": "<3级"
      },
      {
   
        "daytime": "20211120",
        "day_weather_code": "01",
        "day_high_temperature": "10",
        "day_weather": "多云",
        "day_wind_power": "<3级",
        "day_weather_pic": "xxxx/weather-icon/d01.png",
        "day_wind_direction": "北风",
        "night_low_temperature": "1",
        "night_wind_direction": "西北风",
        "night_weather_pic": "xxxx/weather-icon/n00.png",
        "night_weather_code": "00",
        "night_weather": "晴",
        "night_wind_power": "3-4级"
      },
      {
   
        "daytime": "20211121",
        "day_weather_code": "00",
        "day_high_temperature": "8",
        "day_weather": "晴",
        "day_wind_power": "4-5级",
        "day_weather_pic": "xxxx/weather-icon/d00.png",
        "day_wind_direction": "西北风",
        "night_low_temperature": "-2",
        "night_wind_direction": "西北风",
        "night_weather_pic": "xxxx/weather-icon/n00.png",
        "night_weather_code": "00",
        "night_weather": "晴",
        "night_wind_power": "4-5级"
      },
      {
   
        "daytime": "20211122",
        "day_weather_code": "00",
        "day_high_temperature": "4",
        "day_weather": "晴",
        "day_wind_power": "3-4级",
        "day_weather_pic": "xxxx/weather-icon/d00.png",
        "day_wind_direction": "西北风",
        "night_low_temperature": "-4",
        "night_wind_direction": "西北风",
        "night_weather_pic": "xxxx/weather-icon/n00.png",
        "night_weather_code": "00",
        "night_weather": "晴",
        "night_wind_power": "3-4级"
      }
    ]
  }
}

天气查询-按IP

根据IP地址查询当前和未来7天的天气。

请求说明

名称 类型 必须 说明
ip String 是 IP地址

返回样例

{
   
  "code": 200, // 详见code返回码说明
  "msg": "成功", // code 对应的描述
  "taskNo": "51168811490923554212", // 本次请求号
  "data": {
   
    "area": "北京", // ip所在地区
    "areaId": "101010100", // 地名id 详见 地名说明
    "province": "北京", // 省份
    "city": "北京", // 城市
    "now": {
    // 当前实时天气
      "sd": "61%", // 湿度
      "aqi": "87", // 空气质量
      "weather": "晴", // 天气
      "weather_pic": "xxxx/weather-icon/d00.png", // 天气图标
      "temperature": "10", // 温度
      "wind_direction": "东北风", // 风向
      "wind_power": "1级" // 风级
    },
    "dayWeathers": [ // 未来7天天气,按日期从早到晚排序
      {
   
        "daytime": "20211116", // 日期
        "day_weather": "晴",  // 白天天气
        "day_weather_code": "00", // 白天天气编号,详见天气编号
        "day_weather_pic": "xxxx/weather-icon/d00.png", // 白天天气图标
        "day_high_temperature": "12", // 白天最高温度
        "day_wind_direction": "西南风",  // 白天风向
        "day_wind_power": "<3级", // 白天风级
        "night_weather": "多云", // 夜间天气
        "night_weather_code": "01", // 夜间天气编号
        "night_weather_pic": "xxxx/weather-icon/n01.png", // 夜间天气图标
        "night_low_temperature": "1", // 夜间最低温度
        "night_wind_direction": "西南风",  // 夜间风向
        "night_wind_power": "<3级"    // 夜间风级
      },
      {
   
        "daytime": "20211117",
        "day_weather_code": "00",
        "day_high_temperature": "13",
        "day_weather": "晴",
        "day_wind_power": "<3级",
        "day_weather_pic": "xxxx/weather-icon/d00.png",
        "day_wind_direction": "西南风",
        "night_wind_power": "<3级",
        "night_low_temperature": "0",
        "night_wind_direction": "西南风",
        "night_weather_pic": "xxxx/weather-icon/n00.png",
        "night_weather_code": "00",
        "night_weather": "晴"
      },
      {
   
        "daytime": "20211118",
        "day_weather_code": "00",
        "day_high_temperature": "12",
        "day_weather": "晴",
        "day_wind_power": "<3级",
        "day_weather_pic": "xxxx/weather-icon/d00.png",
        "day_wind_direction": "南风",
        "night_low_temperature": "2",
        "night_wind_direction": "北风",
        "night_weather_pic": "xxxx/weather-icon/n00.png",
        "night_weather_code": "00",
        "night_weather": "晴",
        "night_wind_power": "<3级"
      },
      {
   
        "daytime": "20211119",
        "day_weather_code": "01",
        "day_high_temperature": "10",
        "day_weather": "多云",
        "day_wind_power": "<3级",
        "day_weather_pic": "xxxx/weather-icon/d01.png",
        "day_wind_direction": "北风",
        "night_low_temperature": "3",
        "night_wind_direction": "北风",
        "night_weather_pic": "xxxx/weather-icon/n01.png",
        "night_weather_code": "01",
        "night_weather": "多云",
        "night_wind_power": "<3级"
      },
      {
   
        "daytime": "20211120",
        "day_weather_code": "01",
        "day_high_temperature": "10",
        "day_weather": "多云",
        "day_wind_power": "<3级",
        "day_weather_pic": "xxxx/weather-icon/d01.png",
        "day_wind_direction": "北风",
        "night_low_temperature": "1",
        "night_wind_direction": "西北风",
        "night_weather_pic": "xxxx/weather-icon/n00.png",
        "night_weather_code": "00",
        "night_weather": "晴",
        "night_wind_power": "3-4级"
      },
      {
   
        "daytime": "20211121",
        "day_weather_code": "00",
        "day_high_temperature": "8",
        "day_weather": "晴",
        "day_wind_power": "4-5级",
        "day_weather_pic": "xxxx/weather-icon/d00.png",
        "day_wind_direction": "西北风",
        "night_low_temperature": "-2",
        "night_wind_direction": "西北风",
        "night_weather_pic": "xxxx/weather-icon/n00.png",
        "night_weather_code": "00",
        "night_weather": "晴",
        "night_wind_power": "4-5级"
      },
      {
   
        "daytime": "20211122",
        "day_weather_code": "00",
        "day_high_temperature": "4",
        "day_weather": "晴",
        "day_wind_power": "3-4级",
        "day_weather_pic": "xxxx/weather-icon/d00.png",
        "day_wind_direction": "西北风",
        "night_low_temperature": "-4",
        "night_wind_direction": "西北风",
        "night_weather_pic": "xxxx/weather-icon/n00.png",
        "night_weather_code": "00",
        "night_weather": "晴",
        "night_wind_power": "3-4级"
      }
    ]
  }
}

天气查询-按经纬度

根据经纬度查询当前和未来7天的天气。

请求说明

名称 类型 必须 说明
longitude String 是 经度,取值范围【0°-180°】
latitude String 是 纬度,取值范围【0°-90°】

返回样例

{
   
  "code": 200, // 详见code返回码说明
  "msg": "成功", // code 对应的描述
  "taskNo": "51168811490923554212", // 本次请求号
  "data": {
   
    "area": "北京", // 地区
    "areaId": "101010100", // 地名id 详见 地名说明
    "province": "北京", // 省份
    "city": "北京", // 城市
    "now": {
    // 当前实时天气
      "sd": "61%", // 湿度
      "aqi": "87", // 空气质量
      "weather": "晴", // 天气
      "weather_pic": "xxxx/weather-icon/d00.png", // 天气图标
      "temperature": "10", // 温度
      "wind_direction": "东北风", // 风向
      "wind_power": "1级" // 风级
    },
    "dayWeathers": [ // 未来7天天气,按日期从早到晚排序
      {
   
        "daytime": "20211116", // 日期
        "day_weather": "晴",  // 白天天气
        "day_weather_code": "00", // 白天天气编号,详见天气编号
        "day_weather_pic": "xxxx/weather-icon/d00.png", // 白天天气图标
        "day_high_temperature": "12", // 白天最高温度
        "day_wind_direction": "西南风",  // 白天风向
        "day_wind_power": "<3级", // 白天风级
        "night_weather": "多云", // 夜间天气
        "night_weather_code": "01", // 夜间天气编号
        "night_weather_pic": "xxxx/weather-icon/n01.png", // 夜间天气图标
        "night_low_temperature": "1", // 夜间最低温度
        "night_wind_direction": "西南风",  // 夜间风向
        "night_wind_power": "<3级"    // 夜间风级
      },
      {
   
        "daytime": "20211117",
        "day_weather_code": "00",
        "day_high_temperature": "13",
        "day_weather": "晴",
        "day_wind_power": "<3级",
        "day_weather_pic": "xxxx/weather-icon/d00.png",
        "day_wind_direction": "西南风",
        "night_wind_power": "<3级",
        "night_low_temperature": "0",
        "night_wind_direction": "西南风",
        "night_weather_pic": "xxxx/weather-icon/n00.png",
        "night_weather_code": "00",
        "night_weather": "晴"
      },
      {
   
        "daytime": "20211118",
        "day_weather_code": "00",
        "day_high_temperature": "12",
        "day_weather": "晴",
        "day_wind_power": "<3级",
        "day_weather_pic": "xxxx/weather-icon/d00.png",
        "day_wind_direction": "南风",
        "night_low_temperature": "2",
        "night_wind_direction": "北风",
        "night_weather_pic": "xxxx/weather-icon/n00.png",
        "night_weather_code": "00",
        "night_weather": "晴",
        "night_wind_power": "<3级"
      },
      {
   
        "daytime": "20211119",
        "day_weather_code": "01",
        "day_high_temperature": "10",
        "day_weather": "多云",
        "day_wind_power": "<3级",
        "day_weather_pic": "xxxx/weather-icon/d01.png",
        "day_wind_direction": "北风",
        "night_low_temperature": "3",
        "night_wind_direction": "北风",
        "night_weather_pic": "xxxx/weather-icon/n01.png",
        "night_weather_code": "01",
        "night_weather": "多云",
        "night_wind_power": "<3级"
      },
      {
   
        "daytime": "20211120",
        "day_weather_code": "01",
        "day_high_temperature": "10",
        "day_weather": "多云",
        "day_wind_power": "<3级",
        "day_weather_pic": "xxxx/weather-icon/d01.png",
        "day_wind_direction": "北风",
        "night_low_temperature": "1",
        "night_wind_direction": "西北风",
        "night_weather_pic": "xxxx/weather-icon/n00.png",
        "night_weather_code": "00",
        "night_weather": "晴",
        "night_wind_power": "3-4级"
      },
      {
   
        "daytime": "20211121",
        "day_weather_code": "00",
        "day_high_temperature": "8",
        "day_weather": "晴",
        "day_wind_power": "4-5级",
        "day_weather_pic": "xxxx/weather-icon/d00.png",
        "day_wind_direction": "西北风",
        "night_low_temperature": "-2",
        "night_wind_direction": "西北风",
        "night_weather_pic": "xxxx/weather-icon/n00.png",
        "night_weather_code": "00",
        "night_weather": "晴",
        "night_wind_power": "4-5级"
      },
      {
   
        "daytime": "20211122",
        "day_weather_code": "00",
        "day_high_temperature": "4",
        "day_weather": "晴",
        "day_wind_power": "3-4级",
        "day_weather_pic": "xxxx/weather-icon/d00.png",
        "day_wind_direction": "西北风",
        "night_low_temperature": "-4",
        "night_wind_direction": "西北风",
        "night_weather_pic": "xxxx/weather-icon/n00.png",
        "night_weather_code": "00",
        "night_weather": "晴",
        "night_wind_power": "3-4级"
      }
    ]
  }
}

天气查询-按景点

根据景点查询当前和未来7天的天气。

请求说明

名称 类型 必须 说明
scenery String 否 景点名称,景点id和名称至少传递一个
sceneryId String 否 景点id ,景点id和名称至少传递一个

返回样例

{
  "code": 200, // 详见code返回码说明
  "msg": "成功", // code 对应的描述
  "taskNo": "51168811490923554212", // 本次请求号
  "data": {
    "area": "北京", // 景点所在地区
    "areaId": "101010100", // 地名id 详见 地名说明
    "province": "北京", // 省份
    "city": "北京", // 城市
    "now": { // 当前实时天气
      "sd": "61%", // 湿度
      "aqi": "87", // 空气质量
      "weather": "晴", // 天气
      "weather_pic": "xxxx/weather-icon/d00.png", // 天气图标
      "temperature": "10", // 温度
      "wind_direction": "东北风", // 风向
      "wind_power": "1级" // 风级
    },
    "dayWeathers": [ // 未来7天天气,按日期从早到晚排序
      {
        "daytime": "20211116", // 日期
        "day_weather": "晴",  // 白天天气
        "day_weather_code": "00", // 白天天气编号,详见天气编号
        "day_weather_pic": "xxxx/weather-icon/d00.png", // 白天天气图标
        "day_high_temperature": "12", // 白天最高温度
        "day_wind_direction": "西南风",  // 白天风向
        "day_wind_power": "<3级", // 白天风级
        "night_weather": "多云", // 夜间天气
        "night_weather_code": "01", // 夜间天气编号
        "night_weather_pic": "xxxx/weather-icon/n01.png", // 夜间天气图标
        "night_low_temperature": "1", // 夜间最低温度
        "night_wind_direction": "西南风",  // 夜间风向
        "night_wind_power": "<3级"    // 夜间风级
      },
      {
        "daytime": "20211117",
        "day_weather_code": "00",
        "day_high_temperature": "13",
        "day_weather": "晴",
        "day_wind_power": "<3级",
        "day_weather_pic": "xxxx/weather-icon/d00.png",
        "day_wind_direction": "西南风",
        "night_wind_power": "<3级",
        "night_low_temperature": "0",
        "night_wind_direction": "西南风",
        "night_weather_pic": "xxxx/weather-icon/n00.png",
        "night_weather_code": "00",
        "night_weather": "晴"
      },
      {
        "daytime": "20211118",
        "day_weather_code": "00",
        "day_high_temperature": "12",
        "day_weather": "晴",
        "day_wind_power": "<3级",
        "day_weather_pic": "xxxx/weather-icon/d00.png",
        "day_wind_direction": "南风",
        "night_low_temperature": "2",
        "night_wind_direction": "北风",
        "night_weather_pic": "xxxx/weather-icon/n00.png",
        "night_weather_code": "00",
        "night_weather": "晴",
        "night_wind_power": "<3级"
      },
      {
        "daytime": "20211119",
        "day_weather_code": "01",
        "day_high_temperature": "10",
        "day_weather": "多云",
        "day_wind_power": "<3级",
        "day_weather_pic": "xxxx/weather-icon/d01.png",
        "day_wind_direction": "北风",
        "night_low_temperature": "3",
        "night_wind_direction": "北风",
        "night_weather_pic": "xxxx/weather-icon/n01.png",
        "night_weather_code": "01",
        "night_weather": "多云",
        "night_wind_power": "<3级"
      },
      {
        "daytime": "20211120",
        "day_weather_code": "01",
        "day_high_temperature": "10",
        "day_weather": "多云",
        "day_wind_power": "<3级",
        "day_weather_pic": "xxxx/weather-icon/d01.png",
        "day_wind_direction": "北风",
        "night_low_temperature": "1",
        "night_wind_direction": "西北风",
        "night_weather_pic": "xxxx/weather-icon/n00.png",
        "night_weather_code": "00",
        "night_weather": "晴",
        "night_wind_power": "3-4级"
      },
      {
        "daytime": "20211121",
        "day_weather_code": "00",
        "day_high_temperature": "8",
        "day_weather": "晴",
        "day_wind_power": "4-5级",
        "day_weather_pic": "xxxx/weather-icon/d00.png",
        "day_wind_direction": "西北风",
        "night_low_temperature": "-2",
        "night_wind_direction": "西北风",
        "night_weather_pic": "xxxx/weather-icon/n00.png",
        "night_weather_code": "00",
        "night_weather": "晴",
        "night_wind_power": "4-5级"
      },
      {
        "daytime": "20211122",
        "day_weather_code": "00",
        "day_high_temperature": "4",
        "day_weather": "晴",
        "day_wind_power": "3-4级",
        "day_weather_pic": "xxxx/weather-icon/d00.png",
        "day_wind_direction": "西北风",
        "night_low_temperature": "-4",
        "night_wind_direction": "西北风",
        "night_weather_pic": "xxxx/weather-icon/n00.png",
        "night_weather_code": "00",
        "night_weather": "晴",
        "night_wind_power": "3-4级"
      }
    ]
  }
}

天气查询-按地名id

根据地名查询对应的id。

请求说明

名称 类型 必须 说明
area String 是 地名

返回样例

{
   
  "code": 200, // 详见code返回码说明
  "msg": "成功", // code 对应的描述
  "taskNo": "30853523396532582768",  // 本次请求号
  "data": {
   
    "count": 14, //  查询结果个数
    "areaList": [ // 查询结果
          {
   
        "area": "杭州", // 地名
        "areaId": "101210101", // 地名id
        "city": "杭州", // 城市
        "province": "浙江" // 省份
      },
      {
   
        "area": "萧山",
        "areaId": "101210102",
        "city": "杭州",
        "province": "浙江"
      },
      {
   
        "area": "桐庐",
        "areaId": "101210103",
        "city": "杭州",
        "province": "浙江"
      },
      {
   
        "area": "淳安",
        "areaId": "101210104",
        "city": "杭州",
        "province": "浙江"
      },
      {
   
        "area": "建德",
        "areaId": "101210105",
        "city": "杭州",
        "province": "浙江"
      },
      {
   
        "area": "余杭",
        "areaId": "101210106",
        "city": "杭州",
        "province": "浙江"
      },
      {
   
        "area": "临安",
        "areaId": "101210107",
        "city": "杭州",
        "province": "浙江"
      },
      {
   
        "area": "富阳",
        "areaId": "101210108",
        "city": "杭州",
        "province": "浙江"
      },
      {
   
        "area": "上城",
        "areaId": "101210109",
        "city": "杭州",
        "province": "浙江"
      },
      {
   
        "area": "下城",
        "areaId": "101210110",
        "city": "杭州",
        "province": "浙江"
      },
      {
   
        "area": "江干",
        "areaId": "101210111",
        "city": "杭州",
        "province": "浙江"
      },
      {
   
        "area": "拱墅",
        "areaId": "101210112",
        "city": "杭州",
        "province": "浙江"
      },
      {
   
        "area": "西湖",
        "areaId": "101210113",
        "city": "杭州",
        "province": "浙江"
      },
      {
   
        "area": "滨江",
        "areaId": "101210114",
        "city": "杭州",
        "province": "浙江"
      }
    ]
  }
}

天气查询-按景区id

根据景点名称查询景点id。

请求说明

名称 类型 必须 说明
scenery String 是 景点名称

返回样例

{
   
  "code": 200, // 详见code返回码说明
  "msg": "成功", // code 对应的描述
  "taskNo": "30853523396532582768",  // 本次请求号
  "data": {
   
    "count": 2, //  查询结果个数
    "sceneryList": [ // 查询结果
      {
   
        "name": "故宫博物院-北京市景点", 
        "id": "10101010018A"
      },
      {
   
        "name": "沈阳故宫-辽宁省景点",
        "id": "10107010109A"
      }
    ]
  }
}

天气查询-24小时

根据地名查询24小时的天气。

请求说明

名称 类型 必须 说明
area String 否 地名,详见地名说明
areaId String 否 地名Id,详见地名说明

地名说明

  • area和areaId必须传入一个,同时传入,以areaId为准
  • 地名不能带有“市”、“县”,比如查杭州,area传入“杭州”,而不是传入“杭州市”

返回样例

{
   
  "code": 200, // 详见code返回码说明
  "msg": "成功", // code 对应的描述
  "taskNo": "30853523396532582768",  // 本次请求号
  "data": {
   
    "area": "北京", // 地名 详见 地名说明
    "areaId": "101010100", // 地名id 详见 地名说明
    "province": "北京", // 省份
    "city": "北京", // 城市
    "hourWeathers": [ // 24 小时天气, 共24个元素,按时间从早到晚排序
      {
   
        "time": "202111160800", // 时间
        "weather": "阴", // 天气
        "weather_code": "02",  // 天气编号,详见天气编号
        "temperature": "13", // 温度
        "wind_direction": "东风", // 风向
        "wind_power": "0-3级" // 风级
      },
      {
   
        "time": "202111160900",
        "temperature": "14",
        "weather": "阴",
        "wind_direction": "东风",
        "weather_code": "02",
        "wind_power": "0-3级"
      },
      {
   
        "temperature": "15",
        "weather": "阴",
        "wind_direction": "东风",
        "time": "202111161000",
        "weather_code": "02",
        "wind_power": "0-3级"
      },
      ...
    ]
  }
}

天气查询-未来7天内指定日期

根据地名查询未来7天内指定日期的天气。

请求说明

名称 类型 必须 说明
area String 否 地名,详见地名说明
areaId String 否 地名Id,详见地名说明
date String 否 日期,格式:yyyyMMdd,默认今天

地名说明

  • area和areaId必须传入一个,同时传入,以areaId为准
  • 地名不能带有“市”、“县”,比如查杭州,area传入“杭州”,而不是传入“杭州市”

返回样例

{
   
  "code": 200, // 详见code返回码说明
  "msg": "成功", // code 对应的描述
  "taskNo": "30853523396532582768",  // 本次请求号
  "data": {
   
    "area": "北京", // 地名 详见 地名说明
    "areaId": "101010100", // 地名id 详见 地名说明
    "province": "北京", // 省份
    "city": "北京", // 城市
    "weather": {
    // 天气
      "date": "20211118", // 日期
      "day_weather": "多云",
      "day_weather": "晴",  // 白天天气
      "day_weather_code": "00", // 白天天气编号,详见天气编号
      "day_weather_pic": "xxxx/weather-icon/d00.png", // 白天天气图标
      "day_high_temperature": "12", // 白天最高温度
      "day_wind_direction": "西南风",  // 白天风向
      "day_wind_power": "<3级", // 白天风级
      "night_weather": "多云", // 夜间天气
      "night_weather_code": "01", // 夜间天气编号
      "night_weather_pic": "xxxx/weather-icon/n01.png", // 夜间天气图标
      "night_low_temperature": "1", // 夜间最低温度
      "night_wind_direction": "西南风",  // 夜间风向
      "night_wind_power": "<3级",   // 夜间风级
      "sun_begin_end": "06:27|17:01", // 太阳升起和落下时间
      "life": {
    //生活气象指数
        "uv": {
      // 紫外线
          "title": "弱",
          "desc": "辐射较弱,涂擦SPF12-15、PA+护肤品。"
        },
        "aqi": {
    //  空气质量
          "title": "良",
          "desc": "气象条件有利于空气污染物扩散。"
        },
        "clothes": {
    //  着装
          "title": "较冷",
          "desc": "建议着厚外套加毛衣等服装。"
        },
        "wash_car": {
    //  出行
          "title": "较不宜",
          "desc": "路面有积水,车子易被溅上泥水。"
        }
      }
    }
  }
}

天气查询-未来15天

根据地名查询未来15天的天气。

请求说明

名称 类型 必须 说明
area String 否 地名,详见地名说明
areaId String 否 地名Id,详见地名说明

地名说明

  • area和areaId必须传入一个,同时传入,以areaId为准
  • 地名不能带有“市”、“县”,比如查杭州,area传入“杭州”,而不是传入“杭州市”

返回样例

{
  "code": 200, // 详见code返回码说明
  "msg": "成功", // code 对应的描述
  "taskNo": "51168811490923554212", // 本次请求号
  "data": {
    "area": "北京", // 地名 详见 地名说明
    "areaId": "101010100", // 地名id 详见 地名说明
    "province": "北京", // 省份
    "city": "北京", // 城市
    "dayWeathers": [ // 未来15天天气,按日期从早到晚排序
      {
        "daytime": "20211116", // 日期
        "day_weather": "晴",  // 白天天气
        "day_weather_code": "00", // 白天天气编号,详见天气编号
        "day_weather_pic": "xxxx/weather-icon/d00.png", // 白天天气图标
        "day_high_temperature": "12", // 白天最高温度
        "day_wind_direction": "西南风",  // 白天风向
        "day_wind_power": "<3级", // 白天风级
        "night_weather": "多云", // 夜间天气
        "night_weather_code": "01", // 夜间天气编号
        "night_weather_pic": "xxxx/weather-icon/n01.png", // 夜间天气图标
        "night_low_temperature": "1", // 夜间最低温度
        "night_wind_direction": "西南风",  // 夜间风向
        "night_wind_power": "<3级"    // 夜间风级
      },
      {
        "daytime": "20211117",
        "day_weather_code": "00",
        "day_high_temperature": "13",
        "day_weather": "晴",
        "day_wind_power": "<3级",
        "day_weather_pic": "xxxx/weather-icon/d00.png",
        "day_wind_direction": "西南风",
        "night_wind_power": "<3级",
        "night_low_temperature": "0",
        "night_wind_direction": "西南风",
        "night_weather_pic": "xxxx/weather-icon/n00.png",
        "night_weather_code": "00",
        "night_weather": "晴"
      },
      {
        "daytime": "20211118",
        "day_weather_code": "00",
        "day_high_temperature": "12",
        "day_weather": "晴",
        "day_wind_power": "<3级",
        "day_weather_pic": "xxxx/weather-icon/d00.png",
        "day_wind_direction": "南风",
        "night_low_temperature": "2",
        "night_wind_direction": "北风",
        "night_weather_pic": "xxxx/weather-icon/n00.png",
        "night_weather_code": "00",
        "night_weather": "晴",
        "night_wind_power": "<3级"
      },
      {
        "daytime": "20211119",
        "day_weather_code": "01",
        "day_high_temperature": "10",
        "day_weather": "多云",
        "day_wind_power": "<3级",
        "day_weather_pic": "xxxx/weather-icon/d01.png",
        "day_wind_direction": "北风",
        "night_low_temperature": "3",
        "night_wind_direction": "北风",
        "night_weather_pic": "xxxx/weather-icon/n01.png",
        "night_weather_code": "01",
        "night_weather": "多云",
        "night_wind_power": "<3级"
      },
      {
        "daytime": "20211120",
        "day_weather_code": "01",
        "day_high_temperature": "10",
        "day_weather": "多云",
        "day_wind_power": "<3级",
        "day_weather_pic": "xxxx/weather-icon/d01.png",
        "day_wind_direction": "北风",
        "night_low_temperature": "1",
        "night_wind_direction": "西北风",
        "night_weather_pic": "xxxx/weather-icon/n00.png",
        "night_weather_code": "00",
        "night_weather": "晴",
        "night_wind_power": "3-4级"
      },
      ....
    ]
  }
}

天气查询-历史天气

全国3000多个省市的历史天气查询,包括最高最低温度、风级、湿度、气压等指数,最低最高温度、日出日落时间、空气质量指数、首要污染物等信息.

请求说明

名称 类型 必须 说明
date String 否 日期,默认为昨天,格式为:yyyy-MM-dd
city String 是 城市名称或者城市区划代码,支持区县

返回样例

{
  "code": 200,//返回码,详见返回码说明
  "msg": "成功",//返回码对应描述
  "taskNo": "680024790172821701729765",//本次请求号
  "data": {
    "date": "2024-08-23",//日期
    "templow": "26",//最低气温
    "img": "https://xxx.png",//图片地址
    "imgNo": "02",//天气图标编号
    "sunrise": "05:30",//日出时间
    "windpower": "2级",//风级
    "cityname": "杭州",//城市
    "cityid": 382,//城市ID
    "pressure": "1004",//气压
    "primarypollutant": "—",//首要污染物
    "temphigh": "36",//最高气温
    "winddirect": "南风",//风向
    "sunset": "18:33",//日落时间
    "weather": "晴",//天气
    "aqi": "35",//AQI指数
    "humidity": "80",//湿度
    "windspeed": "2.1"//风速
  }
}
相关文章
|
消息中间件 搜索推荐 算法
数据仓库常见规范
数据仓库常见规范
数据仓库常见规范
|
SQL 关系型数据库 MySQL
|
存储 数据采集 Oracle
医疗(医院)数据中台建设方案
以广州某三甲医院数据中台建设目标为例
4309 0
|
6月前
|
存储 人工智能 运维
本体论 Ontology 泛谈丨如何帮企业应对 Tokenmaxxing 困局
阿里云近期发布的全域智能运维平台 STAROps,将大模型技术、UModel、RCA、RCA benchmark 进行有机结合,是国内在 AIOps 方向上把 Ontology 落地得较为完整的实践。
1145 36
|
6月前
|
SQL 机器学习/深度学习 自然语言处理
本体语义层落地指南:企业需要配备哪些关键能力与角色?
本体语义层方案需要企业什么样的团队能力来配合?从截至2026年5月的行业实践来看,这个问题没有标准答案,但有一条核心判断:本体的构建能力决定系统上限,持续运营能力决定系统价值下限。
|
6月前
|
人工智能 数据挖掘 BI
本体论 vs 语义层:两种 AI 业务语义底座的区别、场景与建设路径
本体论和语义层并不是互斥关系,也不是简单的“谁替代谁”。本体论表达了企业 AI 的高阶目标,语义层提供了多数企业更容易落地的起点。
|
存储 编解码 数据安全/隐私保护
|
人工智能 数据处理 光互联
2024年AI的火爆引发光模块产业迅速发展
2024年,AI技术如ChatGPT和Sora视频生成器推动行业发展,英伟达GPU需求激增。光模块产业因AI的广泛需求而迅速扩张,800G光模块(如英伟达H100支持的)成为新宠,市场预期将向1.6T速率迈进。CPO技术有望解决传输需求,预计2024-2027年将迎来商用和量产高潮。光模块行业通过技术创新和产能提升,适应AI时代对高速、低能耗传输的挑战,市场规模持续增长。
553 0

热门文章

最新文章