POST · TRANSIT VEDIC

Moon Phases

Endpoint POST https://starsapi.com/api/v3/transit/vedic/moon-phases

Returns sidereal lunar phases — new moon, full moon, quarters, and intermediate phases. Each phase carries the exact UTC and local datetime, the Moon and Sun’s sidereal sign, nakshatra, pada, and nakshatra lord. Phases are annotated with status (past, current, upcoming) and days_from_now.

Query types

Six query types are supported. The first five follow the standard calendar pattern:

query_typeDescription
currentNext upcoming phase from today.
datePhases on a specific date.
rangePhases within a date range.
monthAll phases in a calendar month.
yearAll phases in a calendar year.
cyclesFull lunation cycles (new moon → new moon). Returns count complete cycles (default 1, max 24) starting from the current lunation.

Request body

FieldTypeRequiredDescription
query_typestringNoDefault current.
timezonestringNoIANA timezone. Default UTC.
datestring*Required for date.
from_date, to_datestring*Required for range.
month, yearinteger*Required for month/year.
countintegerNoNumber of lunation cycles for cycles query. Default 1, max 24.
phase_filterstringNoShow only this phase: new_moon, full_moon, first_quarter, last_quarter, waxing_crescent, waxing_gibbous, waning_gibbous, waning_crescent. Cannot be used with cycles.
group_by_cyclebooleanNoWrap phases into lunation cycle groups on any query type. Default false (always true for cycles).

Response shape

Phase fields

FieldTypeDescription
phasestringDisplay name (e.g. New Moon, Full Moon).
phase_keystringMachine key (e.g. new_moon, full_moon).
datetime_utcstringExact phase time in UTC.
datetime_localstringConverted to requested timezone.
moon_signstringSidereal sign of the Moon at the phase.
sun_signstringSidereal sign of the Sun.
moon_nakshatrastringMoon’s nakshatra.
moon_padaintegerMoon’s nakshatra pada.
moon_nakshatra_lordstringVimshottari lord.
statusstringpast, current (today), or upcoming.
days_from_nownumberSigned days from now (negative = past).

Cycle fields (when grouped)

When group_by_cycle is true or query_type is cycles:

FieldTypeDescription
cycle_numberintegerSequential cycle index.
partialbooleantrue if this cycle didn’t start with a new moon in the result set.
new_moonstring|nullUTC datetime of the cycle’s new moon.
full_moonstring|nullUTC datetime of the cycle’s full moon.
duration_daysnumber|nullSpan of the cycle in days.
phase_countintegerNumber of phases in this cycle.
phasesarrayPhase objects (same shape as above).

Use cases

  • Panchang calendar — display Purnima, Amavasya, and tithi-related events.
  • Lunar phase widget — show current moon phase with nakshatra.
  • Fasting/vrat alerts — use phase_filter: full_moon for Purnima vrat dates.
  • Lunation cycle tracker — visualize complete lunar cycles with the cycles query.

Errors

HTTPCodeCause
400INVALID_PHASE_FILTERUnrecognised phase_filter value.
400INVALID_COMBINATIONphase_filter used with query_type: cycles.

Plus standard calendar endpoint errors.

See also