Sun and Moon

Get the latest 60-day global city sunrise/sunset, moon rise/moon set, and hourly moon phase data.

Interface code (Enum) Interface Class
INQUIRE_TYPE_SUNMOON Sun and Moon SunMoonBaseModel

Request Parameters #

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


The city to be queried, support LocationID or comma-separated longitude and latitude, LocationID can be obtained by GeoAPI.


Set the date, up to 60 days in the future (including today). The date format is yyyyMMdd

For example: date=20200531


API authentication key, please refer to How To Get Your Key.

For example: appKey=12334567890ABC


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 #

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

Response #

Parameters Description Example values ​​
code Status code, please refer to Status Code 200
updateTime Last updated time 2013-12-30T01:45+08:00
fxLink Responsive web page of this data, for embedded in website or APP
sunrise Sunrise time 2013-12-30T05:44+08:00
sunset Sunset time 2013-12-30T17:02+08:00
moonrise Moonrise time 2013-12-30T13:19+08:00
moonset Moonset time 2013-12-31T23:31+08:00
moonPhase.fxTime Moon phase hourly forecast time 2013-12-31T23:31+08:00
moonPhase.value Moon phase value 0.25 Moon phase Name First Quarter Moon
moonPhase.illumination Moon illuminance, percentage value 30
refer.sources Data source and other statements, may be null  
refer.license Data License