curl "https://yogataraapi.prahlad.app/api/astro/ayanamsa_value/" \
-H "X-API-Key: $OCCULT_API_KEY"The ayanamsa is the gap between the tropical zodiac, which is tied to the equinox, and the sidereal zodiac used in Vedic astrology, which is tied to the stars. It grows by roughly fifty arc-seconds a year, so every sidereal calculation depends on which ayanamsa you adopt and for which date. This endpoint returns that single number. It is a GET with query parameters: `ayanamsa`, a name such as LAHIRI, RAMAN, KRISHNAMURTI or TRUE_CITRA (47 Swiss Ephemeris definitions are accepted, case-insensitively), and `date`, an ISO date defaulting to today. Use it to label a chart with the ayanamsa it was cast on, or to see how far two definitions diverge for a given birth date. The response gives the value both ways: `value_degrees` as a decimal to six places, and `degrees`, `minutes` and `seconds` plus a ready-made `formatted` string. The name and the resolved date are echoed back. An unknown name, and the pseudo-ayanamsa 'USER', return 400.
| Parameter | Type | Example | What it does | |
|---|---|---|---|---|
| ayanamsa | string | — | Ayanamsa name (e.g. LAHIRI). Defaults to LAHIRI. GET query parameter. Case-insensitive .strip.upper at. Defaults to 'LAHIRI'. 'USER' is explicitly rejected by this endpoint even though it exists in the underlying swisseph dict. Unknown values return 400 {"error": "Unknown ayanamsa..."}. one of: FAGAN_BRADLEY, LAHIRI, DELUCE, RAMAN, USHASHASHI, KRISHNAMURTI, DJWHAL_KHUL, YUKTESHWAR, JN_BHASIN, BABYL_KUGLER1, BABYL_KUGLER2, BABYL_KUGLER3, BABYL_HUBER, BABYL_ETPSC, ALDEBARAN_15TAU, HIPPARCHOS, SASSANIAN, GALCENT_0SAG, J2000, J1900, B1950, SURYASIDDHANTA, SURYASIDDHANTA_MSUN, ARYABHATA, ARYABHATA_MSUN, SS_REVATI, SS_CITRA, TRUE_CITRA, TRUE_REVATI, TRUE_PUSHYA, GALCENT_COCHRANE, GALCENT_RGILBRAND, GALCENT_MULA_WILHELM, ARYABHATA_522, BABYL_BRITTON, TRUE_MULA, GALALIGN_MARDYKS, TRUE_SHEORAN, GALEQU_TRUE, GALEQU_MULA, GALEQU_IAU1958, GALEQU_FIORENZA, VALENS_MOON, LAHIRI_1940, LAHIRI_VP285, KRISHNAMURTI_VP291, LAHIRI_ICRC | |
| date | string | — | ISO date string (e.g. 1990-05-14). Defaults to today. FORMAT constraint, not an enum. Anything Python's datetime.fromisoformat accepts: 'YYYY-MM-DD' or a full ISO 8601 datetime, e.g. '1990-05-14' / '1990-05-14T12:30:00'. Any timezone offset in the string is DISCARDED and replaced with UTC. Defaults to today (UTC). Invalid format returns 400. |