Weather Warning

Platform: API iOS Android

Get officially issued real-time severe weather warning data around the world.

For more warning information, see Warning Info.

Interface Code Interface Class
getWarning Weather Warning WarningBean


  • location(required)The city to be queried, support LocationID or comma-separated longitude and latitude (decimal, up to 2 decimal places), LocationID can be obtained by GeoAPI.
  • langMulti-language settings, only support Chinese and English for this data. The available value are lang=zh and lang=en

Sample Code

QWeather.getWarning(Context context, String location, final QWeather.OnResultWarningListener listener);

QWeather.getWarning(Context context, String location, Lang lang, final QWeather.OnResultWarningListener listener);


Properties of WarningBean

Property Description Example
getCode Status code, please refer to Status Code Code
getBeanBaseList Disaster Warning List<WarningBeanBase>
getRefer Reference data, includes data source, statements and license Refer
getBasic Basic Information Basic


Property Description Example
getSourcesList Data source and other statements
getLicenseList Data license commercial license


Property Description Example
getUpdateTime Last updated time 2017-10-25T04:34+08:00
getFxLink Responsive web page of this location, easy to embed in your website or APP

WarningBeanBase Warning Information

Property Description Example
getId The unique identifier of this warning, which can be used to determine whether this warning already exists.  
getPubTime Warning release time 2017-10-25T12:03+08:00
getTitle Title of warning information Shenzhen Meteorological Observatory of Guangdong Province issues yellow lightning warning
getSender Sender of warning information Shenzhen Meteorological Observatory
getStartTime Warning start time, may be null 2017-10-25T12:03+08:00
getEndTime End time of warning, may be null 2017-10-25T12:03+08:00
getStatus Warning status, may be null
active Early warning or first warning
update Warning information update
cancel cancel warning
getLevel Warning level yellow
getType Warning type 11B12
getTypeName Warning type name Raiden
getText Detailed description of the warning Shenzhen Meteorological Bureau distributed a yellow warning signal for mine-laying electricity at 12:59 on October 04. Please pay attention to defense.
getRelated Related warning id related warning id of current warning, may be null

Warning Level and Type

See Warning Level and Type