中国4A和5A级景点共2000+的7天天气预报,包括:日出日落时间、最高最低温度、白天和晚间天气状况、风力、风向等。
请求URL
景点实况天气 HTTP GET
- 商业版
https://api.qweather.com/v7/weather-poi/now?{请求参数}
景点7天预报 HTTP GET
- 商业版
https://api.qweather.com/v7/weather-poi/7d?{请求参数}
请求参数
请求参数包括必选和可选参数,如不填写可选参数将使用其默认值,参数之间使用&
进行分隔。
location 必选
需要查询景点的LocationID,LocationID可通过城市搜索服务获取。例如: location=101010100
key 必选
用户认证密钥,请参考如何获取你的KEY。支持数字签名方式认证。例如:key=12334567890ABC
gzip 可选
对接口进行压缩,可大幅节省网络消耗、减少接口获取延迟。默认开启gzip。
y
使用gzip方式压缩,默认n
不使用压缩
lang 可选
多语言,默认中文。具体的语言参数值请参考多语言参数
unit 可选
度量衡单位参数选择,例如温度选摄氏度或华氏度。默认公制单位。
m
公制单位,默认i
英制单位
返回数据
参数 | 描述 | 示例值 |
---|---|---|
code | API状态码,具体含义请参考状态码 | 200 |
updateTime | 当前API的最近更新时间 | 2013-12-30T01:45+08:00 |
fxLink | 该城市的中国景点天气预报自适应网页,可嵌入网站或应用 | http://hfx.link/ae45 |
now.obsTime | 实况观测时间 | 2013-12-30T01:45+08:00 |
now.temp | 实况温度,默认单位:摄氏度 | 21 |
now.feelsLike | 实况体感温度,默认单位:摄氏度 | 23 |
now.icon | 当前天气状况和图标的代码,图标可通过天气状况和图标下载 | 100 |
now.text | 实况天气状况的文字描述,包括阴晴雨雪等天气状态的描述 | 晴 |
now.windDir | 实况风向 | 西北 |
now.windScale | 实况风力等级 | 3 |
now.humidity | 实况相对湿度,百分比数值 | 40 |
now.precip | 实况降水量,默认单位:毫米 | 1.2 |
now.pressure | 实况大气压强,默认单位:百帕 | 1020 |
daily.fxDate | 预报日期 | 2018-05-31 |
daily.tempMax | 预报最高温度 | 4 |
daily.tempMin | 预报最低温度 | -5 |
daily.iconDay | 预报白天天气状况图标的代码,图标可通过天气状况和图标下载 | 100 |
daily.textDay | 预报白天天气状况描述 | 晴 |
daily.iconNight | 预报夜间天气状况图标的代码,图标可通过天气状况和图标下载 | 100 |
daily.textNight | 晚间天气状况描述 | 晴 |
daily.windDirDay | 预报白天风向 | 东 |
daily.windScaleDay | 预报白天风力 | 2-3 |
daily.windDirNight | 预报夜间风向 | 东 |
daily.windScaleNight | 预报夜间风力 | 2-3 |
refer.sources | 原始数据来源,可能为空 | |
refer.license | 数据许可证 |
请求和返回示例
景点实况天气
// 北京玉渊潭公园实况天气
// 商业版 https://api.qweather.com/v7/weather-poi/now?location=10101020010A&key=xxx
// 开发版 https://api.qweather.com/v7/weather-poi/now?location=10101020010A&key=xxx
// 请将示例请求URL中的KEY更换成你自己的KEY
{
"code": "200",
"updateTime": "2020-06-14T16:57+08:00",
"fxLink": "https://www.qweather.com/weather/beijing-101010100.html",
"daily": [
{
"fxDate": "2020-06-14",
"sunrise": "04:45",
"sunset": "19:44",
"moonrise": "01:05",
"moonset": "12:53",
"tempMax": "35",
"tempMin": "22",
"iconDay": "100",
"textDay": "晴",
"iconNight": "150",
"textNight": "晴",
"wind360Day": "358",
"windDirDay": "北风",
"windScaleDay": "1-2",
"windSpeedDay": "8",
"wind360Night": "234",
"windDirNight": "西南风",
"windScaleNight": "1-2",
"windSpeedNight": "6",
"humidity": "22",
"precip": "0.0",
"pressure": "1001",
"vis": "25",
"uvIndex": "11"
},
{
"fxDate": "2020-06-15",
"sunrise": "04:45",
"sunset": "19:45",
"moonrise": "01:29",
"moonset": "13:51",
"tempMax": "36",
"tempMin": "22",
"iconDay": "100",
"textDay": "晴",
"iconNight": "150",
"textNight": "晴",
"wind360Day": "6",
"windDirDay": "北风",
"windScaleDay": "1-2",
"windSpeedDay": "2",
"wind360Night": "220",
"windDirNight": "西南风",
"windScaleNight": "1-2",
"windSpeedNight": "5",
"humidity": "30",
"precip": "0.0",
"pressure": "999",
"vis": "25",
"uvIndex": "11"
},
{
"fxDate": "2020-06-16",
"sunrise": "04:45",
"sunset": "19:45",
"moonrise": "01:52",
"moonset": "14:49",
"tempMax": "35",
"tempMin": "24",
"iconDay": "100",
"textDay": "晴",
"iconNight": "150",
"textNight": "晴",
"wind360Day": "235",
"windDirDay": "西南风",
"windScaleDay": "3-4",
"windSpeedDay": "18",
"wind360Night": "206",
"windDirNight": "西南风",
"windScaleNight": "1-2",
"windSpeedNight": "5",
"humidity": "30",
"precip": "0.0",
"pressure": "994",
"vis": "25",
"uvIndex": "11"
}
],
"refer": {
"sources": [
"Weather China"
],
"license": [
"commercial license"
]
}
}
景点7天预报
// 北京玉渊潭公园7天天气预报
// 商业版 https://api.qweather.com/v7/weather/7d?location=101010100&key=xxx
// 开发版 https://devapi.qweather.com/v7/weather/7d?location=101010100&key=xxx
// 请将示例请求URL中的KEY更换成你自己的KEY
{
"code": "200",
"updateTime": "2020-06-14T16:57+08:00",
"fxLink": "https://www.qweather.com/weather/beijing-101010100.html",
"daily": [
{
"fxDate": "2020-06-14",
"sunrise": "04:45",
"sunset": "19:44",
"moonrise": "01:05",
"moonset": "12:53",
"tempMax": "35",
"tempMin": "22",
"iconDay": "100",
"textDay": "晴",
"iconNight": "150",
"textNight": "晴",
"wind360Day": "358",
"windDirDay": "北风",
"windScaleDay": "1-2",
"windSpeedDay": "8",
"wind360Night": "234",
"windDirNight": "西南风",
"windScaleNight": "1-2",
"windSpeedNight": "6",
"humidity": "22",
"precip": "0.0",
"pressure": "1001",
"vis": "25",
"uvIndex": "11"
},
{
"fxDate": "2020-06-15",
"sunrise": "04:45",
"sunset": "19:45",
"moonrise": "01:29",
"moonset": "13:51",
"tempMax": "36",
"tempMin": "22",
"iconDay": "100",
"textDay": "晴",
"iconNight": "150",
"textNight": "晴",
"wind360Day": "6",
"windDirDay": "北风",
"windScaleDay": "1-2",
"windSpeedDay": "2",
"wind360Night": "220",
"windDirNight": "西南风",
"windScaleNight": "1-2",
"windSpeedNight": "5",
"humidity": "30",
"precip": "0.0",
"pressure": "999",
"vis": "25",
"uvIndex": "11"
},
{
"fxDate": "2020-06-16",
"sunrise": "04:45",
"sunset": "19:45",
"moonrise": "01:52",
"moonset": "14:49",
"tempMax": "35",
"tempMin": "24",
"iconDay": "100",
"textDay": "晴",
"iconNight": "150",
"textNight": "晴",
"wind360Day": "235",
"windDirDay": "西南风",
"windScaleDay": "3-4",
"windSpeedDay": "18",
"wind360Night": "206",
"windDirNight": "西南风",
"windScaleNight": "1-2",
"windSpeedNight": "5",
"humidity": "30",
"precip": "0.0",
"pressure": "994",
"vis": "25",
"uvIndex": "11"
}
],
"refer": {
"sources": [
"Weather China"
],
"license": [
"commercial license"
]
}
}