Sun Times
Required roles:
AIS PIB API— Roles
Base endpoint:https://ais-pib-api.ibosoft.net.tr:2087/sun-times
Reference documents: none
Attribution: showibonav.aerowherever this data is displayed
Data sources: none — calculated.
Last updated: 17 OCT 2026
Sunrise and sunset, and the start and end of civil, nautical and astronomical twilight, for a position (and optional elevation) on a UTC date. Calculated on request.
The calculation uses simplified astronomical formulas with an accuracy of about one minute: suitable for flight planning and display, not for uses that need ephemeris precision. It is the same calculation as the night and twilight overlay of the ibonav.aero map, so the two agree.
Endpoints
| Endpoint | Description |
|---|---|
GET /sun-times/calculate |
Sun times for a position and date |
Parameters
| Parameter | Required | Description |
|---|---|---|
lat |
yes | Latitude in decimal degrees (−90…90) |
lon |
yes | Longitude in decimal degrees (−180…180) |
altitude |
no | Observer elevation above mean sea level (default 0). Raises the horizon dip correction; negative values count as 0 |
altitude_unit |
no | m (default) or ft |
datetime |
no | UTC ISO 8601 (2026-06-29T10:00:00Z) or Unix time (seconds). Default: the current server time (see Server Time) |
time_format |
no | Format of all times in the response: iso8601 (default) or epoch (Unix seconds, integer) |
Response
GET /sun-times/calculate?lat=40.982&lon=28.821&altitude=33&datetime=2026-06-29T10:00:00Z
{
"request": {
"lat": 40.982, "lon": 28.821,
"altitude": 33, "altitude_unit": "m", "altitude_m": 33.0,
"datetime_input": "2026-06-29T10:00:00Z",
"datetime_utc": "2026-06-29T10:00:00+00:00"
},
"results": {
"sunrise": "2026-06-29T02:45:12+00:00",
"sunset": "2026-06-29T17:58:03+00:00",
"sunrise_plus_30min": "2026-06-29T03:15:12+00:00",
"sunset_minus_30min": "2026-06-29T17:28:03+00:00",
"civil_twilight_start": "2026-06-29T02:15:40+00:00",
"civil_twilight_end": "2026-06-29T18:27:35+00:00",
"nautical_twilight_start": "2026-06-29T01:38:02+00:00",
"nautical_twilight_end": "2026-06-29T19:05:13+00:00",
"astronomical_twilight_start": "2026-06-29T00:52:47+00:00",
"astronomical_twilight_end": "2026-06-29T19:50:28+00:00"
}
}
| Field | Description |
|---|---|
request.datetime_input |
The datetime parameter as given; null if not given |
request.datetime_utc |
The UTC time used |
request.altitude_m |
The elevation used, in metres (altitude is echoed unchanged) |
sunrise, sunset |
Centre of the sun at −0.833° (on the horizon, with refraction) |
sunrise_plus_30min, sunset_minus_30min |
Sunrise + 30 minutes, sunset − 30 minutes |
civil_twilight_start / _end |
Sun at −6°, before sunrise / after sunset |
nautical_twilight_start / _end |
Sun at −12° |
astronomical_twilight_start / _end |
Sun at −18° |
When the sun does not reach a given angle that day (polar day or night), the fields for that angle, and the fields derived from them, are null.
Errors
| Code | Meaning |
|---|---|
422 |
Invalid datetime, altitude_unit or time_format, or lat/lon out of range |