Planetary positions · Panchang · Sun & Moon

Free Astrology API
for Developers.

Get planetary positions, daily Panchang, and Sun and Moon times as JSON. No API key or account is required. Free use includes commercial apps with attribution.

REST API · Browser requests supported · Sidereal and tropical positions

Choose your astrology data

Use the same free service for calculations and horoscope readings.

Planetary positions

Get positions, zodiac signs, speeds, and retrograde flags for 12 bodies. Sidereal results include nakshatra and pada. Mean Rahu and Ketu are included.

GET /api/v1/planetary-positions

Try planetary positions ↗

Daily Panchang

Get tithi, nakshatra, yoga, karana, and weekday for a location. Each result includes the value at the start of the day and transition times.

GET /api/v1/panchang

Try the Panchang API ↗

Sun and Moon times

Get sunrise, sunset, moonrise, moonset, Moon phase, and Rahu Kaal. Add Moon illumination with the optional moon_details field.

GET /api/v1/times

Try Sun and Moon times ↗

Need written predictions for a zodiac sign? Use our daily, weekly, and monthly horoscope API. Calculation endpoints return astronomical data; horoscope endpoints return written readings.

Make your first request

These examples use a fixed instant so you can compare the fields.

cURL: planetary positions

Use sidereal or tropical for the zodiac system. Omit datetime to use the current instant.

curl 'https://freehoroscopeapi.com/api/v1/planetary-positions?datetime=2000-01-01T12%3A00%3A00Z&zodiac=sidereal'

JavaScript: read the Sun's sign

Browser requests support CORS. Calculation responses have no data wrapper.

const url = new URL('/api/v1/planetary-positions', 'https://freehoroscopeapi.com');
url.search = new URLSearchParams({
  datetime: '2000-01-01T12:00:00Z',
  zodiac: 'sidereal'
});
const response = await fetch(url);
if (!response.ok) {
  throw new Error(`API request failed: ${response.status}`);
}
const positions = await response.json();
console.log(positions.bodies.sun.sign);

Read the JSON response

This excerpt shows the Sun from the documented example. The full response includes all 12 bodies and calculation metadata.

{
  "datetime": "2000-01-01T12:00:00Z",
  "zodiac": "sidereal",
  "bodies": {
    "sun": {
      "type": "luminary",
      "longitude": 256.5157002159959,
      "latitude": 0.0002274254618305167,
      "longitude_speed": 1.019393589132278,
      "retrograde": false,
      "sign": "Sagittarius",
      "degrees_in_sign": 16.515700215995878,
      "nakshatra": "Purva Ashadha",
      "pada": 1
    }
  }
}

Download the OpenAPI specification for complete response schemas, examples, and error formats.

Get Panchang data for a location

Pass latitude and longitude. Omit the date to use today in the location's timezone.

curl 'https://freehoroscopeapi.com/api/v1/panchang?lat=19.076&lng=72.878'

This request uses Mumbai's coordinates. The result covers sunrise to the next sunrise. If sunrise is unavailable, day_basis identifies the local civil-day fallback.

Use date=YYYY-MM-DD for a specific local date. The service derives the timezone from the coordinates.

Calculation methods and limits

Planetary positions use Skyfield with the JPL DE421 ephemeris. Sidereal positions use an approximate Lahiri model. The response includes the engine, reference frame, and units.

  • Supported instants start at 1900-01-01 and end before 2053-01-01 UTC.
  • Positions are geocentric. Optional observer data adds altitude, azimuth, and distance for supplied coordinates.
  • Panchang data does not include festival or regional observance rules.
  • The API does not provide complete birth charts, house cusps, compatibility reports, or Dasha calculations.

See the astrology API reference for parameters and the error guide for time limits and failure responses.

Common questions

Is this astrology API free?

Yes. The public data endpoints are free and require no account or API key. Commercial and non-commercial use is allowed with attribution.

Include a visible Powered by FreeHoroscopeAPI link in your app, website, or public documentation. Read the API usage terms.

Does it support Vedic and Western astrology data?

The planetary endpoint supports sidereal and tropical positions. The Panchang endpoint supplies daily Vedic calendar data. These are calculation inputs, not a complete Vedic or Western report service.

Can an AI assistant use the API?

Yes. The MCP connection guide explains how to connect an assistant to the six public tools. They include planetary positions, Panchang, Sun and Moon times, horoscopes, and tarot cards.