天气预警城市列表
获取指定国家或地区当前正在发生预警的城市列表。你可以通过这个列表快速的了解到当前国家或地区都有哪些地方正在发生天气预警。
根据这些城市列表再查询详细的预警数据。
提示:关于更多天气预警数据的说明,请参考预警信息
请求URL
https://api.qweather.com/v7/warning/list?[请求参数]
如果是免费订阅,将上述API Host更改为devapi.qweather.com
。参考免费订阅可用的数据。
请求参数
请求参数包括必选和可选参数,参数之间使用&
进行分隔。
请求示例
中国灾害预警城市列表
curl -L -X GET --compressed 'https://api.qweather.com/v7/warning/list?range=cn&key=YOUR_KEY'
返回数据
返回数据是JSON格式并进行了Gzip压缩,数据类型均为字符串。
{
"code": "200",
"updateTime": "2020-06-21T05:39+00:00",
"warningLocList": [
{
"locationId": "101010800"
},
{
"locationId": "101011200"
},
{
"locationId": "101011400"
},
{
"locationId": "101020700"
},
{
"locationId": "101040400"
},
{
"locationId": "101041900"
},
{
"locationId": "101043400"
},
{
"locationId": "101043600"
},
{
"locationId": "101050106"
},
{
"locationId": "101050107"
},
{
"locationId": "101050301"
},
{
"locationId": "101050302"
},
{
"locationId": "101050303"
},
{
"locationId": "101130103"
},
{
"locationId": "101130109"
},
{
"locationId": "101130114"
},
{
"locationId": "101130302"
},
{
"locationId": "101130303"
},
{
"locationId": "101130409"
},
{
"locationId": "101130610"
},
{
"locationId": "101130611"
},
{
"locationId": "101130613"
},
{
"locationId": "101130614"
},
{
"locationId": "101131920"
},
{
"locationId": "101221008"
},
{
"locationId": "101230507"
},
{
"locationId": "101132101"
},
{
"locationId": "101132201"
},
{
"locationId": "101132301"
}
],
"refer": {
"sources": [
"12379",
"QWeather"
],
"license": [
"commercial license"
]
}
}
-
code
API状态码,具体含义请参考状态码 -
updateTime
当前API的最近更新时间 -
warningLocList.locationId
当前国家预警的LocationID -
refer.sources
原始数据来源,或数据源说明,可能为空 -
refer.license
数据许可或版权声明,可能为空