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
bash
curl "https://singer.caiyunhub.com/v3/astro/moon?longitude=-74&latitude=40.7&lang=en&days=15&token={token}"Query Parameters:
| Parameter | Type | Optional | Default Value | Description |
|---|---|---|---|---|
longitude | float | ✅ | 0.0 | Longitude |
latitude | float | ✅ | 0.0 | Latitude |
lang | enum | ✅ | zh-Hans | Language parameter, see Multilingual Support for details |
days | int | ✅ | 3 | Number of days, support range [1, 15] |
Response:
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"
}
]
}| Field | Type | Description |
|---|---|---|
| date | string | Date |
| rise | string | Rise time, - if not applicable |
| set | string | Set time, - if not applicable |
| phase | float | |
| phase_name | enum | Name of the moon phase |
Supported moon phase values in English environment:
| Emoji | Phase |
|---|---|
| 🌑 | 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.
bash
curl "https://singer.caiyunhub.com/v3/astro/moon/location?longitude=116&latitude=39&dailystart=-1&days=2&token={token}"Query Parameters:
| Parameter | Type | Optional | Default | Description |
|---|---|---|---|---|
longitude | float | ✅ | 0.0 | Longitude |
latitude | float | ✅ | 0.0 | Latitude |
dailystart | int | ✅ | 0 | Day offset, only supports -1 (start from yesterday) |
days | int | ✅ | 1 | Number of days, support range [1, 2] |
Response:
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 }
]
}| Field | Type | Description |
|---|---|---|
| timestamp | int | Timestamp |
| altitude | float | Altitude angle |
| azimuth | float | Azimuth angle |