New Numerology API

Matching and doshas

Dosha API and yoga checks, in plain English

The dosha API from API for Astrology (apiforastrology.com) checks a birth chart for manglik, kaal sarp and pitra dosha, the chart features tradition treats as problems.

Updated

© API for Astrology (apiforastrology.com). "Yogas and doshas explained". All rights reserved. Not to be copied or reused.John Doe's birth chartSunJupiterMercuryMoonMarshouse 8Vesi yogaA planet in the sign after the SunHere: Mercury is thereFormedGajakesari yogaJupiter 1, 4, 7 or 10 from the MoonHere: Jupiter is 3rd from the MoonFormedManglik doshaMars in house 1, 2, 4, 7, 8 or 12Here: Mars is in house 8Present

How the dosha API works

  1. 1A yoga or a dosha is a pattern in a birth chart, set by a fixed rule about where the planets sit.
  2. 2Each rule is checked against the chart. Here two yogas are tested, and Mars is checked for manglik dosha.
  3. 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."
  }
}
Whether John Doe's chart has pitra dosha: the rule tested, and the answer in plain English with the placement that decided it. Real output for John Doe, born Aug 15, 1990, 10:30 AM, New York.

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"}'
Response (lists shortened)200 OK
{
  "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

What it uses from your plan

Each call to these endpoints uses 1 call from your monthly allowance. Failed requests are free.

See the plans

Try it free

No code needed

  • Manglik dosha check

    Whether Mars makes a chart manglik, counted three ways, with any exceptions.

    Check for manglik dosha
  • Sade 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.

DoshaRule testedJohn Doe's result
ManglikMars in house 1, 2, 4, 7, 8 or 12, counted from the rising sign, the Moon and VenusPresent 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 sarpAll seven planets from the Sun to Saturn on one side of the Rahu-Ketu axisNot present. The Moon, Mars, Jupiter and Venus sit on one side, and the Sun, Mercury and Saturn on the other.
PitraThe Sun, Rahu or Ketu harming the 9th house or its ruler, or the 9th house ruler in house 6, 8 or 12Present. 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 accuracy

From the blog

Dosha API questions

All questions
Which 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 check
Are 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-02
What 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 is
Which 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 rulebook
What 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 check
Do 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 remedies

Astrology 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

POST /v1/planets200 OK
  • RisingVirgoHast
  • SunCancerAshlesha
  • MoonTaurusMrigashira
  • MarsAriesKrittika

Real API output. A free test key gets the same answer.

  1. 01

    Test key: 1,000 test calls a month to build with

  2. 02

    Free plan: 2,000 live calls a month, no card needed

  3. 03

    Open rules: every rule is published, so you can check any answer