Moon and Moon Phase

Platform: API iOS Android

Get moonrise and moonset and hourly moon phase data for the next 60 days at any location worldwide.

Interface code (Enum) Interface Class
INQUIRE_TYPE_ASTRONOMY_MOON Moonrise, moonset and moon phase data MoonBaseModel

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
  • date(required)Set the date, up to 60 days in the future (including today). The date format is yyyyMMdd. Example: date=20200531
  • appKey(required)API authentication key, please refer to How To Get Your Key. For example: appKey=12334567890ABC
  • langMulti-language setting, please see Language to find out how our multi-language works and how to set up.

Sample Code

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


  • code See Status Code
  • updateTime API last update time
  • fxLink Responsive web page of this data, for embedded in website or APP
  • moonrise Moonrise time of current day. Maybe null
  • moonset Moonset time of current day. Maybe null
  • moonPhase.fxTime Moon phase forecast time
  • moonPhase.value Moon phase value
  • Moon phase name
  • moonPhase.icon Icon code for moon phase. See also QWeather Icons
  • moonPhase.illumination Moon illuminance in percent
  • refer.sources Data source and other statements, may be null
  • refer.license Data license, may be null