POST · VEDIC

Ayanamsa

Endpoint POST https://starsapi.com/api/v3/vedic/ayanamsa

Overview

Resolves one or more ayanamsa values for a given birth moment. The ayanamsa is the angular difference between the tropical and sidereal zodiacs and varies by system and date. This endpoint computes the precise degree(s) you need without performing any chart calculations.

Three modes of operation, controlled by the optional ayanamsa parameter:

Modeayanamsa paramResponse shape
DefaultomittedReturns both defaults: lahiri + kp_old as a keyed object.
SinglelahiriFlat object (single ayanamsa result, not wrapped in a key).
Multilahiri,kp_old,ramanKeyed object (one entry per requested key). Maximum 10 keys.

Recommended app flow: on form submit, fire /birth-details + /ayanamsa (no param) in parallel. Vedic screens use the lahiri value; KP screens use kp_old. If a user changes ayanamsa via a settings sheet, re-call this endpoint with the specific key and trigger a lazy recalculation of compute endpoints.

Authentication

MethodExample
Header (recommended)X-Api-Key: am_live_xxxxxxxxxxxx
BearerAuthorization: Bearer am_live_xxxxxxxxxxxx
Query?api_key=am_live_xxxxxxxxxxxx

Request body

FieldTypeRequiredDescription
yearintegerYesBirth year (e.g. 1990)
monthintegerYesBirth month (1–12)
dayintegerYesBirth day (1–31)
hourintegerYesBirth hour (0–23)
minuteintegerYesBirth minute (0–59)
secondintegerNoBirth second (0–59). Defaults to 0.
timezonestringYesIANA timezone identifier (e.g. Asia/Kolkata).
latitudenumberYesSigned decimal latitude.
longitudenumberYesSigned decimal longitude.
ayanamsastringNoAyanamsa key or comma-separated keys (max 10). Omit for both defaults (lahiri + kp_old). See supported keys.
node_typestringNotrue or mean. Controls Rahu/Ketu node position used internally. Defaults to mean.

Response modes

Default mode (no ayanamsa param)

Returns both platform defaults as a keyed object:

{
  "data": {
    "ayanamsa": {
      "lahiri": {
        "key": "lahiri",
        "name": "Lahiri (Chitrapaksha)",
        "value": 23.72459,
        "value_dms": "23°43'28\""
      },
      "kp_old": {
        "key": "kp_old",
        "name": "KP Old (Krishnamurti)",
        "value": 23.71832,
        "value_dms": "23°43'06\""
      }
    }
  }
}

Single mode (ayanamsa=lahiri)

Returns a flat object — no outer key wrapper:

{
  "data": {
    "ayanamsa": {
      "key": "lahiri",
      "name": "Lahiri (Chitrapaksha)",
      "value": 23.72459,
      "value_dms": "23°43'28\""
    }
  }
}

Multi mode (ayanamsa=lahiri,kp_old,raman)

Returns a keyed object with one entry per requested key:

{
  "data": {
    "ayanamsa": {
      "lahiri": {
        "key": "lahiri",
        "name": "Lahiri (Chitrapaksha)",
        "value": 23.72459,
        "value_dms": "23°43'28\""
      },
      "kp_old": {
        "key": "kp_old",
        "name": "KP Old (Krishnamurti)",
        "value": 23.71832,
        "value_dms": "23°43'06\""
      },
      "raman": {
        "key": "raman",
        "name": "Raman",
        "value": 22.37610,
        "value_dms": "22°22'34\""
      }
    }
  }
}

Per-ayanamsa fields

FieldTypeDescription
keystringMachine-readable ayanamsa identifier (same as the request key).
namestringHuman-readable display name.
valuenumberAyanamsa in decimal degrees at the birth moment.
value_dmsstringAyanamsa in degrees–minutes–seconds notation.

The meta block includes node_type (true or mean) but no ayanamsa sub-block — the ayanamsa data is the response itself.

Supported ayanamsa keys

All 47 unique keys from EphemerisService are accepted. The four aliases (lahiri_chitrapaksha → lahiri, etc.) resolve silently to their canonical key. Sending an unknown key returns INVALID_AYANAMSA.

Full key list (click to expand)
lahiri
kp_old
raman
krishnamurti
kp_new
yukteshwar
jn_bhasin
bv_raman
true_chitrapaksha
suryasiddhanta
suryasiddhanta_msun
aryabhata
aryabhata_msun
ss_revati
ss_citra
djwhal_khul
sassanian
ushashashi
hipparchos
galactic_center_0_sag
fagan_bradley
galactic_center_brand
galactic_center_gilbrand
galactic_center_mittalaql
galactic_center_cochrane
galactic_center_mula
galactic_equator_iau1958
galactic_equator_true
galactic_equator_mula
skydram_aldebaran_15tau
aldebaran_15tau
hipparchos_sidtime
sassanian_sidtime
tropical
de_luce
usha_shashi_new
sundara_rajan
valensmoon
lahiri_1940
lahiri_vpnath
krishnamurti_senthil
pushya_paksha
mandi_point
true_pushya
true_mula
true_revati
galactic_ayan_u_0_sag

Errors

HTTPCodeCause
400MISSING_FIELDA required field is absent.
400INVALID_DATEYear/month/day combination does not resolve to a real date.
400INVALID_TIMEHour/minute/second outside valid range.
400INVALID_TIMEZONETimezone string is not a valid IANA identifier.
400INVALID_COORDINATELatitude or longitude outside valid range.
400INVALID_AYANAMSAOne or more ayanamsa keys not recognized.
400TOO_MANY_AYANAMSASMore than 10 comma-separated keys.
400INVALID_JSONRequest body is not valid JSON.
401UNAUTHORIZEDMissing or invalid API key.
405METHOD_NOT_ALLOWEDRequest method is not POST.

See also