POST · VEDIC

Sun Times

Endpoint POST https://starsapi.com/api/v3/vedic/panchang/sun-times

Returns local sunrise and sunset for any date and location, with day and night durations. Sunrise here is the traditional panchang sunrise — the moment used as the start of the Hindu day and as the anchor for Rahu Kaal, choghadiya, and hora computations.

Authentication

MethodExample
Header (recommended)X-Api-Key: am_live_xxxxxxxxxxxx
BearerAuthorization: Bearer am_live_xxxxxxxxxxxx
Query?api_key=am_live_xxxxxxxxxxxx

Request body

FieldTypeRequiredDescription
yearintegerYesCalendar year.
monthintegerYesMonth, 1–12.
dayintegerYesDay of month.
latitudenumberYesDecimal degrees.
longitudenumberYesDecimal degrees.
timezonestringYesIANA timezone (e.g. Asia/Kolkata).
ayanamsastringNoDefault lahiri.

Response shape

FieldTypeDescription
sunrise / sunsetstringLocal time, HH:MM:SS.
day_duration / night_durationstringSunrise→sunset and sunset→next-sunrise spans.

Errors

HTTPCodeCause
400MISSING_FIELDRequired field absent.
400INVALID_DATEBad calendar date.
400INVALID_TIMEZONENon-IANA timezone.
400INVALID_COORDINATELat/lon out of range.
400INVALID_PARAMBad ayanamsa value.
405METHOD_NOT_ALLOWEDNon-POST request.

See also