Building Daily Panchang Features with Vedic Astrology API

10 min read
Brajesh Vashisht
Vedic AstrologyPanchangMuhuratDaily HoroscopeTithi Calculator

Complete guide to implementing Tithi, Nakshatra, Yoga, and Karana calculations. Includes location-based timings, muhurat selection, and auspicious period detection.

TL;DR

  • Panchang is the Vedic calendar system built on five elements: Tithi, Nakshatra, Yoga, Karana, and Vara, each computed from the real-time positions of the Sun and Moon.
  • The Vedic Astrology API provides basic Panchang, detailed Panchang (with sunrise, Rahu Kaal, muhurtas, and transition times), Choghadiya, and Hora endpoints.
  • All responses are JSON with verified sidereal calculations, so you do not need an ephemeris library or almanac lookup tables.
  • Build a production Panchang feature into your app using the Vedic Astrology API and the TypeScript SDK in under 30 minutes.

About the author: Brajesh Vashisht is a Vedic Astrologer and KP Systems Specialist with 22 years of experience in Vedic astrology and Krishnamurti Paddhati. He holds a postgraduate degree in Jyotish Shastra from Banaras Hindu University and has authored two books on KP sub-lord theory and nakshatra analysis.

Every Hindu calendar app, kundali platform, and Vedic wellness product depends on accurate Panchang data. Panchang (literally "five limbs" in Sanskrit) is the backbone of Vedic astrology timekeeping, governing everything from daily rituals and festival dates to muhurta selection for weddings and business launches. Traditionally, computing Panchang required almanac tables maintained by regional pandits, each applying local sunrise times and ayanamsha corrections by hand. For developers building modern apps, this presents a real problem: raw astronomical libraries give you planetary longitudes, but they do not give you Tithi, Nakshatra, Yoga, Karana, or Rahu Kaal. The Vedic Astrology API bridges that gap with verified sidereal calculations exposed as clean JSON endpoints.

What the five Panchang elements mean

The word Panchang comes from "pancha" (five) and "anga" (limb). These five elements together define the spiritual and practical quality of any moment in Vedic time.

Tithi is the lunar day, determined by the angular distance between the Sun and Moon. There are 30 Tithis in a lunar month, split into two pakshas: Shukla (waxing) and Krishna (waning). Each Tithi has a ruling deity and planet that influence the nature of the day.

Nakshatra is the lunar mansion the Moon occupies. There are 27 Nakshatras, each spanning 13 degrees and 20 minutes of the zodiac. Every Nakshatra has a ruling lord, a pada (quarter, 1 through 4), a presiding deity, and a symbol that carries specific meaning for muhurta selection and birth chart interpretation.

Yoga is calculated from the combined longitude of the Sun and Moon. There are 27 Yogas, each carrying distinct characteristics for auspiciousness. Yoga is not the same as the physical practice. In Panchang context, it is a purely astronomical measurement.

Karana is half of a Tithi. There are 11 Karanas that repeat in a fixed cycle through the lunar month. Karanas are used for fine-grained muhurta timing, especially for short-duration activities.

Vara is the day of the week, with each day ruled by a specific planet: Sunday by the Sun, Monday by the Moon, Tuesday by Mars, and so on. Vara is the simplest element but plays a crucial role in determining planetary hora sequences.

Ready to build this? The Vedic Astrology API gives you all five Panchang elements, sunrise and sunset, Rahu Kaal, muhurtas, Choghadiya, and Hora in verified JSON responses. See pricing.

How to get basic Panchang data with the SDK

The basic Panchang endpoint returns the five core elements along with Sun and Moon longitudes. It accepts a date, time, latitude, longitude, and optional timezone offset (defaults to 5.5 for IST).

Install the SDK and make your first call:

import { createRoxy } from '@roxyapi/sdk';

const roxy = createRoxy(process.env.ROXY_API_KEY!);

const { data } = await roxy.vedicAstrology.getBasicPanchang({
  body: {
    date: '2026-03-30',
    time: '06:15:00',
    latitude: 28.6139,
    longitude: 77.209,
    timezone: 5.5,
  },
});

console.log(data.tithi.name);      // e.g. "Dvitiya"
console.log(data.nakshatra.name);  // e.g. "Ashwini"
console.log(data.yoga.name);       // e.g. "Siddhi"

Here is what a typical response looks like:

