Concept Guide

How DivineAPI calculates: Swiss Ephemeris, Lahiri

The method behind every chart: Swiss Ephemeris, Lahiri ayanamsa for Vedic, tropical zodiac for Western, Pythagorean, Chaldean and date-of-birth numerology.

DivineAPI

Archit Tyagi, Vedic Astrologer, DivineAPI

Published: November 09, 2026

How DivineAPI calculates: Swiss Ephemeris, Lahiri ayanamsa and the tropical zodiac

By Archit Tyagi, DivineAPI

DivineAPI calculates planetary positions with the Swiss Ephemeris, which it runs under a commercial licence, and then applies a fixed set of astrological settings on top: the tropical zodiac for Western endpoints, the sidereal zodiac with the Lahiri ayanamsa for Vedic endpoints, and one of 13 house-system codes where a chart needs houses. Numerology does not touch the ephemeris; it is arithmetic on a name or a date of birth under the Pythagorean, Chaldean or date-of-birth (general) method. Horoscope text is produced per sign and per period, not from a birth chart. DivineAPI publishes no accuracy figure or ranking for any of this, so this page describes the method and the settings, and shows how to check a chart against a reference you already trust.

That check is the useful part. Two services can share the same ephemeris and still disagree at every layer above it, because each layer is a setting: the time conversion, the zodiac, the ayanamsa, the house system, the lunar node. Match the settings first and most "accuracy" questions turn into configuration questions.

How does DivineAPI calculate Western positions? (Swiss Ephemeris, tropical zodiac)

Western endpoints read Swiss Ephemeris positions in the tropical zodiac, where 0° Aries is the March equinox point, and divide the chart with the house system you request. /western-api/v1/planetary-positions takes the 13 standard birth fields plus house_system (required), one of 13 codes as of November 2026, with Placidus as P; the others include Koch (K), Porphyry (O), Regiomontanus (R), Campanus (C), Alcabitius (B), Equal (A or E), whole sign (W, N), Morinus (M), Axial (X) and Polich/Page (T). The reply is a list, Ascendant first, with each body's sign, full_degree and house.

The house system changes the cusps, and therefore the house a planet falls in, but it never moves a planet's longitude. So when a Western chart disagrees with your reference, compare full_degree first; if the degrees match and only house numbers differ, the two sides are using different house systems, not different ephemerides. The request below is the one to reproduce that comparison with. Run with DIVINEAPI_KEY=YOUR_API_KEY DIVINEAPI_TOKEN=YOUR_TOKEN python natal.py, then change HOUSE_SYSTEM to the code your astrologers use.

File: natal.py

Python
import os
import sys

import requests

URL = "https://astroapi-4.divineapi.com/western-api/v1/planetary-positions" HOUSE_SYSTEM = "P" # Placidus (required field); K Koch, N whole sign, and so on

BIRTH = {"full_name": "Asha Rao", "day": "15", "month": "08", "year": "1990", "hour": "10", "min": "30", "sec": "0", "gender": "female", "place": "new delhi", "lat": "28.6139", "lon": "77.2090", "tzone": "5.5"}

key, token = os.environ.get("DIVINEAPI_KEY"), os.environ.get("DIVINEAPI_TOKEN") if not key or not token: sys.exit("Set DIVINEAPI_KEY and DIVINEAPI_TOKEN first.")

form = {"api_key": key, **BIRTH, "lan": "en", "house_system": HOUSE_SYSTEM} resp = requests.post(URL, headers={"Authorization": f"Bearer {token}"}, files={k: (None, v) for k, v in form.items()}, timeout=60) body = resp.json() if str(body.get("success")) != "1": sys.exit(f"success={body.get('success')} msg={body.get('msg')}")

print(f"tropical, house_system={HOUSE_SYSTEM}") for p in body["data"][:4]: print(f"{p['name']:<10} {p['sign']:<8} {p['full_degree']:>12} house {p['house']}")

Output of natal.py (run 3 Nov 2026):

Text
$ python natal.py
tropical, house_system=P
Ascendant  Libra     202.4386692  house 1
Sun        Leo       142.1250973  house 10
Moon       Gemini     72.6600484  house 8
Mars       Taurus     51.2170233  house 8

The flags in each entry (is_retro and its siblings) arrive as the strings "true" and "false", so compare them as strings. Western text reports come in 12 languages as of November 2026. The product overview is on the Western astrology API page.

How does DivineAPI calculate Vedic positions? (Swiss Ephemeris, Lahiri ayanamsa)

Vedic endpoints read the same Swiss Ephemeris positions and subtract the Lahiri ayanamsa to place them in the sidereal zodiac. Lahiri is fixed: no request parameter on any Vedic endpoint selects an ayanamsa, which is why the docs carry no list of selectable ones. Today the sidereal zodiac sits about 24 degrees behind the tropical one, so a Vedic Sun usually lands one sign earlier than the Western Sun for the same birth; the person in the request above is a Leo Sun in the tropical zodiac and a Cancer Sun in the sidereal one. Each of the 13 entries from /indian-api/v2/planetary-positions carries its nakshatra, nakshatra_pada and house on top of the sign.

Two settings decide whether your reference agrees. The first is the ayanamsa itself: if your practice uses another one, every planet, cusp and nakshatra shifts by the gap between the two, and no parameter corrects it. The second is the lunar node. Mean node and true node place Rahu and Ketu at different degrees; /indian-api/v2/planetary-positions takes no node parameter, and on the endpoints whose reference page lists node_type, set your reference to the same node type before comparing. KP system endpoints are documented separately on the reference. Vedic replies come in 8 languages as of November 2026. The endpoints are on the Vedic astrology API page.

