Western Moon Phase
Calculate the lunar phase for any date using the tropical zodiac. Returns phase name (New Moon, Waxing Crescent, First Quarter, Waxing Gibbous, Full Moon, Waning Gibbous, Last Quarter, Waning Crescent), phase angle, illumination percentage, moon age in days, and next major phase estimate. Defaults to today if no date given.
Endpoint
GET /v1/western/moon/phase
Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
| date | string | null | No | Date in YYYY-MM-DD format. Defaults to today. |
Example request
- curl
- Python
- TypeScript
curl -X GET "https://api.asterwise.com/v1/western/moon/phase?date=2026-01-01" \
-H "Authorization: Bearer YOUR_API_KEY"
import asterwise
from asterwise.api.western_astrology_api import WesternAstrologyApi
configuration = asterwise.Configuration(
host="https://api.asterwise.com",
access_token="YOUR_API_KEY",
)
with asterwise.ApiClient(configuration) as client:
api = WesternAstrologyApi(client)
result = api.western_moon_phase(date="2026-01-01")
print(result)
import { createClient, createConfig, westernMoonPhase } from 'asterwise';
const client = createClient(createConfig({
baseUrl: 'https://api.asterwise.com',
headers: { Authorization: 'Bearer YOUR_API_KEY' },
}));
const result = await westernMoonPhase({
client,
query: {
"date": "2026-01-01"
},
});
console.log(result.data);
Example response
Response fields
| Field | Type | Description |
|---|---|---|
| success | boolean | True if the request succeeded |
| message | string | Human-readable status message |
| data | object | |
| data.date | string | Date in YYYY-MM-DD format |
| data.phase_name | string | Current phase name |
| data.phase_angle | number | Phase angle in degrees (0-360). 0=New Moon, 180=Full Moon |
| data.illumination_pct | number | Percentage of Moon disk illuminated (0-100) |
| data.moon_age_days | number | Days elapsed since last New Moon (0 to 29.53) |
| data.moon_longitude | number | Tropical ecliptic longitude of Moon (0-360) |
| data.sun_longitude | number | Tropical ecliptic longitude of Sun (0-360) |
| data.is_waxing | boolean | True if Moon is waxing (phase_angle < 180) |
| data.next_phase_name | string | Name of the next major phase |
| data.next_phase_date | string | null | Estimated date of next major phase (YYYY-MM-DD) |
Errors
| Code | Description | Reference |
|---|---|---|
| authentication_failed | Missing or invalid API key. | authentication_failed |
| ephemeris_unavailable | Upstream ephemeris service error. | ephemeris_unavailable |
| insufficient_tier | API key tier does not include this endpoint. | insufficient_tier |
| internal_error | Unexpected server error. | internal_error |
| ip_rate_limit_exceeded | Too many requests in a short window. | ip_rate_limit_exceeded |
| payload_too_large | Request body exceeds the size limit. | payload_too_large |
| resource_not_found | Referenced resource was not found. | resource_not_found |
| validation_error | Request body failed schema validation. | validation_error |