# Swiss Ephemeris (C library) vs a hosted API

> Swiss Ephemeris is the engine under most astrology software, AstroNode included. Linking it directly gives you the same positions we start from, at in-process speed. What it does not give you is astrology: no dashas, no vargas, no panchang - those are rules you implement on top.

Source: https://astronode.dev/compare/self-hosting/swiss-ephemeris · Facts checked: 2026-12-01

## When self-hosting Swiss Ephemeris is the better choice

- You need raw speed. Their own benchmark puts a complete set of planetary positions at about 0.3 ms; a network round trip to any API is two to three orders of magnitude slower. For ephemeris tables, search loops ("when does Mars next cross 0° Aries?") or millions of charts in a batch job, in-process is the right answer.
- You work outside the range an API exposes: ancient or far-future dates, numbered asteroids, fixed stars, heliocentric or topocentric frames. The library covers 13201 BC to AD 17191 with the full files.
- Your product is offline - a desktop app, an embedded device, a phone app that must work on a plane. Nothing about a hosted API helps there.
- You want to own every convention: which ayanamsa, true or mean node, refraction on or off at sunrise, which house system at polar latitudes. The C API exposes each switch directly.
- You already have astrologers on the team who can specify the dasha, varga and yoga rules precisely and will review the output. Then the astronomy is the only hard dependency, and this is the best one there is.

## Side by side