{
  "tithi": {
    "number": 2,
    "name": "Dvitiya",
    "paksha": "Shukla",
    "percent": 72.4,
    "deity": "Brahma",
    "rulingPlanet": "Moon",
    "element": "Water"
  },
  "nakshatra": {
    "number": 1,
    "name": "Ashwini",
    "lord": "Ketu",
    "pada": 3,
    "deity": "Ashwini Kumaras",
    "symbol": "Horse Head",
    "characteristics": "Swift action, healing, new beginnings"
  },
  "yoga": {
    "number": 21,
    "name": "Siddhi",
    "characteristics": "Accomplishment, success in undertakings"
  },
  "karana": {
    "number": 3,
    "name": "Taitila",
    "type": "Sthira",
    "characteristics": "Favorable for stability and grounding"
  },
  "sunLongitude": 345.82,
  "moonLongitude": 9.64
}

The percent field on Tithi indicates how much of that Tithi has elapsed at the given time. Nakshatra includes the pada (quarter), which is essential for KP astrology and birth star calculations. The sunLongitude and moonLongitude values are sidereal (Lahiri ayanamsha corrected), not tropical.

How to get detailed Panchang with sunrise, Rahu Kaal, and muhurtas

The detailed Panchang endpoint expands on the basic response with sunrise and sunset times, Rahu Kaal, Yamaganda, Gulika, auspicious muhurtas, inauspicious periods, transition times for every element, and planetary strength indicators. Note that this endpoint takes a date, latitude, longitude, and optional timezone, but does not accept a time parameter. It computes the full day.

const { data } = await roxy.vedicAstrology.getDetailedPanchang({
  body: {
    date: '2026-03-30',
    latitude: 28.6139,
    longitude: 77.209,
    timezone: 5.5,
  },
});

// Sunrise and sunset (ISO 8601)
console.log(data.sunrise);  // "2026-03-30T06:12:00+05:30"
console.log(data.sunset);   // "2026-03-30T18:32:00+05:30"

// Inauspicious windows
console.log(data.rahuKaal);    // { start, end }
console.log(data.yamaganda);   // { start, end }
console.log(data.gulika);      // { start, end }

// Auspicious muhurtas
console.log(data.abhijitMuhurta);  // { start, end } or null
console.log(data.brahmaMuhurta);   // { start, end } or null

The detailed response also includes transition data, which tells you exactly when each Panchang element changes. This is critical for calendar apps that need to show "Nakshatra changes at 14:32" or "next Tithi begins at 21:08":

{
  "transitions": {
    "tithi": { "endsAt": "2026-03-30T21:08:00+05:30", "next": "Tritiya" },
    "nakshatra": {
      "endsAt": "2026-03-30T14:32:00+05:30",
      "next": "Bharani",
      "nextPada": 1
    },
    "yoga": { "endsAt": "2026-03-31T02:15:00+05:30", "next": "Vyatipata" },
    "karana": { "endsAt": "2026-03-30T09:45:00+05:30", "next": "Garaja" },
    "moonSign": {
      "current": "Aries",
      "changesAt": "2026-03-31T07:20:00+05:30",
      "next": "Taurus"
    }
  }
}

Additional fields in the detailed response include vara (day name and ruling lord), moonSign and sunSign (with Sanskrit names), sunNakshatra, the current hora, and strength indicators like chandrabalam, tarabalam, panchaka, and bhadra. Auspicious muhurtas include abhijitMuhurta, brahmaMuhurta, vijayaMuhurta, nishitaMuhurta, and godhuliMuhurta. Inauspicious period arrays include durMuhurta, varjyam, and amritKalam.

How to get Choghadiya auspicious periods

Choghadiya divides each day and night into segments, each ruled by a planet and classified as either "Good" or "Bad" for undertaking activities. The Choghadiya system is widely used in Gujarat and western India for business timing, travel planning, and trade decisions.

const { data } = await roxy.vedicAstrology.getChoghadiya({
  body: {
    date: '2026-03-30',
    latitude: 23.0225,
    longitude: 72.5714,
    timezone: 5.5,
  },
});

// Filter for auspicious daytime periods
const goodPeriods = data.dayChoghadiya.filter(p => p.effect === 'Good');
goodPeriods.forEach(p => {
  console.log(`${p.name} (${p.lord}): ${p.start} to ${p.end}`);
});

Each period in dayChoghadiya and nightChoghadiya includes a name (one of Udveg, Amrit, Rog, Labh, Shubh, Char, or Kaal), the ruling planet lord, an effect of either "Good" or "Bad", and start/end timestamps. Amrit, Shubh, and Labh are considered auspicious. Udveg, Rog, and Kaal are considered inauspicious. Char is neutral and suitable for travel.

The Hora endpoint follows a similar pattern, dividing each day and night into 12 planetary hours:

const { data: horaData } = await roxy.vedicAstrology.getHora({
  body: {
    date: '2026-03-30',
    latitude: 28.6139,
    longitude: 77.209,
    timezone: 5.5,
  },
});

// Each hora period
horaData.dayHoras.forEach(h => {
  console.log(`Hora ${h.number}: ${h.planet} (${h.start} to ${h.end})`);
});

