Swiss Ephemeris API alternative
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.
Precision and coverage
Section titled “Precision and coverage”- Checked against NASA JPL Horizons: 231 of 231 positions within tolerance on an independent benchmark, median
0.052″, maximum1.1″(Chiron in 1900;0.47″for the Sun, Moon and planets). - Against the swetest reference output: median
0.0013″, maximum0.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, about0.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.
Endpoints that replace an ephemeris call
Section titled “Endpoints that replace an ephemeris call”| Endpoint | Credits | Returns |
|---|---|---|
/v1/planets | 10 | Geocentric positions: longitude, latitude, distance and their speeds, retrograde flag |
/v1/ephemeris | 100 | Longitudes and retrograde flags between two dates at a fixed step |
/v1/houses | 10 | House cusps, ascendant and MC in 25 systems |
/v1/chart | 20 | Full chart: planets + houses + aspects |
/v1/transits | 50 | Transits to a natal chart for a given date |
/v1/progressions | 50 | Secondary progressions (day = year) |
/v1/eclipses | 100 | Solar and lunar eclipses |
/v1/moon-phase | 10 | Moon phase, illumination, next quarters |
/v1/fixed-stars | 20 | Planet 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 today | Send 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_julday | Date 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 Chiron | The 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 days | One /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.
Example
Section titled “Example”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 }'const r = await fetch('https://api.astroway.info/v1/planets', { method: 'POST', headers: { 'X-Api-Key': process.env.ASTROWAY_API_KEY!, 'Content-Type': 'application/json', }, body: JSON.stringify({ date: '1990-07-14', time: '14:30:00', timezoneOffset: 3, latitude: 50.4501, longitude: 30.5234, }),});const { data } = await r.json();const sun = data.planets.find((p) => p.name === 'Sun');console.log(`Sun: ${sun.longitude.toFixed(4)}° retrograde: ${sun.isRetrograde}`);import os, requests
r = requests.post( 'https://api.astroway.info/v1/planets', headers={'X-Api-Key': os.environ['ASTROWAY_API_KEY'], 'Content-Type': 'application/json'}, json={ 'date': '1990-07-14', 'time': '14:30:00', 'timezoneOffset': 3, 'latitude': 50.4501, 'longitude': 30.5234, },)data = r.json()['data']sun = next(p for p in data['planets'] if p['name'] == 'Sun')print(f"Sun: {sun['longitude']:.4f}° retrograde: {sun['isRetrograde']}")Who uses it
Section titled “Who uses it”- 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
Pricing
Section titled “Pricing”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.