Grid Weather Daily Forecast
Weather forecast data based on numerical models, to provide daily weather forecasts at specified coordinates around the world, with a spatial resolution of 3-5 kilometers.
Hint: The grid weather data is based on Numerical Weather Prediction (NWP) models, and it is not suitable for comparison with observation station data. For station-based city weather data, please refer to the City Weather API. Grid weather uses UTC+0 as the time zone.
| Interface code | Interface | Class |
|---|---|---|
| grid3d | 3 Days Forecast by Grid | GridDailyResponse |
| grid7d | 7 Days Forecast by Grid | GridDailyResponse |
Parameters
GridWeatherParameter
| Name | Type | Required | Exemple |
|---|---|---|---|
| longitude | Double | true | 116.41 |
| latitude | Double | true | 39.92 |
| lang | Lang | false | ZH_HANS |
| unit | Unit | false | METRIC |
Sample code
Swift
Task{
do {
let parameter = GridWeatherParameter(longitude: 116.41, latitude: 39.92)
/*
* 3 Days Forecast by Grid
*/
let _ = try await QWeather.instance
.grid3d(parameter)
/*
* 7 Days Forecast by Grid
*/
let _ = try await QWeather.instance
.grid7d(parameter)
} catch QWeatherError.errorResponse(let error) {
print(error)
} catch {
print(error)
}
}
Objective-C
GridWeatherParameter *parameter = [GridWeatherParameter instanceWithLongitude:116.41 latitude:39.92 lang:@(LangZH_HANS) unit:@(UnitMETRIC)];
void (^handler)(GridDailyResponse *, NSError *) = ^(GridDailyResponse *response,
NSError *error) {
if (response) {
NSLog(@"%@", response.description);
}
if (error) {
NSLog(@"%@", error.localizedDescription);
}
};
/*
* 3 Days Forecast by Grid
*/
[QWeatherObjc grid3d:parameter completionHandler:handler];
/*
* 7 Days Forecast by Grid
*/
[QWeatherObjc grid7d:parameter completionHandler:handler];
Response
GridDailyResponse
-
codeSee Status Code -
updateTimeAPI last update time -
fxLinkResponsive web page of this data, for embedded in website or APP -
daily.fxDateForecast date -
daily.tempMaxThe highest temperature of the day -
daily.tempMinThe lowest temperature of the day -
daily.iconDayIcon code for daytime weather conditions. See also QWeather Icons -
daily.textDayWeather conditions for daytime -
daily.iconNightIcon code for night weather conditions. See also QWeather Icons -
daily.textNightWeather conditions for night -
daily.wind360DayDaytime wind direction in azimuth degree -
daily.windDirDayDaytime wind direction -
daily.windScaleDayDaytime wind scale -
daily.windSpeedDayDaytime wind speed, KM/H -
daily.wind360NightNightly wind direction in azimuth degree -
daily.windDirNightNightly wind direction -
daily.windScaleNightNightly wind scale -
daily.windSpeedNightNightly wind speed, KM/H -
daily.precipEstimated total precipitation for the day -
daily.humidityRelative humidity in percent -
daily.pressureAtmospheric pressure, hPa -
refer.sourcesData source and other statements, may be null -
refer.licenseData license, may be null