Each Hora entry includes the ruling planet, the number (1 through 12), and start/end timestamps. Jupiter, Venus, Mercury, and Moon horas are generally considered favorable for most activities.

How to test the endpoints with curl

You can test all Panchang endpoints directly from the terminal without writing any code. Use the interactive API reference for a browser-based playground, or use curl as shown below.

Basic Panchang:

curl -X POST https://roxyapi.com/api/v2/vedic-astrology/panchang/basic \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "date": "2026-03-30",
    "time": "06:15:00",
    "latitude": 28.6139,
    "longitude": 77.209,
    "timezone": 5.5
  }'

Detailed Panchang:

curl -X POST https://roxyapi.com/api/v2/vedic-astrology/panchang/detailed \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "date": "2026-03-30",
    "latitude": 28.6139,
    "longitude": 77.209,
    "timezone": 5.5
  }'

Choghadiya:

curl -X POST https://roxyapi.com/api/v2/vedic-astrology/panchang/choghadiya \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "date": "2026-03-30",
    "latitude": 23.0225,
    "longitude": 72.5714,
    "timezone": 5.5
  }'

Hora:

curl -X POST https://roxyapi.com/api/v2/vedic-astrology/panchang/hora \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "date": "2026-03-30",
    "latitude": 28.6139,
    "longitude": 77.209,
    "timezone": 5.5
  }'

Notice that the basic Panchang endpoint requires both date and time, while the detailed, Choghadiya, and Hora endpoints require only date (no time parameter). All endpoints accept an optional timezone offset that defaults to 5.5 (IST) if omitted.

Frequently Asked Questions

Q: What is a Panchang API and why do developers need one? A: A Panchang API computes the five Vedic calendar elements (Tithi, Nakshatra, Yoga, Karana, Vara) from real-time astronomical positions of the Sun and Moon. Developers need it because calculating sidereal longitudes, applying ayanamsha corrections, and deriving Tithi boundaries from raw ephemeris data requires deep domain knowledge. The API handles all of that and returns clean JSON.

Q: How accurate are the Panchang calculations? A: All planetary positions are computed using a high-precision ephemeris verified against NASA JPL Horizons. Tithi, Nakshatra, and other derived elements are cross-referenced against authoritative Vedic almanac sources including DrikPanchang. The API uses the Lahiri ayanamsha, which is the standard adopted by the Indian government for official Panchang calculations.

Q: What is the difference between basic and detailed Panchang endpoints? A: The basic endpoint returns the five core elements (Tithi, Nakshatra, Yoga, Karana) plus Sun and Moon longitudes for a specific date and time. The detailed endpoint returns everything in the basic response plus sunrise, sunset, moonrise, moonset, Rahu Kaal, Yamaganda, Gulika, auspicious muhurtas (Abhijit, Brahma, Vijaya, Nishita, Godhuli), inauspicious periods, transition times showing when each element changes, and strength indicators.

Q: Can I build a regional Panchang calendar for locations outside India? A: Yes. Every Panchang endpoint accepts latitude, longitude, and timezone as input parameters. This means you can compute accurate Panchang data for any location on Earth. Sunrise and sunset times, Rahu Kaal windows, and Choghadiya periods are all calculated based on the actual geographic coordinates you provide.

Q: What is the difference between Choghadiya and Hora? A: Choghadiya divides the day and night into seven named periods (Udveg, Amrit, Rog, Labh, Shubh, Char, Kaal), each classified as "Good" or "Bad" for general activities. Hora divides the day and night into 12 planetary hours, each ruled by one of the seven classical planets. Both systems help determine auspicious timing, but Choghadiya is more commonly used for business and travel decisions in western India, while Hora is used across all Vedic traditions for activity-specific timing.

Q: Do I need to know Vedic astrology to use these endpoints? A: No. Every field in the API response includes descriptive metadata. Tithi responses include the paksha, deity, and ruling planet. Nakshatra responses include the lord, pada, symbol, and characteristics. You can build a fully functional Panchang display using just the field names and values returned by the API, without any domain expertise.

Conclusion

Building a daily Panchang feature into your app no longer requires maintaining almanac tables, raw ephemeris libraries, or deep ayanamsha expertise. The Vedic Astrology API provides four dedicated Panchang endpoints covering the five core elements, sunrise and sunset, Rahu Kaal and Yamaganda windows, auspicious muhurtas, Choghadiya periods, and planetary Hora sequences. Every calculation is verified against authoritative sources and delivered as structured JSON.

Whether you are building a Hindu calendar app, a kundali matching platform, a muhurta selection tool, or adding daily Panchang data to a wellness product, the API gives you production-ready data with a single POST request. Explore the full API reference or check pricing to get started.