Detect Vedic Yogas From a Birth Chart With One API Call
How the chart-driven yoga detection endpoint scans a kundli for 12 classical Vedic yogas and returns a present verdict plus classical-text evidence.
TL;DR
- The yoga detection endpoint computes a kundli from birth data and runs classical detection rules for 12 named yogas, returning a present boolean and an evidence string for each.
- It detects exactly 12 yogas: Gajakesari, Sunapha, Anapha, Dhurdhura, Kemadruma, Chandra Mangala, Budha-Aditya, and the five Pancha Mahapurusha yogas (Ruchaka, Bhadra, Hamsa, Malavya, Sasa).
- The evidence string names the rule that triggered or failed (kendra position, dignity, malefic drishti, retrograde state), so you never ship an opaque verdict.
- Build this with the Vedic Astrology API in 30 minutes: resolve a city, POST birth data, read yogas, present, and evidence.
Vedic yoga detection is the analysis that decides whether a specific planetary combination is actually formed in a birth chart, not whether it exists in a textbook. A yoga like Gajakesari only counts if Jupiter sits in a kendra from the Moon, is free of malefic aspect, and is not retrograde. Get one of those three rules wrong and you tell a user they have a powerful yoga they do not have. The chart-driven yoga detection endpoint solves this by computing the kundli from birth data, running the classical rules in code, and returning a present verdict with a plain-language evidence string for each of 12 named yogas. This post explains what those 12 yogas are, how the detection rules work, why automated detection beats hand-rolled logic, and how to call the endpoint end to end.
What does the yoga detection endpoint actually do?
The endpoint takes birth data, computes a sidereal Vedic chart, and runs classical detection rules against it, returning a present boolean and a classical-text evidence string for each of 12 named yogas. It is a chart-driven analyzer, not a content lookup. You send date, time, latitude, longitude, and timezone, and you receive an array of yoga verdicts plus a total count of how many are present (0 to 12).
The detection is degree- and house-based. Each yoga has its own rule set drawn from classical sources: Brihat Parashara Hora Shastra (BPHS), Mantreswara Phaladeepika, and B.V. Raman Three Hundred Important Combinations. The engine checks kendra relationships, dignity (own sign and exaltation), Vedic drishti from malefics, and retrograde state, then writes the result into the evidence field so the verdict is auditable rather than a black box.
Classical yogas detected from the chart. Seven Moon and conjunction yogas plus the five Pancha Mahapurusha yogas, each returned with a present verdict and classical-text evidence.
Ready to build this? Vedic Astrology API gives you chart-driven yoga detection with classical-text evidence behind one key. See pricing.
Which 12 yogas does the detector check?
The detector checks exactly 12 classical yogas: seven that involve the Moon or planetary conjunctions, plus the five Pancha Mahapurusha yogas formed from the lagna. Each row below lists the formation rule the engine actually applies and the quality it reports. The five Pancha Mahapurusha yogas require their planet in its own sign or exaltation AND in a kendra (1, 4, 7, 10) counted from the lagna, not from the Moon.
| Yoga | Formation rule applied | Quality |
|---|---|---|
| Gajakesari | Jupiter in a kendra from Moon, free of malefic drishti, not retrograde | Positive |
| Sunapha | A planet other than Sun, Moon, Rahu, Ketu in the 2nd from Moon | Positive |
| Anapha | A qualifying planet in the 12th from Moon | Positive |
| Dhurdhura | Qualifying planets in BOTH the 2nd and 12th from Moon | Positive |
| Kemadruma | No qualifying planet in either the 2nd or 12th from Moon | Negative |
| Chandra Mangala | Moon and Mars conjunct or opposed within a 10 degree orb | Negative |
| Budha-Aditya | Mercury conjunct Sun within a 10 degree orb | Positive |
| Ruchaka | Mars in own sign or exaltation AND in a kendra from lagna | Positive |
| Bhadra | Mercury in own sign or exaltation AND in a kendra from lagna | Positive |
| Hamsa | Jupiter in own sign or exaltation AND in a kendra from lagna | Positive |
| Malavya | Venus in own sign or exaltation AND in a kendra from lagna | Positive |
| Sasa | Saturn in own sign or exaltation AND in a kendra from lagna | Both |
How does the Gajakesari rule decide present or absent?
Gajakesari uses a strict three-rule definition, and all three must hold for the verdict to be present. Rule one: Jupiter must sit in a kendra (1, 4, 7, or 10) counted from the Moon. Rule two: Jupiter must be free of Vedic drishti from a natural malefic, which the engine treats as Mars, Saturn, a debilitated Sun in Libra, or Rahu and Ketu sharing Jupiter sign. Rule three: Jupiter must not be retrograde.
When the verdict is absent, the evidence string names the exact rule that failed, for example that Jupiter is not in a kendra from the Moon, or that Jupiter is in kendra but aspected by Saturn, or that Jupiter is in kendra and clean but retrograde. When present, the evidence adds non-gating strengtheners drawn from classical practice: Moon outside the 6th, 8th, or 12th house, Moon at least four houses from the Sun, and Moon not in Scorpio. This separation of gating rules from strengtheners is what lets you show a user why a yoga formed, not just that it did.
How do the five Pancha Mahapurusha yogas form?
Each Pancha Mahapurusha yoga requires one specific planet to be both dignified and angular. The planet must be in its own sign or its exaltation sign, AND it must occupy a kendra (1, 4, 7, or 10) counted from the lagna, using whole-sign houses. The five yogas map one planet each: Ruchaka to Mars, Bhadra to Mercury, Hamsa to Jupiter, Malavya to Venus, and Sasa to Saturn. These rules follow BPHS chapter 75 and Phaladeepika chapter 6.
The evidence string spells out both halves of the test. If Venus is exalted in Pisces and sits in the 7th house from lagna, the Malavya verdict reports the dignity and the kendra house together. If the dignity is met but the planet falls outside a kendra, the evidence says so explicitly, which surfaces the common almost-present case. Counting from the lagna rather than the Moon is the detail most hand-rolled implementations get wrong, because the Moon-based yogas above count from the Moon and developers tend to reuse one helper for both.
Why does automated detection beat hand-rolled logic?
Automated detection wins because the rules are unforgiving and the failure mode is silent. Yoga logic mixes kendra counting from two different reference points (Moon for the conjunction yogas, lagna for Pancha Mahapurusha), dignity tables per planet, drishti rules where Mars aspects the 4th and 8th and Saturn the 3rd and 10th, and retrograde gating. A single sign-offset bug produces a confident wrong answer that no type checker catches.
The endpoint runs one verified rule set against an accurate sidereal chart, so the same birth data yields the same auditable verdict every time. The evidence field means you do not just get a boolean, you get the reasoning, which you can log, display, or test against. This is part of 43 Vedic endpoints, itself part of 131 endpoints across 10 insight domains like Western astrology, numerology, and tarot, all behind one key. You skip stitching together libraries with different ayanamsa defaults and house conventions.
The detector covers 12 classical yogas, not the full glossary. There is a separate 300-entry yoga glossary at GET /yoga and GET /yoga/{id} that is a dictionary lookup and inspects no chart. Do not expect the detector to auto-detect Raja Yoga, Dhana Yoga, or Nabhasa yogas: those live only in the glossary and are not part of the 12 chart-driven detection rules. Use the glossary for browsing and definitions, and the detect endpoint for present or absent verdicts on the 12.
How do I call the yoga detection endpoint?
Resolve coordinates first, then POST the birth data. Any chart endpoint needs latitude, longitude, and a timezone, so call GET /location/search?q={city} to get those values, then feed them into POST /vedic-astrology/yoga/detect. The response carries yogas (the array of 12 verdicts), total (count where present is true), and birthDetails (an echo of the resolved input). For each entry, read the present boolean and the evidence string.
# Step 1: resolve the city to coordinates and timezone
curl -s "https://roxyapi.com/api/v2/location/search?q=Delhi" \
-H "X-API-Key: YOUR_KEY"
# Step 2: detect yogas using the resolved values
curl -s "https://roxyapi.com/api/v2/vedic-astrology/yoga/detect" \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"date": "1990-07-04",
"time": "10:12:00",
"latitude": 28.6139,
"longitude": 77.209,
"timezone": "Asia/Kolkata"
}'
const base = "https://roxyapi.com/api/v2";
const headers = { "X-API-Key": "YOUR_KEY" };
// Step 1: resolve the city
const loc = await fetch(`${base}/location/search?q=Delhi`, { headers });
const { cities } = await loc.json();
const c = cities[0];
// Step 2: detect yogas
const res = await fetch(`${base}/vedic-astrology/yoga/detect`, {
method: "POST",
headers: { ...headers, "Content-Type": "application/json" },
body: JSON.stringify({
date: "1990-07-04",
time: "10:12:00",
latitude: c.latitude,
longitude: c.longitude,
timezone: c.timezone,
}),
});
const data = await res.json();
console.log(`${data.total} of ${data.yogas.length} yogas present`);
for (const yoga of data.yogas) {
if (yoga.present) console.log(`${yoga.name}: ${yoga.evidence}`);
}
import requests
base = "https://roxyapi.com/api/v2"
headers = {"X-API-Key": "YOUR_KEY"}
# Step 1: resolve the city
loc = requests.get(f"{base}/location/search", params={"q": "Delhi"}, headers=headers)
city = loc.json()["cities"][0]
# Step 2: detect yogas
res = requests.post(
f"{base}/vedic-astrology/yoga/detect",
headers={**headers, "Content-Type": "application/json"},
json={
"date": "1990-07-04",
"time": "10:12:00",
"latitude": city["latitude"],
"longitude": city["longitude"],
"timezone": city["timezone"],
},
)
data = res.json()
print(f"{data['total']} of {len(data['yogas'])} yogas present")
for yoga in data["yogas"]:
if yoga["present"]:
print(f"{yoga['name']}: {yoga['evidence']}")
Full request and response schemas live in the API reference. Accuracy of the underlying chart positions is documented on the methodology page.
FAQ
What is Vedic yoga detection?
Vedic yoga detection is the process of scanning a birth chart to decide whether specific classical planetary combinations are actually formed. Each yoga has a precise rule, such as a planet being in a kendra from the Moon or in its exaltation sign. The detection endpoint applies these rules to a computed kundli and returns a present or absent verdict for each yoga.
How many yogas does the detection endpoint find?
The endpoint detects exactly 12 classical yogas: Gajakesari, Sunapha, Anapha, Dhurdhura, Kemadruma, Chandra Mangala, Budha-Aditya, and the five Pancha Mahapurusha yogas (Ruchaka, Bhadra, Hamsa, Malavya, Sasa). The response includes a total field counting how many of the 12 are present in the given chart, ranging from 0 to 12.
Does the detector find Raja Yoga or Dhana Yoga?
No. Raja Yoga, Dhana Yoga, and Nabhasa yogas are not part of the 12 chart-driven detection rules. They appear only in the separate 300-entry glossary at GET /yoga and GET /yoga/{id}, which is a dictionary lookup that inspects no birth chart. Use the glossary for definitions and the detect endpoint for present or absent verdicts on the 12.
What is the evidence field in the response?
The evidence field is a human-readable string that names the exact rule which triggered or failed the detection. For Gajakesari it might report that Jupiter is in a kendra from the Moon, free of malefic drishti, and not retrograde, along with strengtheners. For an absent yoga it states which rule failed, so you can display or log the reasoning rather than an opaque boolean.
What birth data does the yoga detection endpoint require?
It requires date in YYYY-MM-DD format, time in 24-hour HH:MM:SS format, latitude and longitude in decimal degrees, and an optional timezone as either decimal hours from UTC or an IANA name like Asia/Kolkata. Timezone defaults to 5.5 (IST). Resolve latitude, longitude, and timezone with GET /location/search before calling the endpoint.
Conclusion
Vedic yoga detection only earns trust when the rules are exact and the verdict is explainable, which is why the endpoint returns a present boolean and a classical-text evidence string for each of 12 named yogas rather than a guess. Resolve a city, POST the birth data, and read the array to power kundli apps, matrimonial tools, and astrology chatbots without rebuilding the math yourself. Start with the Vedic Astrology API and pricing.