Moon Phases API
Get real-time moon phase calculations with illumination percentage, phase angle, moon age, distance, and crescent visibility detection. Pure Go implementation using Meeus-style astronomical algorithms.
Get Moon Phase Data
Retrieve moon phase information for a specific location and date.
GET
/v1/moonQuery Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| lat | float | Required | Latitude (-90 to 90) |
| lng | float | Required | Longitude (-180 to 180) |
| date | string | Optional | Date in YYYY-MM-DD format (default: today) |
Example Request
curl "https://api.falakapi.com/v1/moon?lat=28.66&lng=77.07" \
-H "X-API-Key: fak_your_api_key_here"Example Response
{
"date": {
"gregorian": "2025-01-15",
"timestamp": 1736899200
},
"moon": {
"phase_name": "Waxing Crescent",
"phase_angle": 45.5,
"illumination": 0.23,
"age_days": 3.8,
"distance_km": 384400,
"is_crescent_visible": true,
"emoji": "π"
}
}Notes
- β’Phase angle ranges from 0Β° (New Moon) to 360Β°
- β’Illumination is a decimal from 0.0 (New Moon) to 1.0 (Full Moon)
- β’Crescent visibility considers atmospheric conditions and moon position
- β’Distance is calculated in kilometers from Earth's center
Moon Phases
| Phase | Emoji | Description |
|---|---|---|
| New Moon | π | Moon is not visible |
| Waxing Crescent | π | Crescent visible, growing |
| First Quarter | π | Half moon, right side lit |
| Waxing Gibbous | π | More than half, growing |
| Full Moon | π | Fully illuminated |
| Waning Gibbous | π | More than half, shrinking |
| Last Quarter | π | Half moon, left side lit |
| Waning Crescent | π | Crescent visible, shrinking |