Solar Elevation Angle

Platform: API iOS Android

Get global solar elevation angle and azimuth.

Interface code (Enum) Interface Class
INQUIRE_TYPE_ASTRONOMY_SUN_ANGLE Solar elevation angle data SunAngleBaseModel

Request Parameters

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

  • location(required)The comma-separated longitude and latitude (decimal, up to 2 decimal places) of the location to be queried. For example: location=116.41,39.92
  • date(required)Set date, format is yyyyMMdd, e.g., date=20200531
  • time(required)Set time, format is HHmm, 24-hour, e.g., time=1230
  • tz(required)Location time zone, e.g., tz=0800 or tz=-0530
  • alt(required)Location altitude, in meters, e.g., alt=43
  • appKey(required)API authentication key, please refer to How To Get Your Key. For example: appKey=12334567890ABC

Sample Code

QWeatherConfigInstance.publicID = @"publicID";
QWeatherConfigInstance.appKey = @"key";
QWeatherConfigInstance.appType = APP_TYPE_BIZ;    
QWeatherConfigInstance.location = @"116.41,39.92";
QWeatherConfigInstance.date = @"20210518";
QWeatherConfigInstance.time = @"1230";
QWeatherConfigInstance.tz = @"0800";
QWeatherConfigInstance.alt = @"43";
[QWeatherConfigInstance weatherWithInquireType:INQUIRE_TYPE_ASTRONOMY_SUN_ANGLE WithSuccess:^(SunAngleBaseModel  *responseObject) {
        
    NSLog(@"描述->%@",[responseObject description]);
    
} faileureForError:^(NSError *error) {
    NSLog(@"error->%@",error);
    
}];

Response

  • code See Status Code
  • solarElevationAngle Solar Elevation Angle in degree
  • solarAzimuthAngle Solar azimuth angle
  • solarHour Solar time, HHmm format
  • hourAngle Hour Angle
  • refer.sources Data source and other statements, may be null
  • refer.license Data license, may be null