FreeAstroAPI LogoFreeAstroAPI
Real-time Lunar Engine

Free Moon APIPhases, Eclipses & Visuals

Instantly calculate moon phases, illumination percentage, age, and upcoming eclipses. Generates production-ready SVG visuals on the fly.

Complete Lunar Data

Everything you need to build lunar calendars, planting guides, or astrology apps.

Precise Phases

Get exact illumination percentage (e.g., 99.4%), moon age (in days), distance from Earth, and current stage (Waxing Crescent, Waning Gibbous, etc.).

SVG Visuals

Don't waste time drawing moons. Our API returns raw SVG code for the *exact* current phase, ready to embed directly in your HTML/React components.

Eclipse & Red Blood Moon

Detect upcoming Solar and Lunar eclipses. Our API automatically flags Total Lunar Eclipses as "Blood Moons" due to their reddish hue.

"is_blood_moon": true

Simple Integration

A single endpoint delivers all the data you need. Customize the response with query parameters to get only what you want.

Standard JSON

Compatible with any language (JS, Python, Go, etc.).

Free Usage

Generous free tier for hobby projects and students.

Zodiac Position

Includes Moon's current sign and degree (0-360°).

GET /api/v1/moon/phase?include_visuals=true
{
  "timestamp": "2023-10-27T14:30:00Z",
  "phase": {
    "name": "Waxing Gibbous",
    "illumination": 0.94,
    "age_days": 12.4,
    "is_waxing": true
  },
  "moon_visual": {
    "type": "svg",
    "svg": "<svg viewBox='0 0 100 100'>...</svg>"
  },
  "special_moon": {
    "is_supermoon": false,
    "is_blue_moon": true,
    "labels": ["Blue Moon"]
  }
}
Visual Customization

Programmable SVG Visuals

The API returns procedural SVG code that matches the exact phase of the moon. Fully themeable to fit your application's design system.

Waxing Crescent
color: #E0E0E0
First Quarter
color: #60A5FA
Waxing Gibbous
color: #FCD34D
Full Moon (Blood)
color: #F87171

Deep Customization

Every visual aspect is customizable via query parameters. Match your UI's accent colors or create unique artistic representations of the lunar cycle.

style_moon_color

Hex color for the illuminated portion of the moon.

style_shadow_color

Hex color for the shadowed portion of the moon.

Moon API FAQ

How accurate is the phase calculation?

Extremely accurate. We calculate the exact geocentric position of the Moon relative to the Sun, ensuring precision down to the fraction of a degree.

Can I get Moon Rise and Set times?

Yes. If you provide `lat` and `lon` (or a `city` name) in your request, we will calculate the exact rise and set times for that specific location, adjusted for timezone.

What is a "Blue Moon" in your API?

We support both definitions: the second full moon in a calendar month (monthly Blue Moon) and the third of four full moons in a season (seasonal Blue Moon). Our API flags these special events automatically.

Is the API free?

Yes, calculate moon phases for free with our basic tier (up to 80 requests/day). For higher volume or commercial use, check our Pricing.

Start Tracking the Moon

Start with the free Moon API for single-date lookups. Upgrade only if you need a full monthly timeline in one request.

Free endpoint

Moon phase data for any date

Use the free Moon API when you need phase, illumination, age, zodiac sign, SVG visuals, and eclipse context for a specific moment.

No credit card required for free tier.

Entry plan+

Need a full month in one request?

The Moon Phase Timeline API returns daily moon snapshots, sign intervals, and ingress events for an entire calendar month.

This monthly endpoint is separate from the free Moon API and is available on Entry and High plans.

View monthly timeline docs