格点逐小时天气预报

平台: API

基于全球任意坐标的高精度逐小时天气预报,精确到3-5公里范围,包括温度、湿度、大气压、天气状况、风力、风向等。

请求URL

逐小时预报(未来24小时)
https://api.qweather.com/v7/grid-weather/24h
逐小时预报(未来72小时)
https://api.qweather.com/v7/grid-weather/72h

如果是免费订阅,将上述API Host更改为devapi.qweather.com。参考免费订阅可用的数据

请求参数

请求参数包括必选和可选参数,参数之间使用&进行分隔。

  • location(必选)需要查询地区的以英文逗号分隔的经度,纬度坐标(十进制,最多支持小数点后两位)。例如 location=116.41,39.92
  • lang多语言设置,请阅读多语言文档,了解我们的多语言是如何工作、如何设置以及数据是否支持多语言。
  • unit数据单位设置,可选值包括unit=m(公制单位,默认)和unit=i(英制单位)。更多选项和说明参考度量衡单位

请求示例

curl -X GET --compressed \
-H 'Authorization: Bearer your_token' \
'https://api.qweather.com/v7/grid-weather/24h?location=116.41,39.92'

请将your_token替换为你的JWT或了解身份认证

返回数据

返回数据是JSON格式并进行了Gzip压缩

