Sun and Moon

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

Interface Code Interface Class
getSunMoon Sun and Moon Data SunMoonBean

Parameter #

location

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

date

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

For example: date=20200531

lang

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 #

QWeather.getSunMoon(Context context, String location, String date, final OnResultSunMoonListener listener);

QWeather.getSunMoon(Context context, String location, Lang lang, String date, final OnResultSunMoonListener listener)

Properties #

Properties of SunMoonBean

Property Description Example
getCode Status code, please refer to Status Code 200
getRefer Reference data, includes data source, statements and license Refer
getSunMoonBean Sunrise/sunset and moon rise/moon set SunMoonBeanBase
getMoonPhaseBeanList Moon Phase List<MoonPhaseBean>

Refer

Property Description Example
getSourcesList Data source and other statements Weather China
getLicenseList Data license commercial license

Basic

Property Description Example
getUpdateTime Last updated time 2017-10-25 04:34
getFxLink Responsive web page of this location, easy to embed in your website or APP http://hfx.link/ae45

SunMoonBeanBase

Property Description Example
getSunrise Sunrise time 2013-12-30T05:44+08:00
getSunset Sunset time 2013-12-30T17:02+08:00
getMoonRise Moonrise time 2013-12-30T13:19+08:00
getMoonSet Moonset time 2013-12-31T23:31+08:00

MoonPhaseBean

Property Description Example
getFxTime Moon phase hourly forecast time 2013-12-31T23:31+08:00
getValue Moon phase value 0.25
getName Moon phase name First quarter moon
getIllumination Moon illuminance, percentage value 30