实时天气
获取中国3000+市县区和海外50万个城市实时天气数据,包括实时温度、体感温度、风力风向、相对湿度、大气压强、降水量、能见度、露点温度、云量等。
注意: 实况数据均为近实时数据,相比真实的物理世界有5-20分钟的延迟,请根据实况数据中的
obsTime确定数据对应的准确时间。
请求路径#
GET /v7/weather/now参数#
查询参数
-
location(必选) 需要查询地区的LocationID或以英文逗号分隔的经度,纬度坐标(十进制,最多支持小数点后两位),LocationID可通过GeoAPI获取。例如location=101010100或location=116.41,39.92 -
lang多语言设置,请阅读多语言文档,了解我们的多语言是如何工作、如何设置以及数据是否支持多语言。
请求示例#
curl -X GET --compressed \
-H 'Authorization: Bearer your_token' \
'https://your-api-host/v7/weather/now?location=116.41%2C39.92&lang=zh'
请将your_token替换为你的JWT身份认证,将your_api_host替换为你的API Host
返回数据#
{
"code": "200",
"updateTime": "2020-06-30T22:00+08:00",
"fxLink": "https://www.qweather.com/en/weather/beijing-101010100.html",
"now": {
"obsTime": "2020-06-30T21:40+08:00",
"temp": "24",
"feelsLike": "26",
"icon": "101",
"text": "多云",
"wind360": "123",
"windDir": "东南风",
"windScale": "1",
"windSpeed": "3",
"humidity": "72",
"precip": "0.0",
"pressure": "1003",
"vis": "16",
"cloud": "10",
"dew": "21"
},
"refer": {
"sources": [
"https://developer.qweather.com/attribution.html"
],
"license": [
"QWeather Developers License"
]
}
}
-
fxLinkuri 当前数据的响应式页面,便于嵌入网站或应用 -
nowobject 天气实况数据-
obsTimedate-time 观测时间 -
tempstring 温度,默认单位:摄氏度 -
textstring 天气状况的文字描述,包括阴晴雨雪等天气状态的描述 -
humiditystring 相对湿度,百分比数值 -
precipstring 降水量,默认单位:毫米 -
pressurestring 站点气压,默认单位:百帕 -
cloudstring 云量,百分比数值 -
dewstring 露点温度 -
feelsLikestring 体感温度,默认单位:摄氏度 -
visstring 能见度,默认单位:公里
-
-
referobject 数据来源和许可信息-
sourcesarray 原始数据来源,或数据源说明,可能为空 -
licensearray 数据许可或版权声明,可能为空
-