逐天天气预报

全球城市未来15天天气预报,包括:日出日落、月升月落、最高最低温度、天气白天和夜间状况、风力、风速、风向、相对湿度、大气压强、降水量、降水概率、露点温度、紫外线强度、能见度等。

请求URL

3天预报

  • 商业版https://api.qweather.com/v7/weather/3d?[请求参数]
  • 开发版https://devapi.qweather.com/v7/weather/3d?[请求参数]

7天预报

  • 商业版https://api.qweather.com/v7/weather/7d?[请求参数]
  • 开发版https://devapi.qweather.com/v7/weather/7d?[请求参数]

10天预报

  • 商业版https://api.qweather.com/v7/weather/10d?[请求参数]

15天预报

  • 商业版https://api.qweather.com/v7/weather/15d?[请求参数]

请求参数

请求参数包括必选和可选参数,如不填写可选参数将使用其默认值,参数之间使用&进行分隔。

location

需要查询地区的LocationID或以英文逗号分隔的经度,纬度坐标(十进制),LocationID可通过城市搜索服务获取。例如 location=101010100location=116.41,39.92

key

用户认证key,请参考如何获取你的KEY。支持数字签名方式进行认证。例如 key=123456789ABC

lang

多语言设置,默认中文,当数据不匹配你设置的语言时,将返回英文或其本地语言结果。

unit

度量衡单位参数选择,例如温度选摄氏度或华氏度、公里或英里。默认公制单位

  • m 公制单位,默认
  • i 英制单位

返回数据

// 北京3天预报 
// 商业版 https://api.qweather.com/v7/weather/3d?location=101010100&key=你的KEY
// 开发版 https://devapi.qweather.com/v7/weather/3d?location=101010100&key=你的KEY

{
  "code": "200",
  "updateTime": "2021-02-16T13:35+08:00",
  "fxLink": "http://hfx.link/2ax1",
  "daily": [
    {
      "fxDate": "2021-02-16",
      "sunrise": "07:04",
      "sunset": "17:53",
      "moonrise": "09:31",
      "moonset": "22:17",
      "moonPhase": "峨眉月",
      "tempMax": "2",
      "tempMin": "-7",
      "iconDay": "100",
      "textDay": "晴",
      "iconNight": "150",
      "textNight": "晴",
      "wind360Day": "0",
      "windDirDay": "北风",
      "windScaleDay": "3-4",
      "windSpeedDay": "24",
      "wind360Night": "0",
      "windDirNight": "北风",
      "windScaleNight": "3-4",
      "windSpeedNight": "16",
      "humidity": "16",
      "precip": "0.0",
      "pressure": "1025",
      "vis": "25",
      "cloud": "0",
      "uvIndex": "3"
    },
    {
      "fxDate": "2021-02-17",
      "sunrise": "07:02",
      "sunset": "17:54",
      "moonrise": "09:54",
      "moonset": "23:16",
      "moonPhase": "峨眉月",
      "tempMax": "4",
      "tempMin": "-6",
      "iconDay": "100",
      "textDay": "晴",
      "iconNight": "150",
      "textNight": "晴",
      "wind360Day": "315",
      "windDirDay": "西北风",
      "windScaleDay": "3-4",
      "windSpeedDay": "16",
      "wind360Night": "270",
      "windDirNight": "西风",
      "windScaleNight": "1-2",
      "windSpeedNight": "3",
      "humidity": "17",
      "precip": "0.0",
      "pressure": "1024",
      "vis": "25",
      "cloud": "0",
      "uvIndex": "3"
    },
    {
      "fxDate": "2021-02-18",
      "sunrise": "07:01",
      "sunset": "17:55",
      "moonrise": "10:18",
      "moonset": "00:00",
      "moonPhase": "峨眉月",
      "tempMax": "8",
      "tempMin": "-5",
      "iconDay": "100",
      "textDay": "晴",
      "iconNight": "150",
      "textNight": "晴",
      "wind360Day": "225",
      "windDirDay": "西南风",
      "windScaleDay": "1-2",
      "windSpeedDay": "3",
      "wind360Night": "225",
      "windDirNight": "西南风",
      "windScaleNight": "1-2",
      "windSpeedNight": "3",
      "humidity": "32",
      "precip": "0.0",
      "pressure": "1008",
      "vis": "25",
      "cloud": "0",
      "uvIndex": "4"
    }
  ],
  "refer": {
    "sources": [
      "Weather China"
    ],
    "license": [
      "commercial license"
    ]
  }
}
参数 描述
code

API状态码,具体含义请参考状态码

updateTime

当前API的最近更新时间

fxLink

当前数据的响应式页面,便于嵌入网站或应用

daily.fxDate

预报日期

daily.sunrise

日出时间

daily.sunset

日落时间

daily.moonrise

月升时间

daily.moonset

月落时间

daily.moonPhase

月相名称

daily.tempMax

预报当天最高温度

daily.tempMin

预报当天最低温度

daily.iconDay

预报白天天气状况的图标代码,图标可通过天气状况和图标下载

daily.textDay

预报白天天气状况文字描述,包括阴晴雨雪等天气状态的描述

daily.iconNight

预报夜间天气状况的图标代码,图标可通过天气状况和图标下载

daily.textNight

预报晚间天气状况文字描述,包括阴晴雨雪等天气状态的描述

daily.wind360Day

预报白天风向360角度

daily.windDirDay

预报白天风向

daily.windScaleDay

预报白天风力等级

daily.windSpeedDay

预报白天风速,公里/小时

daily.wind360Night

预报夜间风向360角度

daily.windDirNight

预报夜间当天风向

daily.windScaleNight

预报夜间风力等级

daily.windSpeedNight

预报夜间风速,公里/小时

daily.precip

预报当天总降水量,默认单位:毫米

daily.uvIndex

紫外线强度指数

daily.humidity

相对湿度,百分比数值

daily.pressure

大气压强,默认单位:百帕

daily.vis

能见度,默认单位:公里

daily.cloud

云量,百分比数值

refer.sources

原始数据来源,或数据源说明,可能为空

refer.license

数据许可或版权声明,可能为空