{
  "code": "200",
  "updateTime": "2021-12-16T19:27+08:00",
  "fxLink": "https://www.qweather.com",
  "hourly": [
    {
      "fxTime": "2021-12-16T12:00+00:00",
      "temp": "-2",
      "icon": "150",
      "text": "晴",
      "wind360": "285",
      "windDir": "西北风",
      "windScale": "2",
      "windSpeed": "8",
      "humidity": "30",
      "precip": "0.0",
      "pressure": "1022",
      "cloud": "0",
      "dew": "-17"
    },
    {
      "fxTime": "2021-12-16T13:00+00:00",
      "temp": "-3",
      "icon": "150",
      "text": "晴",
      "wind360": "289",
      "windDir": "西北风",
      "windScale": "2",
      "windSpeed": "8",
      "humidity": "32",
      "precip": "0.0",
      "pressure": "1023",
      "cloud": "0",
      "dew": "-17"
    },
    {
      "fxTime": "2021-12-16T14:00+00:00",
      "temp": "-3",
      "icon": "150",
      "text": "晴",
      "wind360": "293",
      "windDir": "西北风",
      "windScale": "2",
      "windSpeed": "7",
      "humidity": "34",
      "precip": "0.0",
      "pressure": "1024",
      "cloud": "0",
      "dew": "-17"
    },
    {
      "fxTime": "2021-12-16T15:00+00:00",
      "temp": "-4",
      "icon": "150",
      "text": "晴",
      "wind360": "296",
      "windDir": "西北风",
      "windScale": "2",
      "windSpeed": "6",
      "humidity": "35",
      "precip": "0.0",
      "pressure": "1024",
      "cloud": "0",
      "dew": "-17"
    },
    {
      "fxTime": "2021-12-16T16:00+00:00",
      "temp": "-4",
      "icon": "150",
      "text": "晴",
      "wind360": "294",
      "windDir": "西北风",
      "windScale": "2",
      "windSpeed": "6",
      "humidity": "35",
      "precip": "0.0",
      "pressure": "1025",
      "cloud": "0",
      "dew": "-17"
    },
    {
      "fxTime": "2021-12-16T17:00+00:00",
      "temp": "-5",
      "icon": "150",
      "text": "晴",
      "wind360": "290",
      "windDir": "西北风",
      "windScale": "2",
      "windSpeed": "7",
      "humidity": "35",
      "precip": "0.0",
      "pressure": "1025",
      "cloud": "0",
      "dew": "-18"
    },
    {
      "fxTime": "2021-12-16T18:00+00:00",
      "temp": "-5",
      "icon": "150",
      "text": "晴",
      "wind360": "280",
      "windDir": "西风",
      "windScale": "2",
      "windSpeed": "8",
      "humidity": "33",
      "precip": "0.0",
      "pressure": "1025",
      "cloud": "0",
      "dew": "-19"
    },
    {
      "fxTime": "2021-12-16T19:00+00:00",
      "temp": "-6",
      "icon": "154",
      "text": "阴",
      "wind360": "277",
      "windDir": "西风",
      "windScale": "2",
      "windSpeed": "9",
      "humidity": "30",
      "precip": "0.0",
      "pressure": "1026",
      "cloud": "6",
      "dew": "-20"
    },
    {
      "fxTime": "2021-12-16T20:00+00:00",
      "temp": "-6",
      "icon": "150",
      "text": "晴",
      "wind360": "283",
      "windDir": "西北风",
      "windScale": "2",
      "windSpeed": "9",
      "humidity": "29",
      "precip": "0.0",
      "pressure": "1026",
      "cloud": "0",
      "dew": "-21"
    },
    {
      "fxTime": "2021-12-16T21:00+00:00",
      "temp": "-7",
      "icon": "150",
      "text": "晴",
      "wind360": "286",
      "windDir": "西北风",
      "windScale": "2",
      "windSpeed": "9",
      "humidity": "27",
      "precip": "0.0",
      "pressure": "1026",
      "cloud": "0",
      "dew": "-22"
    },
    {
      "fxTime": "2021-12-16T22:00+00:00",
      "temp": "-7",
      "icon": "150",
      "text": "晴",
      "wind360": "287",
      "windDir": "西北风",
      "windScale": "2",
      "windSpeed": "8",
      "humidity": "27",
      "precip": "0.0",
      "pressure": "1026",
      "cloud": "0",
      "dew": "-23"
    },
    {
      "fxTime": "2021-12-16T23:00+00:00",
      "temp": "-7",
      "icon": "150",
      "text": "晴",
      "wind360": "293",
      "windDir": "西北风",
      "windScale": "1",
      "windSpeed": "5",
      "humidity": "28",
      "precip": "0.0",
      "pressure": "1027",
      "cloud": "0",
      "dew": "-23"
    },
    {
      "fxTime": "2021-12-17T00:00+00:00",
      "temp": "-7",
      "icon": "150",
      "text": "晴",
      "wind360": "304",
      "windDir": "西北风",
      "windScale": "1",
      "windSpeed": "3",
      "humidity": "27",
      "precip": "0.0",
      "pressure": "1027",
      "cloud": "0",
      "dew": "-23"
    },
    {
      "fxTime": "2021-12-17T01:00+00:00",
      "temp": "-7",
      "icon": "150",
      "text": "晴",
      "wind360": "335",
      "windDir": "西北风",
      "windScale": "1",
      "windSpeed": "4",
      "humidity": "24",
      "precip": "0.0",
      "pressure": "1028",
      "cloud": "0",
      "dew": "-24"
    },
    {
      "fxTime": "2021-12-17T02:00+00:00",
      "temp": "-6",
      "icon": "150",
      "text": "晴",
      "wind360": "329",
      "windDir": "西北风",
      "windScale": "2",
      "windSpeed": "8",
      "humidity": "20",
      "precip": "0.0",
      "pressure": "1028",
      "cloud": "0",
      "dew": "-25"
    },
    {
      "fxTime": "2021-12-17T03:00+00:00",
      "temp": "-5",
      "icon": "150",
      "text": "晴",
      "wind360": "327",
      "windDir": "西北风",
      "windScale": "3",
      "windSpeed": "14",
      "humidity": "17",
      "precip": "0.0",
      "pressure": "1029",
      "cloud": "0",
      "dew": "-26"
    },
    {
      "fxTime": "2021-12-17T04:00+00:00",
      "temp": "-4",
      "icon": "150",
      "text": "晴",
      "wind360": "325",
      "windDir": "西北风",
      "windScale": "3",
      "windSpeed": "14",
      "humidity": "16",
      "precip": "0.0",
      "pressure": "1028",
      "cloud": "0",
      "dew": "-26"
    },
    {
      "fxTime": "2021-12-17T05:00+00:00",
      "temp": "-3",
      "icon": "150",
      "text": "晴",
      "wind360": "324",
      "windDir": "西北风",
      "windScale": "3",
      "windSpeed": "16",
      "humidity": "15",
      "precip": "0.0",
      "pressure": "1026",
      "cloud": "0",
      "dew": "-26"
    },
    {
      "fxTime": "2021-12-17T06:00+00:00",
      "temp": "-2",
      "icon": "150",
      "text": "晴",
      "wind360": "324",
      "windDir": "西北风",
      "windScale": "3",
      "windSpeed": "15",
      "humidity": "14",
      "precip": "0.0",
      "pressure": "1025",
      "cloud": "0",
      "dew": "-25"
    },
    {
      "fxTime": "2021-12-17T07:00+00:00",
      "temp": "-1",
      "icon": "150",
      "text": "晴",
      "wind360": "325",
      "windDir": "西北风",
      "windScale": "3",
      "windSpeed": "12",
      "humidity": "13",
      "precip": "0.0",
      "pressure": "1025",
      "cloud": "0",
      "dew": "-26"
    },
    {
      "fxTime": "2021-12-17T08:00+00:00",
      "temp": "-1",
      "icon": "150",
      "text": "晴",
      "wind360": "352",
      "windDir": "北风",
      "windScale": "2",
      "windSpeed": "8",
      "humidity": "13",
      "precip": "0.0",
      "pressure": "1024",
      "cloud": "0",
      "dew": "-26"
    },
    {
      "fxTime": "2021-12-17T09:00+00:00",
      "temp": "-2",
      "icon": "150",
      "text": "晴",
      "wind360": "44",
      "windDir": "东北风",
      "windScale": "2",
      "windSpeed": "9",
      "humidity": "19",
      "precip": "0.0",
      "pressure": "1024",
      "cloud": "0",
      "dew": "-22"
    },
    {
      "fxTime": "2021-12-17T10:00+00:00",
      "temp": "-3",
      "icon": "150",
      "text": "晴",
      "wind360": "52",
      "windDir": "东北风",
      "windScale": "2",
      "windSpeed": "8",
      "humidity": "26",
      "precip": "0.0",
      "pressure": "1024",
      "cloud": "0",
      "dew": "-20"
    },
    {
      "fxTime": "2021-12-17T11:00+00:00",
      "temp": "-4",
      "icon": "154",
      "text": "阴",
      "wind360": "48",
      "windDir": "东北风",
      "windScale": "2",
      "windSpeed": "6",
      "humidity": "29",
      "precip": "0.0",
      "pressure": "1023",
      "cloud": "91",
      "dew": "-19"
    }
  ],
  "refer": {
    "sources": [
      "QWeather"
    ],
    "license": [
      "QWeather Developers License"
    ]
  }
}
  • code 请参考状态码
  • updateTime 当前API的最近更新时间
  • fxLink 当前数据的响应式页面,便于嵌入网站或应用
  • hourly.fxTime 预报时间
  • hourly.temp 温度,默认单位:摄氏度
  • hourly.icon 天气状况的图标代码,另请参考天气图标项目
  • hourly.text 天气状况的文字描述,包括阴晴雨雪等天气状态的描述
  • hourly.wind360 风向360角度
  • hourly.windDir 风向
  • hourly.windScale 风力等级
  • hourly.windSpeed 风速,公里/小时
  • hourly.humidity 相对湿度,百分比数值
  • hourly.precip 当前小时累计降水量,默认单位:毫米
  • hourly.cloud 云量,百分比数值。可能为空
  • hourly.dew 露点温度。可能为空
  • refer.sources 原始数据来源,或数据源说明,可能为空
  • refer.license 数据许可或版权声明,可能为空