Skip to content
AstroWay/api v2.325.2 · docs
all systems operational

Swiss Ephemeris API alternative

Last updated View as Markdown Agent setup

If you searched for a Swiss Ephemeris API, you most likely want one thing: the planet positions, house cusps and eclipses you would get from swetest or a swisseph binding, without compiling a C library, hosting ephemeris files or writing the astrology layer on top. AstroWay gives you that over HTTP. One POST request, JSON back, computed on our own servers with no upstream API in between.

  • Checked against NASA JPL Horizons: 231 of 231 positions within tolerance on an independent benchmark, median 0.052″, maximum 1.1″ (Chiron in 1900; 0.47″ for the Sun, Moon and planets).
  • Against the swetest reference output: median 0.0013″, maximum 0.561″ (Chiron) over 130 samples from 1900 to 2050, so results line up with the numbers your current setup prints.
  • Regression-tested: 888 frozen snapshot tests on every pull request; one regression blocks the release.
  • Date range: dates from year 0000 to 9999 are accepted. Inside 1800-2399 positions are better than 0.01″; outside it an analytical ephemeris is used, about 0.1″.
  • More than positions: house cusps in 25 systems, aspects, eclipses (checked against the NASA 5-Millennium Eclipse Catalog), transits, progressions and the rest of the 865 endpoints, the parts you would otherwise write yourself.
EndpointCreditsReturns
/v1/planets10Geocentric positions: longitude, latitude, distance and their speeds, retrograde flag
/v1/ephemeris100Longitudes and retrograde flags between two dates at a fixed step
/v1/houses10House cusps, ascendant and MC in 25 systems
/v1/chart20Full chart: planets + houses + aspects
/v1/transits50Transits to a natal chart for a given date
/v1/progressions50Secondary progressions (day = year)
/v1/eclipses100Solar and lunar eclipses
/v1/moon-phase10Moon phase, illumination, next quarters
/v1/fixed-stars20Planet conjunctions with fixed stars

The full list is in the API reference.

Migrating from swetest or a swisseph binding

Section titled “Migrating from swetest or a swisseph binding”

The request and response shapes were kept close to what you already pass and read:

You have todaySend instead
swetest -b14.7.1990 -ut11:30"date": "1990-07-14", "time": "11:30:00", "timezoneOffset": 0 (or local time with its offset, or "timezone": "Europe/Kyiv")
A Julian day from swe_juldayDate and time as above; the response returns julianDay so you can keep keys you store by JD
swe_calc_ut(jd, body, SEFLG_SPEED)POST /v1/planets; each body comes back with id, longitude, latitude, distance, speedLong, speedLat, speedDist in the same order as the six output values
Body numbers 0-9 (Sun to Pluto), 11 true node, 12 mean Lilith, 13 true Lilith, 15 ChironThe same numbers in id and in planetIds on /v1/ephemeris
-house<lon>,<lat>,P or swe_houses(..., 'P')/v1/houses with latitude, longitude and the same one-letter houseSystem code
-sid1 or swe_set_sid_mode/v1/chart with "zodiacType": "sidereal" and "ayanamsa": "lahiri" (or ayanamsaId)
A loop over -n steps of -s daysOne /v1/ephemeris call with startDate, endDate, stepDays (up to 5 years per call, 1 year for sub-day steps)

Two differences worth knowing. Longitude is east-positive and latitude north-positive, in decimal degrees. Above the polar circle, where Placidus, Koch and Regiomontanus are undefined, the cusps come back as Porphyry and a warning field says so, rather than an error code you have to check.

Terminal window
curl -X POST https://api.astroway.info/v1/planets \
-H "X-Api-Key: aw_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"date": "1990-07-14",
"time": "14:30:00",
"timezoneOffset": 3,
"latitude": 50.4501,
"longitude": 30.5234
}'
  • Astrology-app developers: arc-second positions without shipping an ephemeris library in the app
  • AI agents: accurate positions as grounding for LLMs (via the MCP server)
  • Researchers: bulk position tables over a date range from one call
  • Teams moving off a self-hosted build: the mapping above, over HTTP

Planet positions (/v1/planets) - 10 credits, full chart (/v1/chart) - 20. The Free tier (10,000 credits/mo) covers roughly 1,000 planet requests a month, no card required.