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_type | Description |
|---|---|
current | Next upcoming phase from today. |
date | Phases on a specific date. |
range | Phases within a date range. |
month | All phases in a calendar month. |
year | All phases in a calendar year. |
cycles | Full lunation cycles (new moon → new moon). Returns count complete cycles (default 1, max 24) starting from the current lunation. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
query_type | string | No | Default current. |
timezone | string | No | IANA timezone. Default UTC. |
date | string | * | Required for date. |
from_date, to_date | string | * | Required for range. |
month, year | integer | * | Required for month/year. |
count | integer | No | Number of lunation cycles for cycles query. Default 1, max 24. |
phase_filter | string | No | Show 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_cycle | boolean | No | Wrap phases into lunation cycle groups on any query type. Default false (always true for cycles). |
Response shape
Phase fields
| Field | Type | Description |
|---|---|---|
phase | string | Display name (e.g. New Moon, Full Moon). |
phase_key | string | Machine key (e.g. new_moon, full_moon). |
datetime_utc | string | Exact phase time in UTC. |
datetime_local | string | Converted to requested timezone. |
moon_sign | string | Sidereal sign of the Moon at the phase. |
sun_sign | string | Sidereal sign of the Sun. |
moon_nakshatra | string | Moon’s nakshatra. |
moon_pada | integer | Moon’s nakshatra pada. |
moon_nakshatra_lord | string | Vimshottari lord. |
status | string | past, current (today), or upcoming. |
days_from_now | number | Signed days from now (negative = past). |
Cycle fields (when grouped)
When group_by_cycle is true or query_type is cycles:
| Field | Type | Description |
|---|---|---|
cycle_number | integer | Sequential cycle index. |
partial | boolean | true if this cycle didn’t start with a new moon in the result set. |
new_moon | string|null | UTC datetime of the cycle’s new moon. |
full_moon | string|null | UTC datetime of the cycle’s full moon. |
duration_days | number|null | Span of the cycle in days. |
phase_count | integer | Number of phases in this cycle. |
phases | array | Phase 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_moonfor Purnima vrat dates. - Lunation cycle tracker — visualize complete lunar cycles with the
cyclesquery.
Errors
| HTTP | Code | Cause |
|---|---|---|
| 400 | INVALID_PHASE_FILTER | Unrecognised phase_filter value. |
| 400 | INVALID_COMBINATION | phase_filter used with query_type: cycles. |
Plus standard calendar endpoint errors.
See also
- Eclipses — solar & lunar eclipses
- Upcoming — merged timeline
- Transit overview