How are DivineAPI's horoscope predictions produced?

A DivineAPI horoscope is written per sign and per period, not calculated from a birth chart. /api/v5/daily-horoscope takes a sign, a period keyword (today, tomorrow, yesterday), the date and a tzone; it never takes a birth time or place. The reply holds one text per life area (personal, health, profession, emotions, travel, plus luck as a list), a horoscope_percentage score per area and lucky colours, and that reply is identical for every user of the same sign on the same day in the same language, with no per-user personalisation. Weekly, monthly and yearly horoscopes work the same way for their periods; the Chinese horoscope takes an animal as its sign and the numerology horoscope takes a number.

Because the text is sign-level content, Swiss Ephemeris precision says nothing about it, and there is no degree to compare. What you can verify is request handling: that data.sign names the sign you sent, that data.date is the day the keyword points to at the tzone you sent, and that the six areas arrive with the shapes above. The horoscope_percentage block is part of the content for that sign and day; it is not a confidence score. Translations into 25+ languages come from the translator host (astroapi-5-translator.divineapi.com), not the main host. DivineAPI does not publish how the text itself is composed, and this page does not claim a method for it. The product is on the Horoscope API page.

How does DivineAPI calculate numerology numbers? (Pythagorean and Chaldean name numbers, date-of-birth numbers)

Numerology numbers are arithmetic, and the method field on /numerology/v1/core-numbers picks which arithmetic. general is date-of-birth based: life path, birth day, attitude and the personal year, month and day numbers come from the date alone, so changing full_name never moves them. pythagorean and chaldean are name-based: each maps letters to digits under its own table and produces destiny, soul urge, personality, expression and the other name numbers from the name together with the date of birth. The two tables differ, so a Chaldean and a Pythagorean destiny number for the same name can both be correct and still differ; pick one system per product and store which one produced each saved result. Mobile numerology is a third family with its own endpoints. All numerology answers are in English, and the ephemeris plays no part.

Any other method is refused with success=2, which is the right behaviour: a typo fails loudly instead of returning numbers from a system you did not ask for. Testing works like testing any pure function: a few names and dates worked by hand, compared field by field. Details are on the Numerology API page.

Method and fixed settings per product

As of November 2026.

Product Method Fixed settings Docs
Western Swiss Ephemeris, tropical zodiac house_system requested per call, 13 codes, required (P = Placidus); flags as strings developers.divineapi.com (Western API)
Vedic Swiss Ephemeris, sidereal zodiac Lahiri ayanamsa, no parameter; node_type only on the endpoints that list it developers.divineapi.com (Indian API)
Horoscope Sign-level text per period 12 signs, keyword periods, same text for every user of a sign; 25+ languages via the translator host Daily horoscope
Numerology Pythagorean, Chaldean (name-based), general (date-of-birth), Mobile numerology method per call; English only developers.divineapi.com (Numerology)
PDF Reports See the PDF Report API docs Customer branding fields on every report PDF Report API

Checking a chart against your own reference

Run this before trusting any astrology API, ours included. Start with 5 to 10 charts your astrologers have already cast and match the inputs and settings exactly:

  • Date and time as separate day, month, year, hour, min and sec values; if the seconds are unknown, send sec=0 and use zero in your reference too.
  • The same lat and lon on both sides, with place as a lowercase city name such as new delhi.
  • tzone as the decimal UTC offset in force at the birth moment (5.5 for India, never +5:30). DivineAPI does not adjust for daylight saving, so a summer birth in a DST region needs the summer offset.
  • The zodiac: tropical for Western endpoints, sidereal with Lahiri for Vedic ones.
  • The lunar node, mean or true, matched to your reference on the endpoints that take node_type.
  • The house system for Western charts, matched by code.
  • Compare full_degree, not sign names: a planet a few minutes from a sign boundary changes sign over a tiny difference and hides an otherwise close match.

Treat any difference as a settings question first. A gap that survives every item on that list is a calculation discrepancy; report it to admin@divineapi.com with the exact birth data you sent. The full parameter list per endpoint is in the developer docs.

FAQ

Does DivineAPI publish an accuracy figure? No. There is no public accuracy test, report or page, and this guide makes no accuracy claim. It describes the method and settings so you can compare charts against your own reference.

Can I choose the ayanamsa? No. Vedic endpoints use Lahiri, fixed, with no parameter to change it. If your practice uses another ayanamsa, the offset between the two will show in every position.

Which house systems are available? 13 codes as of November 2026 (required; P is Placidus), including Koch, Porphyry, Regiomontanus, Campanus, Alcabitius, Equal, whole sign, Morinus, Axial and Polich/Page. Send the code in house_system on Western calls only.

Is the horoscope text personalised to a birth chart? No. Horoscopes are sign-based and identical for every user of a sign; the AI Astrologer (POST /chat) is the product that answers from a user's natal chart.

Last reviewed 3 November 2026 by Archit Tyagi, DivineAPI. Engine, ayanamsa, house-system and language facts from the developer docs as of November 2026.

Related: Developer docs · Western astrology API · Start the 14-day free trial (credit card required to activate the trial)

Ready to integrate?

Start your free 14-day trial and get API access in under 2 minutes.