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

Seven query types are supported. live describes the Moon at this instant (a continuously changing state); every other type returns phase events — discrete moments when the Moon hits an exact Sun–Moon angle.

query_typeDescription
liveReal-time Moon state right now — phase, illumination, sidereal sign and nakshatra — plus the next phase, next new moon and next full moon.
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).
ayanamsastringNolive only. Sidereal reference frame. Default lahiri. The phase-event modes always use Lahiri.
node_typestringNolive only. mean or true. Default mean.

query_type: live

Returns the Moon’s state at this exact instant rather than the next phase event. Shaped as { live, next_phase, next_new_moon, next_full_moon } instead of a phases array. The phase instant is zodiac-neutral, so the times match the western endpoint exactly — only the reported signs differ.

{ "query_type": "live", "timezone": "Asia/Kolkata" }
FieldTypeDescription
phase, phase_key, phase_emojistringWhich of the eight phases the Moon is in right now.
illumination_pctnumberPercent of the disc lit (0 at new moon, 100 at full).
phase_anglenumberMoon−Sun elongation, 0–360° (0 = new, 90 = first quarter, 180 = full, 270 = last quarter).
waxingbooleantrue while the Moon is growing (elongation < 180°).
moon, sunobjectSidereal { sign, degree_in_sign, longitude, nakshatra, pada, nakshatra_lord }.

next_phase is whichever phase event comes next; next_new_moon and next_full_moon are the next principal events specifically. Each is a normal phase object.

Response shape

Phase fields

FieldTypeDescription
phasestringDisplay name (e.g. New Moon, Full Moon).
phase_keystringMachine key (e.g. new_moon, full_moon).
phase_emojistringUnicode moon-phase emoji.
datetime_utcstringExact phase time in UTC.
datetime_localstringConverted to requested timezone (already localised — do not append a tz label).
illumination_pctnumberPercent of the disc lit (0–100).
moonobjectSidereal { sign, degree_in_sign, longitude, nakshatra, pada, nakshatra_lord }. degree_in_sign is D:M:S.
sunobjectSidereal { sign, degree_in_sign, longitude }.
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 from the first to the last marked phase (≈26d). Not the lunation length — see below.
phase_countintegerNumber of phases in this cycle (normally 8).
lunation_start, lunation_endstring|nullUTC bounds of the true lunation: this new moon → the next new moon.
lunation_daysnumber|nullTrue lunation length (≈29.5d).
statusstringpast, current, or upcoming.
lunation_dayinteger|nullWhich day of the lunation today is. Set only when status: current.
next_new_moonstring|nullUTC instant that closes this lunation.
days_to_next_newnumber|nullDays until that next new moon.
status_labelstring|nullReady-to-render string — e.g. Day 27 of 29 · next new moon in 2d, Begins in 2d, Complete. Display this rather than composing your own.
phasesarrayPhase objects (same shape as above).
duration_days vs lunation_days — these differ, and both are correct. duration_days (≈26d) measures only the marked phases, new moon through waning crescent. lunation_days (≈29.5d) measures the real lunar month, new moon to next new moon. After the last marked phase the Moon stays in the same lunation for roughly three more days — so a cycle whose phases are all past can still be status: current. That is not a bug: you are in the dark days before Amavasya.

The final cycle in a cycles response has no following new moon inside the slice, so its lunation_end, lunation_days, next_new_moon and days_to_next_new are null. Request a higher count if you need them.

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_QUERY_TYPEquery_type not one of live/current/date/range/month/year/cycles.
400INVALID_PHASE_FILTERUnrecognised phase_filter value.
400INVALID_COMBINATIONphase_filter used with query_type: cycles.
400INVALID_TIMEZONENumeric or non-IANA timezone.
500COMPUTE_ERRORLive Moon computation failed.

Plus standard calendar endpoint errors.

See also