Swiss Ephemeris API

Most people searching for a Swiss Ephemeris API want one thing: a hosted endpoint that takes a date, time, latitude and longitude and returns accurate planetary positions, the ascendant and a full chart as JSON. That is what these endpoints do, and the accuracy is published.

What computes the positions

Asterwise uses the Swiss Ephemeris for planetary positions and house calculations, and accepts dates from 1800 through 2099. Between 1950 and 2050 the published check against NASA JPL Horizons shows a median difference of 0.050 arcseconds. You do not install a library, compile bindings or ship ephemeris files; you send JSON and get JSON back.

Tropical or sidereal

Every birth request accepts an ayanamsa field: lahiri (default), raman, kp, or tropical for zero offset. Western endpoints under /v1/western/ are always tropical. Details in the ayanamsa reference.

Request: a Western natal chart

curl -X POST https://api.asterwise.com/v1/western/natal \
  -H "Authorization: Bearer $ASTERWISE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date":"1985-11-12","time":"06:45","latitude":19.076,"longitude":72.8777,"timezone":"Asia/Kolkata","house_system":"placidus"}'

House systems: placidus (default), koch, equal, whole_sign.

Response, abbreviated

{
  "success": true,
  "data": {
    "zodiac": "tropical",
    "house_system": "placidus",
    "ascendant": { "longitude": 228.959114, "sign": "Scorpio", "degree_in_sign": 18.959114 },
    "mc":        { "longitude": 140.344876, "sign": "Leo", "degree_in_sign": 20.344876 },
    "planets": [
      { "name": "Sun",  "longitude": 229.596716, "sign": "Scorpio", "house": 1,  "is_retrograde": false, "dignity": "peregrine" },
      { "name": "Moon", "longitude": 221.838361, "sign": "Scorpio", "house": 12, "is_retrograde": false, "dignity": "fall" }
    ],
    "aspects": [ { "planet_a": "Jupiter", "planet_b": "Mars", "type": "trine", "exact_angle": 119.9635, "orb": 0.0365, "is_applying": false } ],
    "elements": { "fire": 2, "earth": 1, "air": 2, "water": 5, "dominant": "water" }
  }
}

Ten planets Sun through Pluto with sign, degree, house, retrograde flag and essential dignity; house cusps; all active aspects with orb; element, modality and hemisphere counts. Field list in the Western natal chart reference. The sidereal equivalent is POST /v1/astro/natal.

How accurate, measured

80 apparent geocentric longitudes (10 bodies at 8 instants between 1950 and 2050) were computed by this engine and by NASA JPL Horizons, which shares no code with the Swiss Ephemeris. Median difference 0.050 arcseconds, 95th percentile 0.231 arcseconds, 79 of 80 within half an arcsecond. The raw JSON and the comparison script are on the accuracy page; the reference chart with every planet next to an independent Swiss Ephemeris run is on the proof page.

Beyond positions

The same engine feeds 129 endpoints: Vedic natal and divisional charts, dasha, matchmaking, panchanga, transits, returns, progressions, synastry and composite charts. Rate limits per plan are in the rate limits reference.

Questions people ask

Which astrology API uses the Swiss Ephemeris?
Asterwise computes planetary positions and house cusps with the Swiss Ephemeris and serves them over REST as JSON, for dates from 1800 through 2099: send a date, time and place and get the chart back.
Do I need to install the Swiss Ephemeris or its data files?
No. There is no library to install, no bindings to compile and no ephemeris files to ship; you send JSON and get JSON back.
How accurate are the positions?
Checked against NASA JPL Horizons at 80 positions (10 bodies at 8 instants between 1950 and 2050): median difference 0.050 arcseconds, 95th percentile 0.231 arcseconds. Read the accuracy check.

Start with 500 free calls a month, no card, no expiry. Every plan includes all 129 endpoints. See pricing or create a key.