โ† Recipes

Varshphal: the current year's chart, Muntha and Mudda dasha

A Varshphal (Tajika annual) screen shows the chart for the year a person is in right now. The API casts any year you ask for; the part you have to get right is which year that is, because a Varshphal year starts at the solar return, not on the calendar birthday.

You build
The running Varshphal year: its chart, Muntha, the current Mudda period and the Tajika yogas present.
Code
Node.js, Python - no SDK, runnable as shown

Updated

What year means

Every Varshphal endpoint takes the natal birth plus year, an integer from 1 to 120: the age the solar return opens. year: 1 is the chart for the first birthday. For someone born on 24 April 1973, year: 53 opens in April 2026 and runs to April 2027.

EndpointPlanReturns
POST /v1/varshphal/year-chartHobbyThe solar-return moment and the year chart
POST /v1/varshphal/munthaHobbyMuntha sign, house and classical effect
POST /v1/varshphal/mudda-dashaHobbyThe year's ten Mudda periods with exact start and end
POST /v1/varshphal/yogaHobbyEleven Tajika yogas, present or not

Node: find the running year, then fetch it

javascript
// varshphal.mjs - Node 18+, server-side. All four endpoints: Hobby 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, year) => {
  const res = await fetch(API + path, {
    method: "POST",
    headers: { authorization: `Bearer ${process.env.ASTRONODE_API_KEY}`, "content-type": "application/json" },
    body: JSON.stringify({ ...birth, year }),
  });
  const body = await res.json();
  if (!res.ok) throw new Error(`${path}: ${res.status} ${body.error.code}`);
  return body.data;
};

// `year` is the age the solar return opens (1 = first birthday). The return
// can land a day either side of the calendar birthday, so check it.
const currentVarsha = async (now) => {
  const born = new Date(`${birth.date}T00:00:00Z`);
  let year = now.getUTCFullYear() - born.getUTCFullYear();
  let chart = await post("/v1/varshphal/year-chart", year);
  if (new Date(chart.solar_return.return_utc) > now) {
    year -= 1;
    chart = await post("/v1/varshphal/year-chart", year);
  }
  return { year, chart };
};

const { year, chart } = await currentVarsha(new Date("2026-12-01T00:00:00Z"));
const [muntha, mudda, yogas] = await Promise.all([
  post("/v1/varshphal/muntha", year),
  post("/v1/varshphal/mudda-dasha", year),
  post("/v1/varshphal/yoga", year),
]);

const now = new Date("2026-12-01T00:00:00Z");
const running = mudda.periods.find((p) => new Date(p.start) <= now && now < new Date(p.end));
console.log({
  year,
  opens: chart.solar_return.return_utc,
  return_local: `${chart.solar_return.return_input.date} ${chart.solar_return.return_input.time}`,
  year_lagna: chart.chart.ascendant.sign,
  muntha: `${muntha.sign}, house ${muntha.house} (${muntha.effect})`,
  mudda_now: `${running.lord} until ${running.end.slice(0, 10)}`,
  tajika_present: yogas.yogas.filter((y) => y.present).map((y) => y.name),
});
text
$ node varshphal.mjs
{
  year: 53,
  opens: '2026-04-25T02:07:50.000Z',
  return_local: '2026-04-25 07:37:50',
  year_lagna: 'Taurus',
  muntha: 'Aquarius, house 10 (favorable)',
  mudda_now: 'Rahu until 2026-12-14',
  tajika_present: [ 'ithasala', 'nakta', 'manauu', 'radda', 'tambeera' ]
}

The guess-then-check in currentVarsha costs one extra call only in the few days around a birthday. Pin "now" as the code does when you render a page for a given date, so a cached page and a fresh one agree.

Python: the return moves around the birthday

The solar return is the moment the Sun gets back to its natal sidereal longitude. Over three years for the same person it drifts by about six hours a year and crosses midnight:

Python 3.9+
# solar_returns.py - Python 3.9+, standard library only. Hobby plan.
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}

for year in (52, 53, 54):
    req = urllib.request.Request(
        API + "/v1/varshphal/year-chart",
        data=json.dumps(dict(birth, year=year)).encode(),
        headers={"Authorization": "Bearer " + KEY, "Content-Type": "application/json"},
    )
    d = json.load(urllib.request.urlopen(req))["data"]
    local = d["solar_return"]["return_input"]
    print(year, "opens", local["date"], local["time"], "(UTC", d["solar_return"]["return_utc"] + ")",
          "lagna", d["chart"]["ascendant"]["sign"])
text
$ python3 solar_returns.py
52 opens 2025-04-25 01:32:14 (UTC 2025-04-24T20:02:14.000Z) lagna Capricorn
53 opens 2026-04-25 07:37:50 (UTC 2026-04-25T02:07:50.000Z) lagna Taurus
54 opens 2027-04-25 13:42:38 (UTC 2027-04-25T08:12:38.000Z) lagna Cancer

Year 52 opened on 25 April by the Mumbai clock but on 24 April in UTC. Compare return_utc with the current instant, never the local return_input.date with today's date string - that is the bug that shows a user last year's chart for a day.

Notes

  • The year chart is cast at the birth coordinates with the birth UTC offset (return_input echoes them). There is no field to cast it where the person lives now.
  • Houses are whole-sign, ayanamsa Lahiri, like the natal /v1/charts/birth chart, so the two can be rendered with the same component.
  • Showing several years at once is a job for the async /v1/reports/varshphal-multi-year report (Starter, up to 25 years per job) - see async report jobs.

Questions

What do I end up with?
The running Varshphal year: its chart, Muntha, the current Mudda period and the Tajika yogas present. The code is in Node.js and Python.
Which endpoints does this recipe call, and in what order?
4 endpoints, in this order: Varshphal Annual Chart (Tajika) (POST /v1/varshphal/year-chart), then Muntha (POST /v1/varshphal/muntha), then Mudda Dasha (POST /v1/varshphal/mudda-dasha), then Tajika Yogas (POST /v1/varshphal/yoga).