← Guides

Kaal Sarp dosha detection: the rule, the twelve types, the edges

Kaal Sarp is a geometric test: are all seven visible planets on one side of the Rahu-Ketu axis? The geometry is exact, but texts and software differ on what counts, what the variants are called and what cancels the dosha. This is what the API does at each of those points.

Updated

The test

POST /v1/dosha/kaal-sarp (Hobby plan) takes the plain birth body. The engine measures each of the seven planets - Sun, Moon, Mars, Mercury, Jupiter, Venus, Saturn - forward from Rahu in sidereal longitude, from 0° to 360°. Ketu is always at 180°. The dosha is present when every planet lies strictly between 0° and 180° (between Rahu and Ketu going forward through the zodiac) or every planet lies strictly between 180° and 360°.

  • Both sides count, and both get the same names. Some texts call the Ketu-to-Rahu side by a separate name; the API does not distinguish them.
  • The ascendant is not tested. Only the seven planets are.
  • Rahu is the mean node, and longitudes are Lahiri sidereal - see ayanamsa.

The sample birth has the dosha. Every offset is between 0° and 180°:

`planets_relative_to_rahu` for the sample birth (rounded)
Planetdegrees_from_rahu
Moon9.04
Jupiter28.86
Mars39.08
Mercury89.25
Sun112.92
Venus116.73
Saturn156.52

The response is present: true, partial: false, type: "Shankhpal", house_of_rahu: 4, house_of_ketu: 10, plus that per-planet list, which is there so you can apply your own margins or rules on top.

Twelve types, chosen by Rahu's house

The named type depends only on the house Rahu occupies, counted whole-sign from the lagna (see house systems). type is null when the dosha is absent.

Rahu in houseTypeRahu in houseType
1Anant7Takshak
2Kulik8Karkotak
3Vasuki9Shankhachood
4Shankhpal10Ghaatak
5Padma11Vishdhar
6Mahapadma12Sheshnag

Because the type hangs on the lagna, it changes with birth time even when the planets barely move. Rahu stays in Sagittarius all night of 23-24 April 1973, but a birth at 00:00 IST on the 24th returns type: "Anant", house_of_rahu: 1 and a birth at 01:00 returns "Sheshnag", house 12: the lagna moved on a sign in between. If your users' birth times are approximate, the presence of the dosha is usually stable and its name is not.

What `partial` means here

Many writers use "partial Kaal Sarp" for a chart where one planet sits outside the Rahu-Ketu arc. The API does not: one planet outside, by any amount, gives present: false. partial: true is narrower - all planets are on one side except one or more sitting on the axis itself, within 0.5° of Rahu or Ketu, on either side of it.

The Moon makes the edge easy to see, because it moves about 13° a day and so crosses Rahu within hours. Keep the sample's date and place and move the clock back:

The Moon crossing Rahu, 23-24 April 1973, Mumbai
Birth time (IST)Moon from Rahupresentpartialtype
23 Apr, 17:25357.11°falsefalsenull
23 Apr, 23:00359.88°truetrueAnant
24 Apr, 00:000.37°truefalseAnant
24 Apr, 17:25 (sample)9.04°truefalseShankhpal

At 23:00 the Moon is 0.12° behind Rahu and the other six planets are ahead of it: the Moon is on the axis, so the dosha is present and partial. An hour later the Moon has crossed and it is present in full; at 17:25 the day before, the Moon is 2.89° behind Rahu, well outside the tolerance, and the answer is false. (Before engine 1.4.1 the tolerance worked only at the Ketu end, and the 23:00 chart came back false.) If you want a softer band ("a planet within a degree of the axis"), compute it from planets_relative_to_rahu rather than relying on partial.

kaal_sarp.py - the planet closest to the axis

python
# kaal_sarp.py - python3 kaal_sarp.py (stdlib only)
import json
import os
import urllib.request

API = os.environ.get("ASTRONODE_API_URL", "https://api.astronode.dev")
KEY = os.environ["ASTRONODE_API_KEY"]  # server-side only

birth = {"date": "1973-04-24", "time": "17:25:00", "tz_offset_minutes": 330,
         "lat": 19.076, "lng": 72.8777}

req = urllib.request.Request(
    API + "/v1/dosha/kaal-sarp",
    data=json.dumps(birth).encode(),
    headers={"Authorization": "Bearer " + KEY, "Content-Type": "application/json"},
)
data = json.load(urllib.request.urlopen(req))["data"]

print("present:", data["present"], "partial:", data["partial"], "type:", data["type"])
if data["present"]:
    # Distance of each planet to the nearer end of the axis (Rahu at 0, Ketu at 180).
    def to_axis(d):
        return min(d, abs(180 - d), 360 - d)

    nearest = min(data["planets_relative_to_rahu"],
                  key=lambda p: to_axis(p["degrees_from_rahu"]))
    print("closest to the axis: %s, %.2f deg"
          % (nearest["name"], to_axis(nearest["degrees_from_rahu"])))

Output against the API:

text
present: True partial: False type: Shankhpal
closest to the axis: Moon, 9.04 deg

No cancellation is applied

The Kaal Sarp response has no cancelled flag and no list of reasons. The endpoint reports the geometry and stops. That is a deliberate contrast with POST /v1/dosha/mangal, which returns cancelled and cancellation_reasons because its cancellation rules are sourced and implemented. The conditions that various writers give for Kaal Sarp being cancelled or weakened are not consistent with one another, and none is applied here.

  • If your product applies a cancellation rule, apply it on your side and label it as yours - the inputs you need are in this response and in POST /v1/charts/birth.
  • Do not treat present: true as a verdict. The interpretation block says only that the dosha is present and its type, with a disclaimer to read it alongside the rest of the chart.
  • The result is fixed for a birth: no date input, no transit. It is safe to compute once and store.

Questions

How does the API decide that Kaal Sarp dosha is present?
All seven planets from the Sun to Saturn must lie on one side of the Rahu-Ketu axis, measured in sidereal longitude. The ascendant is not tested, and a single planet outside the arc by any amount means the dosha is reported absent.
How is the Kaal Sarp type chosen?
By the house Rahu occupies, counted whole-sign from the lagna: Anant for the 1st house through Sheshnag for the 12th. Because it depends on the lagna, the type can change with birth time while the dosha itself stays present.
Does the Kaal Sarp endpoint apply cancellation rules?
No. It reports the geometry and the per-planet distances from Rahu, with no cancelled flag. If your product applies a cancellation rule, apply it on your side using those distances and the birth chart.