Skip to content

Moon

Access Restriction

This API is a premium service available only to enterprise tier developers. Please contact Caiyun Sales to purchase.

Provides moonrise time, moonset time, moon phase, and hourly altitude/azimuth data.

Moonrise/Moonset

Request

http
GET https://singer.caiyunhub.com/v3/astro/moon

Query Parameters

NameRequiredDefaultRangeDescription
tokenYesAPI token; see Authentication
longitudeNo0.0Longitude
latitudeNo0.0Latitude
langNozh-HansLanguage; see Language Support
daysNo31~15Number of days

Request Example

bash
curl "https://singer.caiyunhub.com/v3/astro/moon?longitude=-74&latitude=40.7&lang=en&days=15&token={token}"

Response Example

json
{
  "moon": [
    {
      "date": "2024-04-09",
      "rise": "06:53",
      "set": "20:54",
      "phase": 5.7,
      "phase_name": "New Moon"
    },
    // ...
    {
      "date": "2024-04-23",
      "rise": "19:48",
      "set": "05:42",
      "phase": 170.78,
      "phase_name": "Full Moon"
    }
  ]
}

Response Fields

JSONPathTypeDescription
$.moonarrayMoonrise, moonset, and phase data
$.moon[].datestringDate
$.moon[].risestringRise time, - if not applicable
$.moon[].setstringSet time, - if not applicable
$.moon[].phasenumberMoon phase angle
$.moon[].phase_namestringName of the moon phase

Supported moon phase values in English environment:

EmojiPhase
🌑New Moon
🌒Waxing crescent
🌓First quarter
🌔Waxing gibbous
🌕Full Moon
🌖Waning gibbous
🌗Last quarter
🌘Waning crescent

Moon Altitude/Azimuth

Provides hourly moon altitude and azimuth data.

Request

http
GET https://singer.caiyunhub.com/v3/astro/moon/location

Query Parameters

NameRequiredDefaultRangeDescription
tokenYesAPI token; see Authentication
longitudeNo0.0Longitude
latitudeNo0.0Latitude
dailystartNo0-1Day offset; -1 starts from yesterday
daysNo11~2Number of days

Request Example

bash
curl "https://singer.caiyunhub.com/v3/astro/moon/location?longitude=116&latitude=39&dailystart=-1&days=2&token={token}"

Response Example

json
{
  "data": [
    { "timestamp": 1769468400, "altitude": 21.5018, "azimuth": 268.0806 },
    { "timestamp": 1769472000, "altitude": 18.6872, "azimuth": 282.1501 },
    // ...
    { "timestamp": 1769637600, "altitude": 35.81, "azimuth": 225.1094 }
  ]
}

Response Fields

JSONPathTypeDescription
$.dataarrayHourly moon position data
$.data[].timestampnumberTimestamp
$.data[].altitudenumberAltitude angle
$.data[].azimuthnumberAzimuth angle