Historical
For Android SDK v4.9Get the last 10 days of weather and air quality data.
If you need a longer period of historical city data or grid historical data, please please contact us.
Historical Weather
Interface Code | Interface | Class |
---|---|---|
getWeatherHistorical | Historical weather data | HistoryWeatherBean |
Parameter
location
The location to be queried, only support LocationID and LocationID can be obtained by GeoAPI.
For example: location=101010100
date
Set the date, up to the most recent 10 days. The date format is yyyyMMdd.
For example: date=20200531
lang
Multi-language, default Chinese, if data does not match the language you set, it will return in English or its native language. Language parameter please refer to Language
unit
Set weather data unit, default Metric, unit parameters please refer Unit
Sample Code
QWeather.getHistoricalWeather(Context context, String location, String date, QWeather.OnResultWeatherHistoricalBeanListener listener);
QWeather.getHistoricalWeather(Context context, String location, String date, Lang lang, Unit unit,QWeather.OnResultWeatherHistoricalBeanListener listener)
Properties
Properties of HistoryWeatherBean
Property | Description | Example |
---|---|---|
getCode | Status code, please refer to Status Code | Code |
getDailyBean | Overview of the daily forecast | DailyBean |
getHourlyBeans | Hourly data of the day | List<HourlyBean> |
getRefer | Reference data, includes data source, statements and license | Refer |
getBasic | Basic Information | Basic |
Refer
Property | Description | Example |
---|---|---|
getSourcesList | Data source and other statements | qweather.com |
getLicenseList | Data license | commercial license |
Basic
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 | http://hfx.link/ae45 |
DailyBean
Property | Description | Example |
---|---|---|
getDate | Forecast date | 2013-12-30 |
getSunrise | Sunrise time | 07:36 |
getSunset | Sunset time | 16:58 |
getMoonRise | Moonrise time | 04:47 |
getMoonSet | Moonset time | 14:59 |
getMoonPhase | Moon Phase | Full Moon |
getTempMax | The highest temperature of the day | 4 |
getTempMin | The lowest temperature of the day | -5 |
getHumidity | Relative humidity, in percent | 37 |
getPrecip | Precipitation | 0 |
getPressure | Atmospheric pressure | 1018 |
HourlyBean
Property | Description | Example |
---|---|---|
getTime | Historical weather time of the day | 2013-12-30T13:00+08:00 |
getTemp | Temperature | 2 |
getIcon | Icon code of weather conditions, free to download weather icons | 101 |
getText | Weather conditions | Cloudy |
getWind360 | Wind direction in azimuth degree | 290 |
getWindDir | Wind direction | NW |
getWindScale | Wind scale | 3-4 |
getWindSpeed | Wind Speed | 15 |
getHumidity | Relative humidity in percent | 30 |
getPressure | Atmospheric pressure | 1030 |
getPrecip | Precipitation | 1.2 |
Historical Air Quality
Interface Code | Interface | Class |
---|---|---|
getHistoricalAir | Historical air quality data | HistoricalAirBean |
Parameter
location
The location to be queried, only support LocationID and LocationID can be obtained by GeoAPI.
For example: location=101010100
date
Set the date, up to the most recent 10 days. The date format is yyyyMMdd.
For example: date=20200531
lang
Multi-language, default Chinese, if data does not match the language you set, it will return in English or its native language. Language parameter please refer to Language
Sample Code
QWeather.getHistoricalAir(Context context, String location, String date, Q
Weather.OnResultAirHistoricalBeanListener listener);
QWeather.getHistoricalAir(Context context, String location, String date, Lang lang, Unit unit,QWeather.OnResultAirHistoricalBeanListener listener)
Properties
Properties of HistoricalAirBean
Property | Description | Example |
---|---|---|
getCode | Status code, please refer to Status Code | Code |
getRefer | Reference data, includes data source, statements and license | Refer |
getBasic | Basic Information | Basic |
getAirHourlyBeans | Hourly air quality data for the day | List<AirHourlyBean> |
Refer
Property | Description | Example |
---|---|---|
getSourcesList | Data source and other statements | qweather.com |
getLicenseList | Data license | commercial license |
Basic
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 | http://hfx.link/ae45 |
AirHourlyBean historical day by hour air quality data
Property | Description | Example |
---|---|---|
getPubTime | The data release time from the data source. | 2017-03-20T12:30+08:00 |
getAqi | Air quality index | 74 |
getPrimary | The main pollutants per hour of the day. When the air quality category is excellent , return NA |
pm25 |
getLevel | Air quality index level | 2 |
getCategory | Air quality index category | Good |
getPm10 | PM10 | 78 |
getPm2p5 | PM25 | 66 |
getNo2 | Nitrogen dioxide | 40 |
getSo2 | Sulfur dioxide | 30 |
getCo | Carbon monoxide | 0.3 |
getO3 | Ozone | 20 |