Weather Hourly Forecast
Get hourly weather forecasts for cities around the world for the next 24-168 hours.
| Interface code | Interface | Class |
|---|---|---|
| weather24h | 24-hours forecast | WeatherHourlyResponse |
| weather72h | 72-hours forecast | WeatherHourlyResponse |
| weather168h | 168-hours forecast | WeatherHourlyResponse |
Parameters
WeatherParameter
-
location(required)The location to be queried, support LocationID or comma-separated longitude and latitude (decimal, up to 2 decimal places), LocationID can be obtained by GeoAPI. Example:location=101010100orlocation=116.41,39.92 -
langMulti-language setting, please see Language to find out how our multi-language works and how to set up. -
unitSet weather data unit, the available value areunit=mfor metric(default) andunit=ifor imperial. See more about Unit.
Sample code
WeatherParameter parameter = new WeatherParameter("101010100");
/**
* 24 hours forecast
*/
public void weather24h(WeatherParameter parameter, Callback<WeatherHourlyResponse> callback);
/**
* 72 hours forecast
*/
public void weather72h(WeatherParameter parameter, Callback<WeatherHourlyResponse> callback);
/**
* 168 hours forecast
*/
public void weather168h(WeatherParameter parameter, Callback<WeatherHourlyResponse> callback);
Response
WeatherHourlyResponse
-
codeSee Status Code -
updateTimeAPI last update time -
fxLinkResponsive web page of this data, for embedded in website or APP -
hourly.fxTimeForecast time -
hourly.temptemperature -
hourly.iconIcon code for weather conditions. See also QWeather Icons -
hourly.textWeather conditions -
hourly.wind360Wind direction in azimuth degree -
hourly.windDirWind direction -
hourly.windScaleWind scale -
hourly.windSpeedWind speed, KM/H -
hourly.humidityRelative humidity in percent -
hourly.precipAccumulated precipitation in the current hour -
hourly.popPrecipitation probability in percent, may be null -
hourly.pressureAtmospheric pressure, hPa -
hourly.cloudCloud cover in percent, may be null -
hourly.dewDew point temperature, may be null -
refer.sourcesData source and other statements, may be null -
refer.licenseData license, may be null