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
Request
http
GET https://singer.caiyunhub.com/v3/astro/sunQuery Parameters
| Name | Required | Default | Range | Description |
|---|---|---|---|---|
token | Yes | — | — | API token; see Authentication |
longitude | No | 0.0 | — | Longitude |
latitude | No | 0.0 | — | Latitude |
dailystart | No | 0 | -1, 0 | Day offset; -1 starts from yesterday |
days | No | 3 | 1~15 | Number of days |
Request Example
bash
curl "https://singer.caiyunhub.com/v3/astro/sun?longitude=116&latitude=39&dailystart=-1&days=3&token={token}"Response Example
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"
}
// ...
]
}Response Fields
| JSONPath | Type | Description |
|---|---|---|
$.data[].date | string | Date |
$.data[].rise | string | Sunrise time, - if not applicable |
$.data[].set | string | Sunset time, - if not applicable |
$.data[].astronomical_dawn_start | string | Astronomical dawn start, - if not applicable |
$.data[].astronomical_dusk_end | string | Astronomical dusk end, - if not applicable |
$.data[].civil_dawn_start | string | Civil dawn start, - if not applicable |
$.data[].civil_dusk_end | string | Civil dusk end, - if not applicable |
$.data[].nautical_dawn_start | string | Nautical dawn start, - if not applicable |
$.data[].nautical_dusk_end | string | Nautical dusk end, - if not applicable |
$.data[].solar_midnight | string | Solar midnight, - if not applicable |
$.data[].solar_noon | string | Solar noon, - if not applicable |
Sun Altitude/Azimuth
Provides hourly sun altitude and azimuth data.
Request
http
GET https://singer.caiyunhub.com/v3/astro/sun/location/Query Parameters
| Name | Required | Default | Range | Description |
|---|---|---|---|---|
token | Yes | — | — | API token; see Authentication |
longitude | No | 0.0 | — | Longitude |
latitude | No | 0.0 | — | Latitude |
days | No | 1 | 1~2 | Number of days |
Request Example
bash
curl "https://singer.caiyunhub.com/v3/astro/sun/location/?longitude=116&latitude=39&days=2&token={token}"Response Example
json
{
"data": [
{ "timestamp": 1671638400, "altitude": -74.1515, "azimuth": 348.0473 },
// ...
{ "timestamp": 1671721200, "altitude": -67.8016, "azimuth": 309.0398 }
]
}Response Fields
| JSONPath | Type | Description |
|---|---|---|
$.data[].timestamp | number | Timestamp |
$.data[].altitude | number | Altitude angle |
$.data[].azimuth | number | Azimuth angle |