Skip to content
Bishal Pahari
Back to all work

Navapatra

A kundali, panchang and Nepali calendar API that publishes its own accuracy tests.

Role
Design and engineering, end to end
Year
2026
Stack
TypeScript, Hono, Zod, Astro, React
Links
Navapatra homepage: "Kundali, panchang and Nepali calendar APIs you can verify", beside a North Indian sample chart and the request that drew it

The problem

Apps built for Nepali users keep needing the same three things: a kundali (birth chart), a daily panchang, and dates in Bikram Sambat, the official calendar of Nepal. There was no single API that did all three well.

  • Nepal’s calendar wasn’t served. When I surveyed the public APIs in October 2026, none accepted or returned solar Bikram Sambat dates. The “Vikram Samvat” some offer is the Indian lunisolar era, a different calendar.
  • Results were hard to check. Vendors rarely say which ayanamsha or node type they use, or how they handle historical timezones, and none publishes a test suite you can rerun.
  • Nepali businesses couldn’t pay. Every vendor billed in INR or USD by card.

Teams ended up stitching together a date converter, an Indian astrology API and their own translations.

What I built

A private calculation engine behind a public REST API, plus everything a developer touches around it:

  • The engine. Planet positions come from astronomy-engine, with my own implementation of the Lahiri ayanamsha, lunar nodes, lagna and panchang maths on top. Separate packages handle Bikram Sambat and Nepal Sambat conversion, dashas and guna milan (horoscope matching).
  • The API. Built with Hono. Every route is defined once in a shared contracts package, and that one definition drives request validation, the OpenAPI document, the docs playground and the dashboard’s typed client.
  • Output in English, Nepali and Hindi, including North and South Indian chart SVGs.
  • The developer surface. A docs site, an MCP server so AI assistants can call the API, and a dashboard for keys, usage and credits, which are bought in Nepali rupees.
  • A marketing site with free tools: kundali, guna milan, a date converter and the daily panchang.

Decisions worth explaining

Swiss Ephemeris could not ship. It is the reference library for this kind of software, but its AGPL licence would force the API’s source open, and its commercial licence excludes serving third parties through an API. So production runs on the MIT-licensed astronomy-engine, behind an interface that lets me swap the source later. Swiss Ephemeris runs only in a private test harness, to produce the reference values the engine is checked against.

Accuracy is published, not claimed. The engine is compared with Swiss Ephemeris on 5,433 births: 5,000 random ones between 1900 and 2100, plus 433 edge cases near sign, nakshatra and tithi boundaries and around clock changes. Every release must stay inside hard limits on every sample. The report also says where it misses: Mercury to Saturn reach 20.2 arcseconds against a 5 arcsecond target. Anyone can download 500 of those births and rerun them.

Navapatra’s published results: worst case across 5,428 compared births is 4.2 arcseconds for the Moon, 20.2 for the Sun and planets, 4.7 for the lagna and 0.56 days for dasha dates

Historical timezones matter. Nepal was UTC+05:30 until 1986 and has been +05:45 since. Get that wrong for an older birth and the lagna moves by degrees. Timezone data is pinned per release, and every response echoes the ayanamsha, node type, timezone database and engine version it used.

Same input, same bytes. Responses are deterministic: the same request on the same engine version returns identical JSON, and dasha output never depends on the server clock. That is what makes the published tests meaningful.

Birth data is never stored. The API is stateless and never logs request or response bodies.

Where it stands

Navapatra is live at navapatra.com. The engine is at version 0.1.0, and the first accuracy report was published on 21 October 2026.