Matching and doshas
Dosha API and yoga checks, in plain English
Updated
How the dosha API works
- 1A yoga or a dosha is a pattern in a birth chart, set by a fixed rule about where the planets sit.
- 2Each rule is checked against the chart. Here two yogas are tested, and Mars is checked for manglik dosha.
- 3The API returns each result with the rule it used and the placements that decided it, including the near misses.
POST /v1/dosha/pitra200 OK{
"dosha": "pitra",
"present": true,
"rule": "Sun, Rahu or Ketu afflicting the 9th house or its lord, or the 9th lord placed in a dusthana",
"answer": {
"status": "present",
"headline": "Pitra dosha is present, because Ketu sits with the ruler of your 9th house."
}
}Call the dosha API from your code
Send the details as JSON with your API key in the Authorization header. Copy the code, set ASTROLOGY_API_KEY to your key, and run it.
POST /v1/dosha/manglik
# John Doe, born Aug 15, 1990, 10:30 AM, New York
curl -X POST "https://apiforastrology.com/api/astrology/v1/dosha/manglik" \
-H "Authorization: Bearer $ASTROLOGY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"year":1990,"month":8,"day":15,"hour":10,"minute":30,"second":0,"latitude":40.7128,"longitude":-74.006,"timezone":"America/New_York"}'{
"dosha": "manglik",
"rule": "Mars occupying house 1, 2, 4, 7, 8 or 12, counted separately from the ascendant, from the Moon and from Venus",
"present": true,
"by_reference": {
"natal": {
"present": true,
"mars_house_from_reference": 8,
"reference": "natal"
},
"lunar": {
"present": true,
"mars_house_from_reference": 12,
"reference": "lunar"
},
"venus": {
"present": false,
"mars_house_from_reference": 10,
"reference": "venus"
}
},
"cancellations": [
"Mars is in its own sign"
],
"cancellation_codes": [
"own_sign"
],
"note": "cancellations are reported, not applied -- weighing them is the astrologer's judgment",
"answer": {
"status": "present",
"headline": "Manglik dosha is present, counted from your ascendant and your Moon. The main checks count from your ascendant (the sign rising at your birth) and from your Moon. It is common: about three in four charts have it from one of them.",
"meaning": "Manglik is about Mars, the planet of energy and heat, sitting where it can bring clashes into married life. Astrologers read it mainly when matching two charts, where the tradition prefers both partners to have it or neither.",
"exception": "Your chart also has a classical exception: Mars is in its own sign. Whether it cancels the dosha is for an astrologer to weigh.",
"next": [
"Don't worry about it on its own. It matters mostly when two charts are matched.",
"In matching, a partner who is also Manglik balances it, which the tradition accepts.",
"If it worries you, ask an astrologer about the exceptions in your chart and the usual remedies."
],
"note": "A dosha is a tendency to keep in mind, not a fixed fate. The rest of your chart decides how much it shows."
},
"meta": {
"ayanamsa": "lahiri",
"ayanamsa_value": 23.7260727,
"julian_day": 2448119.10483,
"ephemeris": "JPL DE440s",
"node": "true",
"timezone": {
"source": "zone",
"offset_hours": -4,
"zone": "America/New_York",
"abbreviation": "EDT",
"dst": true,
"dst_hours": 1,
"ambiguous_resolved_by_fold": null,
"note": "read from the IANA tz database at this instant, so daylight saving and historical offset changes are included"
}
}
}What the dosha API returns
- Manglik, kaal sarp and pitra dosha, one at a time or all three: present or not, the rule tested, and the placements that decided it.
- A plain answer for each dosha: a headline, what it means, any exception in the chart, and what to do next.
- Manglik counted three ways, from the rising sign, the Moon and Venus. Known exceptions are listed but not applied.
- The papa samyam count: the manglik check asked of all five difficult planets, as used in matching.
- Yogas found in the chart, each with its rule and the chart facts that met it. Also yogas that came close, with the reason they did not form.
- The ruler of the rising sign (lagnesh) and the yogakaraka, the planet that helps most for this rising sign.
- Sade sati: every one in the 100 years from birth, the phase running now (rising, peak or setting), and the two shorter Saturn periods (dhaiya).
The dosha answers come from fixed rules, not an AI model, so the same chart always gets the same words. The rulebook lists 104 yogas, including the 32 Nabhasa yogas, each with its own ID.
Dosha API endpoints
POST /v1/yogasYogas: planetary combinations found and not foundPOST /v1/dosha/{name}Doshas: manglik, kaal sarpa, pitra, or the papa countPOST /v1/sadesatiSade sati: Saturn's 7.5-year transit around the birth Moon
What it uses from your plan
Each call to these endpoints uses 1 call from your monthly allowance. Failed requests are free.
See the plansTry it free
No code needed
Manglik dosha check
Whether Mars makes a chart manglik, counted three ways, with any exceptions.
Check for manglik doshaSade sati check
Whether sade sati, Saturn's 7.5-year pass around your Moon sign, is running for you, which phase, and the dates.
Check my sade sati
One chart through the dosha API
POST /v1/dosha/all runs all three checks in one call. Each result names the rule it tested and the placements that decided it. Here is John Doe's chart.
| Dosha | Rule tested | John Doe's result |
|---|---|---|
| Manglik | Mars in house 1, 2, 4, 7, 8 or 12, counted from the rising sign, the Moon and Venus | Present from the rising sign (Mars in house 8) and the Moon (house 12), but not from Venus (house 10). One exception is listed, not applied: Mars is in its own sign. |
| Kaal sarp | All seven planets from the Sun to Saturn on one side of the Rahu-Ketu axis | Not present. The Moon, Mars, Jupiter and Venus sit on one side, and the Sun, Mercury and Saturn on the other. |
| Pitra | The Sun, Rahu or Ketu harming the 9th house or its ruler, or the 9th house ruler in house 6, 8 or 12 | Present. Ketu sits with Venus, the ruler of the 9th house. |
Real output for John Doe, born Aug 15, 1990, 10:30 AM, New York.
The rules behind the dosha API
Manglik is Mars in house 1, 2, 4, 7, 8 or 12, counted from the rising sign, the Moon and Venus (DO-01). Its classical exceptions are reported, not applied (DO-02). Kaal sarp means all seven planets from the Sun to Saturn sit on one side of the Rahu-Ketu axis (DO-03). Rahu and Ketu are two points on the Moon's path, always opposite each other. Pitra dosha looks at the 9th house and its ruler (DO-04). Each yoga has its own rule, from Ruchaka (YG-01) to the Nabhasa yogas (YG-33 onward). Sade sati dates include every time Saturn crosses a sign boundary (SS-03), and the dhaiya periods are reported apart from it (SS-02).
How we check the numbers
Every answer here starts from planet positions worked out from NASA JPL planet data (DE440). We test them against NASA JPL Horizons, NASA's planet position service. On 25,571 positions from 1850 to 2149, the Sun and planets agree within 0.001 arc seconds. The Moon agrees within 0.011. On 2,000 random birth charts, the rising sign agrees with Swiss Ephemeris within 0.004. An arc second is 1/3,600 of a degree. Our tests fail if a result drifts past these figures.
A practicing astrologer reviews the rules behind these answers. Each rule has an ID you can look up in the public rulebook.
See how we test accuracyTerms used here
Who uses it
- Matrimony and matchmaking sitesKundli matching for every profile pair: the 36-point score, manglik checks and a clear verdict. It works even for members with no birth time.

