← Recipes

A remedies screen: gemstone, rudraksha and puja from one birth

Three Free-plan endpoints each return one kind of traditional remedy for a birth chart, and each says which chart facts it reasoned from. The job of the integration is to merge them into one honest card: what is suggested, why, and with which caveats.

You build
One remedies card per user: gemstone, rudraksha, top pujas and temples, with reasons and caveats.
Code
Node.js, Python - no SDK, runnable as shown

Updated

Three endpoints, one body

EndpointPrimary pick based onAlso returns
POST /v1/remedies/gemstoneLagna lordAlternates, stones for afflicted planets, contraindications, the 36-stone catalog
POST /v1/remedies/rudrakshaLagna lordBeads for afflicted planets, mantra, cautions, the 21-bead catalog
POST /v1/remedies/pujaActive doshas, then the running mahadashaAll 42 pujas ranked, a rationale per row, and a temple_guide for the top dosha

All three take the plain birth object and are on the Free plan, so a full card is three billable calls. They are independent: run them in parallel.

Node: build the card

javascript
// remedies.mjs - Node 18+, server-side. All three endpoints are on the Free plan.
const API = "https://api.astronode.dev";
const birth = { date: "1973-04-24", time: "17:25:00", tz_offset_minutes: 330, lat: 19.076, lng: 72.8777 };

const post = async (path) => {
  const res = await fetch(API + path, {
    method: "POST",
    headers: { authorization: `Bearer ${process.env.ASTRONODE_API_KEY}`, "content-type": "application/json" },
    body: JSON.stringify(birth),
  });
  return (await res.json()).data;
};

const [gem, rud, puja] = await Promise.all([
  post("/v1/remedies/gemstone"),
  post("/v1/remedies/rudraksha"),
  post("/v1/remedies/puja"),
]);

// Every response repeats the chart facts it reasoned from - use them for "why".
const facts = gem.chart_facts;
const activeDoshas = Object.entries(facts.doshas).filter(([, on]) => on).map(([k]) => k);

const card = {
  why: { lagna_lord: facts.lagna_lord, dasha: facts.current_dasha_planet, doshas: activeDoshas },
  // Saturn's transit is reported separately: Dhaiya phases are not Sade Sati.
  saturn: facts.saturn_transit,
  gemstone: { name: gem.primary.name, avoid: gem.primary.contraindications },
  rudraksha: `${rud.primary.mukhi}-mukhi (${rud.primary.ruling_deity})`,
  puja: puja.prioritized.slice(0, 3).map((p, i) => `${p.name}: ${puja.rationale[i]}`),
  temples: puja.temple_guide?.temples.map((t) => t.name) ?? [],
  // Show these, not your own wording: catalog entries are still under review.
  review: [gem.primary.review_status, rud.primary.review_status],
  disclaimer: gem.disclaimer.text,
};
console.log(JSON.stringify(card, null, 2));
text
$ node remedies.mjs
{
  "why": {
    "lagna_lord": "mercury",
    "dasha": "jupiter",
    "doshas": [
      "kaal_sarp"
    ]
  },
  "saturn": {
    "as_of": "2026-12-01T16:16:22.182Z",
    "active": true,
    "phase": "ardhashtama"
  },
  "gemstone": {
    "name": "Emerald (Panna)",
    "avoid": [
      "Avoid when Mercury is combust.",
      "Not paired with pearl or red coral by some traditional rules."
    ]
  },
  "rudraksha": "4-mukhi (Brahma)",
  "puja": [
    "Kaal-sarp-shanti: Addresses active dosha: Kaal Sarp Dosha",
    "Pratyangira-homa: Addresses active dosha: Kaal Sarp Dosha",
    "Guru-shanti / Brihaspati-puja: Addresses the current mahadasha planet (jupiter)."
  ],
  "temples": [
    "Trimbakeshwar",
    "Mannarasala"
  ],
  "review": [
    "pending_astrologer_pass",
    "pending_astrologer_pass"
  ],
  "disclaimer": "Remedy recommendations are traditional, cultural, and informational. They are not medical, financial, legal, or relationship advice; they are not a substitute for professional consultation. Use them as cultural context, not prescriptive instruction."
}
  • `chart_facts` is your "why". Each response repeats the facts it used: lagna_lord (Mercury here, hence emerald and the 4-mukhi bead), the dosha flags (Kaal Sarp is on, hence Kaal-sarp-shanti first), afflicted_planets, current_dasha_planet, and saturn_transit (as_of, active, phase). Render these rather than writing your own explanation.
  • Saturn's transit is not the same as Sade Sati. Here saturn_transit.phase is ardhashtama (a Dhaiya phase) while doshas.sade_sati is false: the flag is true only in the rising, peak and setting phases. Show the phase as its own line; saturn_transit.as_of is the moment of the request, so it changes daily.
  • `prioritized` is the whole catalog, ranked. All 42 pujas come back, best first, and rationale[i] explains prioritized[i]. Show the first three to five.
  • `temple_guide` is not guaranteed. Here it named two temples for Kaal Sarp, but its next_dates list was empty in our run. Use optional chaining, as above, and hide empty parts.

