Real-time Weather

Platform: API iOS Android

Get real-time weather data for 200,000+ cities around the world, including temperature, wind, humidity, pressure, precipitation, visibility, etc.

Interface code (Enum) Interface Class
INQUIRE_TYPE_WEATHER_NOW Real-time weather WeatherBaseClass

Request Parameters

If no optional parameters are set, the default value will be used.

  • 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=101010100 or location=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 are unit=m for metric(default) and unit=i for imperial. See more about Unit.

Sample Code

QWeatherConfigInstance.publicID = @"publicID";
QWeatherConfigInstance.appKey = @"key";
QWeatherConfigInstance.appType = APP_TYPE_BIZ;
QWeatherConfigInstance.location = @"101010100";
QWeatherConfigInstance.lang = @"";
QWeatherConfigInstance.unit = @"";
[QWeatherConfigInstance weatherWithInquireType:INQUIRE_TYPE_WEATHER_NOW WithSuccess:^(WeatherBaseClass *responseObject) {
        
    NSLog(@"Description->%@",[responseObject description]);
        
} faileureForError:^(NSError *error) {
    NSLog(@"error->%@",error);
        
}];

Response

  • code See Status Code
  • updateTime API last update time
  • fxLink Responsive web page of this data, for embedded in website or APP
  • now.obsTime Observation time
  • now.temp temperature
  • now.feelsLike Feels like temperature
  • now.icon Icon code for weather conditions. See also QWeather Icons
  • now.text Weather conditions
  • now.wind360 Wind direction in azimuth degree
  • now.windDir Wind direction
  • now.windScale Wind scale
  • now.windSpeed Wind speed, KM/H
  • now.humidity Relative humidity in percent
  • now.precip Accumulated precipitation in the last hour
  • now.pressure Atmospheric pressure, hPa
  • now.vis Visibility, KM
  • now.cloud Cloud cover in percent, may be null
  • now.dew Dew point temperature, may be null
  • refer.sources Data source and other statements, may be null
  • refer.license Data license, may be null