Swiss Ephemeris API
Swiss Ephemeris - de facto standard for astronomical calculations in astrology: most serious software relies on it, including Astrodienst (astro.com), Solar Fire, Kerykeion. It reads ephemerides DE431 from NASA JPL and provides subsecond accuracy. AstroWay API gives direct HTTP access to it - without compiling C libraries, without downloading .se1 files, without memory management. One POST request, JSON in response.
Why Swiss Ephemeris through API
Dział zatytułowany „Why Swiss Ephemeris through API”Self-hosting Swiss Ephemeris means: gathering C libraries (or WASM build), placing several hundred megabytes of .se1 files, keeping them up-to-date, and implementing house cusps, aspects, phases yourself. Through API, all this is a foreign hassle:
- Zero infrastructure: no binaries, ephemeris files, or cold-start delays. Calculation is performed server-side on the same engine as Astrodienst.
- Subsecond accuracy:
< 0.1″against the referenceswetestCGI from Astrodienst, verified on 873 frozen snapshot tests at each deploy. - Full date range: DE431 covers 13201 BCE – 17191 CE, so historical and distant future charts are calculated without loss of accuracy.
- Not just positions: ephemeris data immediately available for house cusps (15 systems), aspects, eclipses, transits, progressions - what you’d have to write yourself in self-host.
What Swiss Ephemeris calculates
Dział zatytułowany „What Swiss Ephemeris calculates”| Endpoint | Credits | What returns |
|---|---|---|
/v1/chart | 20 | Full chart: planets + houses + aspects |
/v1/planets | 10 | Geocentric positions of planets (longitude, latitude, speed, retrograde) |
/v1/houses | 10 | House cusps - 15 systems (Placidus, Koch, Whole Sign, Equal…) |
/v1/transits | 50 | Transits to natal chart on given date |
/v1/progressions | 50 | Secondary progressions (day = year) |
/v1/eclipses | 100 | Solar and lunar eclipses (verified vs NASA Catalog) |
/v1/moon-phase | 10 | Moon phase, illumination, next quarter |
/v1/fixed-stars | 20 | Conjunctions of planets with fixed stars |
This is part of 760 endpoints of the platform - full list in API documentation.
Example
Dział zatytułowany „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
Dział zatytułowany „Who uses it”- Astro application developers: subsecond positions without self-host C libraries
- AI agents: accurate ephemerides as grounding for LLM (through MCP server)
- Researchers: mass calculations on historical DE431 date range
- Migration from self-host: replacing local
swissephwith HTTP without loss of accuracy
Pricing
Dział zatytułowany „Pricing”Positions of planets (/v1/planets) - 10 credits, full chart (/v1/chart) - 20. On Free tariff (760+ endpoints, 10,000 credits/month) - approximately 1,000 planet queries per month for free, without card.