Python: group pujas by reason

A ranked list of 42 is hard to scan. Grouping by what each puja addresses - an active dosha, the current dasha lord, or neither - gives a screen with natural sections, using only fields from the same response:

Python 3.9+
# puja_groups.py - Python 3.9+, standard library only.
import json, os, urllib.request

API = "https://api.astronode.dev"
KEY = os.environ["ASTRONODE_API_KEY"]
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/remedies/puja",
    data=json.dumps(birth).encode(),
    headers={"Authorization": "Bearer " + KEY, "Content-Type": "application/json"},
)
data = json.load(urllib.request.urlopen(req))["data"]
facts = data["chart_facts"]
active = {k for k, on in facts["doshas"].items() if on}

groups = {"dosha": [], "dasha": [], "other": []}
for p in data["prioritized"]:
    if active & set(p["addresses"]["doshas"]):
        groups["dosha"].append(p["id"])
    elif facts["current_dasha_planet"] in p["addresses"]["planets"]:
        groups["dasha"].append(p["id"])
    else:
        groups["other"].append(p["id"])

print("active doshas:", sorted(active), "| dasha:", facts["current_dasha_planet"])
print({k: (len(v), v[:3]) for k, v in groups.items()})
text
$ python3 puja_groups.py
active doshas: ['kaal_sarp'] | dasha: jupiter
{'dosha': (2, ['kaal_sarp_shanti', 'pratyangira_homa']), 'dasha': (10, ['guru_shanti', 'navagraha_shanti', 'graha_shanti_yagya']), 'other': (30, ['budha_shanti', 'ganesha_puja', 'tripura_sundari_archana'])}

Before you ship a remedies screen

  • Every catalog entry currently carries review_status: "pending_astrologer_pass". Surface it - a badge or a line of copy - and show disclaimer.text; its topics list (medical, financial, legal, relationship, religious) is what the remedies must not be presented as advice on.
  • Gemstone contraindications and rudraksha cautions are part of the recommendation, not footnotes. A stone shown without its "avoid when…" line is a different recommendation.
  • Each of the three calls recomputes the chart. The card depends only on the birth data (and the running dasha, which changes over years, not days), so cache it by birth data and refresh it occasionally rather than on every view.
  • Lal Kitab remedies are a separate tradition with their own Pro endpoint; see the Lal Kitab report recipe.

Questions

What do I end up with?
One remedies card per user: gemstone, rudraksha, top pujas and temples, with reasons and caveats. The code is in Node.js and Python.
Which endpoints does this recipe call, and in what order?
3 endpoints, in this order: Gemstone Recommendation (POST /v1/remedies/gemstone), then Rudraksha Recommendation (POST /v1/remedies/rudraksha), then Puja Recommendation (POST /v1/remedies/puja).