- Astrology appsCharts, dashas, daily readings and a printable report from one API. A small team can ship a full astrology app with it.

- Puja and spiritual storesGemstone, rudraksha and puja suggestions tied to each customer's chart, with the reason for every one.

- AI assistants and chatbotsReal charts and plain answers for AI assistants and chatbots. Give the model a few endpoints as tools (function calling), so it quotes a computed result, not a guess.

- Astrologer consultation platformsCharts, dashas and yogas for every client, with the rule behind each answer. Send a printable report after the session.

From the blog

· 11 min read
Raj Yoga and Gajakesari Yoga: How Apps Find Them
How an app tests a birth chart for raj yoga and gajakesari yoga, with code and real counts.
Read
· 9 min read
Kaal Sarp Dosh: How the Check Works and Where Apps Differ
How a kaal sarp dosh check works, and why apps disagree.
Read
· 6 min read
AI Astrologer: Build One That Gets the Chart Right
Why an AI astrologer or ChatGPT astrology chat often invents a birth chart, and the fix.
Read
Dosha API questions
All questionsWhich doshas can I check?
Manglik, kaal sarp and pitra dosha, one at a time or all three with POST /v1/dosha/all. POST /v1/dosha/papa gives the papa samyam count used in matching. Each result says whether the dosha is present, the rule tested and the placements that decided it.
Try the manglik checkAre manglik exceptions applied?
No. The API checks Mars from the rising sign, the Moon and Venus, and lists any of four classical exceptions it finds. It never applies them, because astrologers disagree about which ones count, so your app or an astrologer can decide.
Read rule DO-02What about partial kaal sarp dosha?
Kaal sarp means all seven planets from the Sun to Saturn sit on one side of the Rahu-Ketu axis. If a planet is within 1 degree of that axis, the result is marked partial, because schools disagree on whether that breaks the dosha.
What kaal sarp dosh isWhich yogas does the yoga API check for?
Classical ones, each with its own rule ID, such as the five Pancha Mahapurusha yogas, Gajakesari, Budhaditya, Raja, Neecha Bhanga and Parivartana. The Nabhasa yogas are included too. The response lists the yogas that formed and the ones that did not, so you know an absent yoga was checked.
Browse the rulebookWhat does the sade sati endpoint return?
Every sade sati in the 100 years from birth, with dates that include each retrograde crossing. Also the phase running on the date you send: rising, peak or setting. The two shorter Saturn periods, kantaka and ashtama shani, come back separately, because they are not sade sati.
Try the sade sati checkDo dosha results come with remedies?
Not in the dosha response. Remedies are reading sections with their own IDs, such as topic:remedy-kaal-sarp and topic:remedy-pitra-dosha. A chart gets a dosha's remedy section only when it has that dosha, so you can show the two side by side.
About the remediesAstrology API
Call it with a free test key
Create an account and a test key, then call any endpoint on this page. Or try a request in the API reference first.
Your first answer
John Doe, New York
- RisingVirgoHast
- SunCancerAshlesha
- MoonTaurusMrigashira
- MarsAriesKrittika
Real API output. A free test key gets the same answer.
01
Test key: 1,000 test calls a month to build with
02
Free plan: 2,000 live calls a month, no card needed
03
Open rules: every rule is published, so you can check any answer