Sun
Access Restriction
This API is a premium service available only to enterprise tier developers. Please contact Caiyun Sales to purchase.
Provides sunrise/sunset times and hourly altitude/azimuth data.
Sunrise/Sunset
bash
curl "https://singer.caiyunhub.com/v3/astro/sun?longitude=116&latitude=39&dailystart=-1&days=3&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 | ✅ | 3 | Number of days, support range [1, 15] |
Response:
json
{
"data": [
{
"date": "2026-01-27",
"rise": "07:21",
"set": "17:26",
"astronomical_dawn_start": "05:30",
"astronomical_dusk_end": "19:17",
"civil_dawn_start": "06:52",
"civil_dusk_end": "17:55",
"nautical_dawn_start": "06:12",
"nautical_dusk_end": "18:35",
"solar_midnight": "00:23",
"solar_noon": "12:23"
}
// ...
]
}| Field | Type | Description |
|---|---|---|
| date | string | Date |
| rise | string | Sunrise time, - if not applicable |
| set | string | Sunset time, - if not applicable |
| astronomical_dawn_start | string | Astronomical dawn start, - if not applicable |
| astronomical_dusk_end | string | Astronomical dusk end, - if not applicable |
| civil_dawn_start | string | Civil dawn start, - if not applicable |
| civil_dusk_end | string | Civil dusk end, - if not applicable |
| nautical_dawn_start | string | Nautical dawn start, - if not applicable |
| nautical_dusk_end | string | Nautical dusk end, - if not applicable |
| solar_midnight | string | Solar midnight, - if not applicable |
| solar_noon | string | Solar noon, - if not applicable |
Sun Altitude/Azimuth
Provides hourly sun altitude and azimuth data.
bash
curl "https://singer.caiyunhub.com/v3/astro/sun/location/?longitude=116&latitude=39&days=2&token={token}"Query Parameters:
| Parameter | Type | Optional | Default | Description |
|---|---|---|---|---|
longitude | float | ✅ | 0.0 | Longitude |
latitude | float | ✅ | 0.0 | Latitude |
days | int | ✅ | 1 | Number of days, support range [1, 2] |
Response:
json
{
"data": [
{ "timestamp": 1671638400, "altitude": -74.1515, "azimuth": 348.0473 },
// ...
{ "timestamp": 1671721200, "altitude": -67.8016, "azimuth": 309.0398 }
]
}| Field | Type | Description |
|---|---|---|
| timestamp | int | Timestamp |
| altitude | float | Altitude angle |
| azimuth | float | Azimuth angle |