城市实时天气
注意: WebAPI v7版本的城市实时天气即将弃用,请使用实时天气 v1代替。
获取中国3000+市县区和海外50万个城市实时天气数据,包括实时温度、体感温度、风力风向、相对湿度、大气压强、降水量、能见度、露点温度、云量等。
请求路径#
GET /v7/weather/now参数#
查询参数
-
location 必选string需要查询地区的LocationID或以英文逗号分隔的经度,纬度坐标(十进制,最多支持小数点后两位),LocationID可通过GeoAPI获取。例如
location=101010100或location=116.41,39.92 -
langstring
请求示例#
curl -X GET --compressed \
-H 'Authorization: Bearer your_token' \
'https://your-api-host/v7/weather/now?location=116.41%2C39.92'
请将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"
]
}
}
-
codestring
-
updateTimedate-time
-
fxLinkuri当前数据的响应式页面,便于嵌入网站或应用
-
nowobject天气实况数据
-
obsTimedate-time观测时间
-
tempstring温度,默认单位:摄氏度
-
textstring天气状况的文字描述,包括阴晴雨雪等天气状态的描述
-
wind360string风向360角度
-
windDirstring
-
windScalestring
-
windSpeedstring风速,公里/小时
-
humiditystring相对湿度,百分比数值
-
precipstring降水量,默认单位:毫米
-
pressurestring站点气压,默认单位:百帕
-
cloudstring云量,百分比数值
-
dewstring露点温度
-
feelsLikestring体感温度,默认单位:摄氏度
-
visstring能见度,默认单位:公里
-
-
referobject数据来源和许可信息
-
sourcesarray原始数据来源,或数据源说明,可能为空
-
licensearray数据许可或版权声明,可能为空
-