LifeAstroAPILifeAstroAPI

API Reference / Vedic Astrology / Panchang

GET
10 credits

/v1/panchang/yoga

Yoga with transition JD.

What this tells you

Yoga (nitya yoga) is the sum of the sidereal longitudes of the Sun and Moon, divided into 27 parts of 13°20'. Each yoga has a name and is classed as auspicious or inauspicious. Muhurta selection avoids the inauspicious ones, especially Vyatipata and Vaidhriti. This endpoint returns the yoga running at local sunrise on `date` and when it ends.

`end_jd` is a Julian Day in UT. `end_local` is local wall-clock time in the request `tz`, formatted "YYYY-MM-DD HH:MM:SS" with no offset. If the Sun does not rise on `date` (polar day or night) the API returns 422 `data_unavailable`.

Request

All requests require an Authorization header with your dv_live_* API key.

example request
curl "https://api.lifeastroapi.com/v1/panchang/yoga?date=2027-01-15&tz=Asia%2FKolkata&lat=28.6139&lon=77.209" \
  -H "Authorization: Bearer YOUR_API_KEY"

Query parameters

Checked against the API: a parameter is marked required when the request fails without it.

NameRequiredExampleDescription
dateyes2027-01-15Date (YYYY-MM-DD).
tzyesAsia/KolkataTimezone: IANA name (Asia/Kolkata) or UTC offset (+05:30).
latyes28.6139Latitude in decimal degrees.
lonyes77.209Longitude in decimal degrees.
ayanamsano—Ayanamsa (sidereal offset) to use. Defaults to lahiri.

Response (200 OK)

The real response to the example request above, generated from the API itself. Long arrays are trimmed to their first two items. Field names are stable across versions.

200 response
{
  "date": "2027-01-15",
  "location": {
    "lat": 28.6139,
    "lon": 77.209,
    "alt": 0
  },
  "tz": "Asia/Kolkata",
  "index": 19,
  "name": "Shiva",
  "special": "Auspicious",
  "end_jd": 2461420.949764,
  "end_local": "2027-01-15 16:17:40"
}

Field reference

Every field in the response, with its type, a real example, and what it means.

FieldTypeMeaning
datestring
Echo of the `date` parameter (local date).
example: "2027-01-15"
locationobject
Echo of `lat`, `lon` and `alt` (metres, default 0).
example: { "lat": 28.6139, "lon": 77.209, "alt": 0 }
tzstring
Echo of the `tz` parameter. `end_local` is in this zone.
example: "Asia/Kolkata"
indexinteger (0–26)
Position of the yoga, counted from 0 (Vishkumbha = 0, Vaidhriti = 26).
example: 19
Jyotish: Yoga = floor((Sun longitude + Moon longitude) / 13°20'), using sidereal longitudes.
namestring
Name of the yoga.
example: "Shiva"
Jyotish: The 27 names as returned: Vishkumbha, Priti, Ayushman, Saubhagya, Shobhana, Atiganda, Sukarma, Dhriti, Shoola, Ganda, Vriddhi, Dhruva, Vyaghata, Harshana, Vajra, Siddhi, Vyatipata, Variyan, Parigha, Shiva, Siddha, Sadhya, Shubha, Shukla, Brahma, Indra, Vaidhriti.
specialstring
"Auspicious" or "Inauspicious". Always in English, even when `locale` is set.
example: "Auspicious"
Jyotish: The nine inauspicious yogas: Vishkumbha, Atiganda, Shoola, Ganda, Vyaghata, Vajra, Vyatipata, Parigha, Vaidhriti. The other 18 are auspicious.
end_jdnumber
When this yoga ends, as a Julian Day in UT.
example: 2461420.949764
end_localstring (YYYY-MM-DD HH:MM:SS)
When this yoga ends, in local time (request `tz`), with no offset suffix.
example: "2027-01-15 16:17:40"

Usage tips

How to use it

  • Combine with tithi for muhurta
    A muhurta is not picked from tithi alone; the yoga should be auspicious too. Use this with /v1/panchang/tithi, or call /v1/panchang/basic to get all five limbs in one request.
  • Warn on inauspicious yogas
    Show a warning badge when `special` is "Inauspicious". The value is never translated, so the comparison is safe in every locale.
  • Sunrise value, not the current one
    The yoga is taken at sunrise on `date`. The `time` parameter does not change it. After `end_local`, the next yoga (index + 1, wrapping 26 → 0) is running.
  • Choose the ayanamsa
    Yoga uses sidereal longitudes, so it depends on `ayanamsa` (lahiri by default; also raman, krishnamurti, fagan, yukteshwar, true_chitrapaksha).

Errors

Every error follows the same envelope. Use the error.code field (not the message) for conditional logic in your integration.

401 Unauthorized

{
  "error": {
    "code": "unauthorized",
    "message": "missing or invalid API key",
    "request_id": "req_01hqy7k8c3e7m1n"
  }
}

402 Payment Required

{
  "error": {
    "code": "trial_exhausted",
    "message": "your free trial credits are exhausted — pick a plan to continue",
    "top_up_url": "https://lifeastroapi.com/pricing",
    "request_id": "req_01hqy7k8c3e7m1n"
  }
}

429 Too Many Requests

{
  "error": {
    "code": "rate_limited",
    "message": "rate limit exceeded; retry after 12 seconds",
    "request_id": "req_01hqy7k8c3e7m1n"
  }
}

Try it

Get a dv_live_* key from your dashboard and paste into the cURL snippet above. New accounts get 1,500 free credits. Sign up.