Build vs. Buy a Vedic Ephemeris: What It Takes to Compute Panchang and Kundli In-House
6 min read
Self-hosting a Vedic ephemeris for Panchang and Kundli: licensing, accuracy, time zones, maintenance and cost, and when an astrology API makes more sense.
Every astrology product reaches the same fork. You can compute charts and Panchangs yourself with an open-source Vedic ephemeris, or call an astrology API and let someone else maintain the engine.
Both are reasonable. This post lays out what each path actually involves, so a CTO or a solo founder can make the call with eyes open. We sell an API, so we have a view, but building is the right answer for some teams and we'll say which.
What "a Vedic astrology engine" really means
An ephemeris tells you where the planets are. That is the foundation, not the product. A working Vedic engine stacks several layers on top:
- Ephemeris. Accurate positions of the Sun, Moon and planets for any instant.
- Ayanamsa. Converting tropical positions to sidereal, usually with Lahiri.
- Lunar nodes and ascendant. Rahu, Ketu and the lagna, which depend on location and exact time.
- Panchang rules. Tithi, nakshatra, yoga, karana and vara, anchored to local sunrise, plus transition times and windows like Rahu Kalam.
- Divisional charts. D9 and others, each with its own mapping rules.
- Dasha. Vimshottari periods from the Moon's nakshatra, to three levels.
- Matching. Ashtakoot Guna Milan's eight factors and their scoring.
- Time and place. Geocoding, IANA time zones, historical offsets, daylight saving.
The ephemeris is the part you can download. Layers 2 through 8 are the part you build.
Option A: build on an open-source ephemeris
Swiss Ephemeris
The best-known choice is the Swiss Ephemeris from Astrodienst. It is highly precise, based on NASA JPL ephemerides, fast, and widely used in astrology software.
Its licensing is the first decision you face. Swiss Ephemeris is dual-licensed: you choose either the GNU Affero General Public License (AGPL) or the Swiss Ephemeris Professional License.
- Under the AGPL, you must place your whole software project under the AGPL or a compatible license. The AGPL's network clause also applies to software users reach over a network, which covers most web and app backends.
- The Professional License is a paid contract with Astrodienst. The September 2026 edition of the contract lists a license at CHF 700 for an unlimited number of projects developed or maintained by the licensee. Read the contract's clauses on server use and API services carefully if you plan to expose calculations to others.
For many commercial apps that means paying for the Professional License. Budget for it, and keep the signed contract on file.
Permissively licensed alternatives
If AGPL doesn't suit you, there are libraries under permissive licenses such as MIT, for example Skyfield (Python, uses JPL ephemeris files) and Astronomy Engine (several languages). These give you accurate astronomy. They do not give you astrology. Ayanamsa, Panchang rules, Dasha and matching are all yours to write.
The hidden work
The library is a weekend. The engine around it is months. The parts teams underestimate:
Time zones and daylight saving. Birth charts need the UTC offset that applied on the birth date in the birth place, including historical changes. Ambiguous and skipped local times around DST need handling, not guessing.
Sunrise. A Panchang day starts at local sunrise, which depends on latitude, longitude, altitude conventions and how you define the sun's upper limb and refraction. Small differences move tithi boundaries.
Regional conventions. Purnimanta vs. Amanta months, festival rules and local Panchang traditions vary. Users compare your output with the calendar on their wall.
Testing. You need reference charts and Panchangs to test against, and someone who can tell a correct chart from a plausible one.
Maintenance. Time zone database updates, new ephemeris files, bug reports from users whose family astrologer disagrees with you.
Option B: buy an astrology API
An API moves all eight layers to someone else. You send a birth object or a date and location, and you get structured results back.
With Mantrilo, for example, one request gives you a Lahiri D1/D9 chart with Vimshottari Dasha:
curl https://api.mantrilo.com/v1/astrology/calculate \
-H "Authorization: Bearer $MANTRILO_API_KEY" \
-H "Content-Type: application/json" \
--data '{
"operation": "chart",
"birth": {
"datetime": "1995-03-14T06:30:00+05:45",
"latitude": 27.7172,
"longitude": 85.3240,
"timezone": "Asia/Kathmandu"
},
"dashaLevels": 1,
"referenceDate": "2026-12-04"
}'The same endpoint covers daily-panchang, match for Guna Milan, chart-image for rendered charts, places for geocoding with time zones, and a catalog of further Vedic, Western and numerology operations.
Want to compare outputs with your own engine? Get a free sandbox key and run the same birth details through both.
What you trade
Cost. A monthly bill that grows with usage. Caching helps a lot here, because charts for fixed inputs never change and a Panchang changes once per place per day.
Latency. A network round trip instead of a function call. For most screens that's invisible; for batch jobs over millions of charts it matters.
Control. You use the provider's conventions. If you need an unusual ayanamsa or a regional rule the API doesn't offer, you're stuck or waiting.
Vendor risk. If the provider changes or disappears, you migrate. Keep your own data model clean so you could.
A cost comparison you can adjust
Here is a simple model. The engineering numbers are assumptions for illustration; replace them with your own.
| Build | Buy (Mantrilo Starter) | |
|---|---|---|
| Library license | CHF 700 one-time (Swiss Ephemeris Professional) or AGPL obligations | Included |
| First version (chart, Dasha, Panchang, matching) | Assumption: 2 to 3 engineer-months | 1 to 3 days of integration |
| Ongoing maintenance | Assumption: 2 to 4 engineer-days a month | Minimal |
| Monthly service cost | Your hosting | $49.99 for 50,000 requests |
At an assumed fully loaded engineering cost of $8,000 a month, the first version alone costs $16,000 to $24,000 before maintenance. That's more than two decades of the Starter plan. The comparison changes at very high volume, or if astrology calculation is your core product rather than a feature.
When building is the right call
Be honest about these. If several apply, build:
- Astrology is your product, and your differentiation is in how you calculate, not just how you present.
- You need conventions no API offers, such as a specific regional Panchang tradition or a custom ayanamsa throughout.
- You run huge batch workloads, like recalculating millions of charts nightly, where per-request pricing doesn't fit.
- You have the expertise in house: an engineer comfortable with astronomy and an astrologer who can validate output.
- Offline is mandatory, and calculations must run on the device with no network.
When buying is the right call
- Astrology is a feature, one tab in a devotional, wellness, matrimony or education app.
- You want to ship this quarter, not after a three-month engine project.
- You need several things at once: Panchang, Kundli, Dasha and matching, and perhaps scripture and mantra audio too.
- You'd rather not own licensing, time zone edge cases and regional rule disputes.
A middle path
Some teams start with an API and revisit later. That works well if you:
- Store the inputs (birth details, place, zone) alongside results, so you can recompute with any engine.
- Keep a thin adapter layer between your app and the provider, so a swap touches one module.
- Keep a set of reference cases with known-good results. They test any future engine, yours or someone else's.
Where Mantrilo fits
Mantrilo exists for teams in the "buy" column. It covers all eight layers listed at the top of this post, Panchang, Kundli, Dasha, matching, chart images and geocoding with time zones, behind one key. It also adds what no ephemeris includes: scripture, mantras and audio.
If astrology is a feature in your product rather than the product itself, Mantrilo lets you ship it in days and spend your engineering time on what makes your app different.
FAQ
Is Swiss Ephemeris free for commercial use? It is available under the AGPL, which requires your whole project to be AGPL-compatible, or under a paid Professional License. Many commercial apps choose the Professional License.
What is the most accurate Vedic ephemeris? Modern ephemerides based on NASA JPL data, such as Swiss Ephemeris and Skyfield, are far more precise than astrology needs. Differences between apps almost always come from ayanamsa, time zone or sunrise conventions, not the ephemeris.
How long does it take to build a Panchang engine? The ephemeris is quick to integrate. A correct, tested Panchang with sunrise-based transitions, time zones and regional conventions usually takes weeks to months.
Can I switch from an API to my own engine later? Yes, if you store birth inputs and keep a thin adapter layer. Reference cases make the switch safe.
Compare before you commit. Get a free sandbox key, read the astrology docs and see our Kundli tutorial for a working example.