|  | Swiss Ephemeris | AstroNode API |
| --- | --- | --- |
| Language / runtime | ANSI C source; bindings exist for other languages ([source](https://www.astro.com/swisseph/swephprg.htm)) | Any language: HTTPS + JSON, OpenAPI 3.1 spec ([details](https://astronode.dev/guides/openapi-typed-client)) |
| Install and native build | Compile a static or shared library and link it ([source](https://www.astro.com/swisseph/swephprg.htm)) | Nothing to compile; an API key and an HTTP client ([details](https://astronode.dev/quickstart/curl)) |
| Planet positions | Yes - planets, Moon, asteroids, 13201 BC to AD 17191 ([source](https://www.astro.com/swisseph/swephinfo_e.htm)) | Sidereal and tropical, from Swiss Ephemeris data files ([details](https://astronode.dev/capabilities/vedic)) |
| House systems | Yes - one-letter codes for each house method ([source](https://www.astro.com/swisseph/swephprg.htm)) | Whole-sign (Vedic), Placidus (KP), five Western systems ([details](https://astronode.dev/guides/house-systems)) |
| Sidereal / ayanamsa | Yes - named sidereal modes (Lahiri, Krishnamurti, Raman, ...) and user-defined ([source](https://www.astro.com/swisseph/swephprg.htm)) | Fixed per tradition: Lahiri, KP-Newcomb, tropical ([details](https://astronode.dev/guides/ayanamsa)) |
| Dashas | Not provided - it is an astronomy toolkit ([source](https://www.astro.com/swisseph/swephinfo_e.htm)) | Vimshottari, Yogini, Char ([details](https://astronode.dev/guides/vimshottari-dasha-calculation)) |
| Divisional charts (vargas) | Not provided - derive from sidereal longitudes ([source](https://www.astro.com/swisseph/swephinfo_e.htm)) | 16 vargas in one call, plus D150 ([details](https://astronode.dev/guides/divisional-chart-calculation)) |
| KP sub-lords | Krishnamurti ayanamsa only; the sub-lord chain is yours ([source](https://www.astro.com/swisseph/swephprg.htm)) | Cuspal sub-lord chain, significators, horary 1-249 ([details](https://astronode.dev/capabilities/kp)) |
| Panchang | Building blocks: rise/set times; Hindu sunrise needs two flags ([source](https://www.astro.com/swisseph/swephprg.htm)) | Tithi, nakshatra, yoga, karana, sunrise, muhurta windows ([details](https://astronode.dev/guides/panchang-sunrise-conventions)) |
| Yogas | Not provided ([source](https://www.astro.com/swisseph/swephinfo_e.htm)) | 55 classical yogas with reasons ([details](https://astronode.dev/capabilities/vedic)) |
| Kundli matching | Not provided ([source](https://www.astro.com/swisseph/swephinfo_e.htm)) | Ashtakoot, Dashakoot, Porutham, batch scoring ([details](https://astronode.dev/capabilities/compatibility)) |
| Ephemeris data you ship | .se1 files: 27 MB planets + 70 MB Moon; runs without them at lower precision ([source](https://www.astro.com/swisseph/swephinfo_e.htm)) | None on your side |
| Time zones and historical offsets | Not handled - you convert local time to UTC ([source](https://www.astro.com/swisseph/swephprg.htm)) | You send the offset in force at birth; no zone-name lookup ([details](https://astronode.dev/guides/birth-time-and-time-zones)) |
| Maintenance signal | Active: moved to JPL DE441 in May 2026; leap-second updates ([source](https://www.astro.com/swisseph/swephinfo_e.htm)) | Hosted; changes published in the changelog ([details](https://astronode.dev/changelog)) |
| Stated accuracy | Compressed files reproduce JPL to 0.001″ (their figure) ([source](https://www.astro.com/swisseph/swephinfo_e.htm)) | Measured in CI vs NASA JPL Horizons: Moon 3.1″, planets ≤ 0.5″ (1900-2050) ([details](https://astronode.dev/)) |

| More from their docs |  |
| --- | --- |
| Speed | About 0.3 ms per full set of planets ([source](https://www.astro.com/swisseph/swephinfo_e.htm)) |
| Without data files | Moshier model, sub-0.1″ planets, 3000 BC to 3000 AD ([source](https://www.astro.com/swisseph/swephinfo_e.htm)) |
| Leap seconds | Upstream updates, or you add seleapsec.txt yourself ([source](https://www.astro.com/swisseph/swephprg.htm)) |

## What you still build yourself

- Local-time-to-UT conversion with historical offsets - the manual is explicit that the library does not do it.
- Nakshatra, pada and the Vimshottari balance at birth, then mahadasha to pratyantar periods with the 365.25-day year convention you choose.
- Sixteen divisional-chart formulas (and the odd/even-sign exceptions for D3, D9, D30 and others).
- Panchang: tithi, yoga and karana from Sun-Moon longitudes, and their end times by root-finding, anchored to Hindu sunrise.
- KP: the 249-entry sub-lord table built on Krishnamurti ayanamsa and Placidus cusps.
- Yoga detection and kundli matching - pure rule tables, but long ones, and each tradition disagrees in the edge cases.
- Bindings for your language if you are not in C, plus the build for every platform you deploy to.

## Running it in production

- Native build per target. The distribution is C source you compile into a static or shared library; every OS and CPU you ship to needs its own build, and your CI needs a C toolchain.
- Data files. Full precision needs the .se1 files - 27 MB for the planets and 70 MB for the Moon across the whole range. You decide which files to ship, where they live, and how the path is set in each environment. A missing file does not fail loudly: the library falls back to the Moshier model.
- Updates. Upstream moved to JPL DE441 in May 2026, and leap seconds arrive whenever the IERS announces one. Picking those up is a dependency bump and a redeploy on your side.
- Sunrise for Vedic work. The manual calls out that correct Hindu rising and setting times need SE_BIT_NO_REFRACTION and SE_BIT_DISC_CENTER; forget them and every panchang element anchored to sunrise drifts by minutes.
- Whatever the library, the birth input is a local clock time, and turning it into UT needs the offset that was in force on that date - our [UTC offset finder](https://astronode.dev/tools/utc-offset-finder) and the [time-zone guide](https://astronode.dev/guides/birth-time-and-time-zones) cover the traps.

## Accuracy

Their documentation states that the compressed files reproduce JPL's data with 0.001 arc-second precision, and that the built-in Moshier fallback stays better than 0.1″ for the planets (3″ for the Moon) between 3000 BC and 3000 AD. Those are the library's own figures, quoted below. AstroNode uses Swiss Ephemeris with its data files; our CI compares the Sun, Moon and five planets against NASA JPL Horizons at eight dates and measured the Moon within 3.1″ and every planet within 0.5″ from 1900 to 2050. The difference between the two numbers is mostly ΔT and frame conventions, not the ephemeris.

## Where an API saves work

- The Vedic layer is the expensive part, not the astronomy. Three dasha systems, sixteen vargas, 55 yogas, KP sub-lords, panchang and matching are endpoints rather than months of rule-writing and astrologer review.
- No C toolchain, no per-platform builds, no data-file path to get wrong in production.
- Upstream changes (a new JPL ephemeris, a leap second) are rolled out once on our side.
- Your app can be written in anything that speaks HTTP - including a mobile or edge runtime where shipping a native library is awkward.

## Questions

**What do I need to install to use Swiss Ephemeris?**

Swiss Ephemeris: Compile a static or shared library and link it. AstroNode API: Nothing to compile; an API key and an HTTP client. Checked 2026-12-01.

**Does Swiss Ephemeris calculate dashas?**

Swiss Ephemeris: Not provided - it is an astronomy toolkit. AstroNode API: Vimshottari, Yogini, Char. Checked 2026-12-01.

**Does Swiss Ephemeris support KP sub-lords?**

Swiss Ephemeris: Krishnamurti ayanamsa only; the sub-lord chain is yours. AstroNode API: Cuspal sub-lord chain, significators, horary 1-249. Checked 2026-12-01.

**Does Swiss Ephemeris do kundli matching?**

Swiss Ephemeris: Not provided. AstroNode API: Ashtakoot, Dashakoot, Porutham, batch scoring. Checked 2026-12-01.

**Does Swiss Ephemeris handle time zones and historical offsets?**

Swiss Ephemeris: Not handled - you convert local time to UTC. AstroNode API: You send the offset in force at birth; no zone-name lookup. Checked 2026-12-01.
