guide

Panchang API: Tithi, Nakshatra, Yoga and Muhurta in JSON

A single GET or POST request returns the five elements of the Hindu almanac for a date and a place, with optional sunrise times and muhurta windows.

A panchang API returns the five parts of the Hindu almanac for a date and a place: the tithi (lunar day), the vara (weekday), the nakshatra (lunar mansion), the yoga and the karana. The Vedika route is /v2/astrology/panchang. It accepts a date and a location as query parameters on a GET request or as a JSON body on a POST request, and can add sunrise, sunset, moonrise and moonset times and the day's muhurta windows on request.

This guide shows both call styles, the real shape of the response for a worked date, the query options, and the timing details that decide whether the tithi you display matches the one people expect. For a short product overview of the same data, see the Panchang API for developers page.

What the five elements are

The response also carries the Hindu month (masa), the season (ritu), the inauspicious direction for travel on that weekday (disha shool), and a guidance block that summarises the day in plain language.

The request

The simplest call is a GET with a date and coordinates. Send your key as a bearer token in the Authorization header (Authorization: Bearer <key>).

curl "https://api.vedika.io/v2/astrology/panchang?date=2026-10-21&latitude=28.6139&longitude=77.209&timezone=%2B05:30" \
  -H "Authorization: Bearer $VEDIKA_API_KEY"
ParameterDefaultWhat it does
dateTodayA date as YYYY-MM-DD. The value is read at noon India time.
datetimeNoneA full ISO 8601 moment. It takes precedence over date.
latitude, longitudeDelhiThe place the almanac is computed for.
timezoneAsia/KolkataAn IANA name or a UTC offset.
includeNoneAdd-on blocks: sunrise, muhurta, festivals, or all.
langenThe language for the descriptive text.

The same data is available by POST, which is more convenient when you already hold a JSON object for the user:

curl -X POST https://api.vedika.io/v2/astrology/panchang \
  -H "Authorization: Bearer $VEDIKA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"datetime":"2026-10-21T12:00:00","latitude":28.6139,"longitude":77.209,"timezone":"+05:30","include":"sunrise,muhurta"}'

A real response

For 21 October 2026 in Delhi the main elements come back as follows. The values are trimmed here; the live response also carries completion percentages and descriptive text for each element.

{
  "success": true,
  "data": {
    "datetime": "2026-10-21T12:00:00+05:30",
    "coordinates": { "latitude": 28.6139, "longitude": 77.209 },
    "tithi": { "name": "Dashami", "number": 10, "paksha": { "id": 1, "name": "Shukla" }, "completionPercentage": 91.19 },
    "nakshatra": { "name": "Dhanishta", "number": 23, "pada": 3, "lord": "Mars", "completionPercentage": 69.47 },
    "yoga": { "name": "Ganda", "number": 10, "quality": "Inauspicious" },
    "karana": { "name": "Garaja", "number": 20 },
    "masa": { "name": "Kartik" },
    "ritu": { "englishName": "Autumn" },
    "disha_shool": { "direction": "North" },
    "sunrise": { "sunrise": "2026-10-21T06:25:18+05:30", "sunset": "2026-10-21T17:45:58+05:30" }
  }
}

Reading it: the tithi is Dashami, number 10 of 30, in Shukla Paksha, so this is the tenth day of the bright half. The Moon is in Dhanishta, pada 3, ruled by Mars, and 69 percent of the way through that nakshatra. The yoga is Ganda, labelled inauspicious, and the karana is Garaja. The masa field reads Kartik because the API names the month from the Sun's sidereal sign, here Libra. Lunar calendars call this day Ashwin Shukla Dashami (Vijayadashami), so check the month name against the calendar your users follow. The season is autumn (Sharad). The completionPercentage fields tell you how far through each element the moment is, which is what you need to say that a tithi ends later in the day.

Asking for sunrise and muhurta

Add include=sunrise,muhurta to get the sun and moon times and the muhurta windows for the day. In the example, sunrise is at 06:25 and sunset at 17:45 India time, and the response also carries moonrise and moonset. The muhurta block holds the Abhijit Muhurta, the window around midday that traditions treat as favourable, with its start, end and a duration of 45 minutes, plus a list of other timed windows with a description each.

One detail to handle in your code: the sunrise block gives times with the +05:30 offset, while the start and end times inside the muhurta block are ISO strings ending in Z, which means universal time. The Abhijit window in the example runs from 06:14 to 06:59 UTC, which is 11:44 to 12:29 in India. Parse each timestamp with its own offset and convert to the user's zone once, at the edge of your app.

Each add-on adds to the price of a call. Read the charged amount from the billing block in each response; the pricing page lists current rates.

Which tithi do you show: the one at noon or the one at sunrise?

Get this wrong and your app will disagree with the printed calendar your users check. A tithi does not start and end at midnight. A new tithi starts each time the Moon gains another twelve degrees on the Sun, so a calendar day can contain parts of two tithis.

When you pass only date, the API reads the moment as noon India time, so the tithi, nakshatra and yoga you get are the ones running at noon. Hindu calendars usually name the day after the tithi that is running at sunrise, called the udaya tithi, and many festivals follow it. If your users expect that convention, make two calls: first ask for the day with include=sunrise to learn the sunrise time at the user's location, then call again with datetime set to that sunrise. The completionPercentage value on the tithi also lets you show a note such as the tithi ending later that afternoon.

Location matters more than people expect

Sunrise, and therefore the udaya tithi, depends on where the user is. A tithi can end before sunrise in one city and after it in a city a few hundred kilometres away. Defaults are Delhi coordinates and the Asia/Kolkata timezone, which is convenient for a prototype and wrong for a user in Toronto or London. Pass the user's own latitude, longitude and timezone, and use an IANA name so daylight saving time is applied for that date.

Calling it from code

const params = new URLSearchParams({
  date: '2026-10-21',
  latitude: '28.6139',
  longitude: '77.209',
  timezone: 'Asia/Kolkata',
  include: 'sunrise,muhurta'
});
const res = await fetch('https://api.vedika.io/v2/astrology/panchang?' + params, {
  headers: { 'Authorization': `Bearer ${process.env.VEDIKA_API_KEY}` }
});
if (!res.ok) throw new Error('panchang request failed: ' + res.status);
const { data } = await res.json();
console.log(data.nakshatra.name, 'pada', data.nakshatra.pada, '| yoga', data.yoga.name, '| sunrise', data.sunrise.sunrise);
import os, requests

r = requests.get(
    'https://api.vedika.io/v2/astrology/panchang',
    headers={'Authorization': f"Bearer {os.environ['VEDIKA_API_KEY']}"},
    params={'date': '2026-10-21', 'latitude': 28.6139, 'longitude': 77.209, 'timezone': 'Asia/Kolkata'},
    timeout=30,
)
r.raise_for_status()
d = r.json()['data']
print(d['nakshatra']['name'], d['yoga']['name'], d['karana']['name'])

Design notes for a panchang feature

Cache by place and date. A panchang for a given location and date does not change, so a daily job that fetches the next week for your users' cities, and a cache keyed on the date and rounded coordinates, will answer most page views without a request. Keep the key on your server and serve the cached JSON to the browser.

Localise text through the lang parameter instead of translating the English strings yourself, so the descriptive fields come back in a supported language; the API reference lists the codes. Label the quality of each yoga in the interface, because the quality field already carries it. For festival listings use include=festivals and keep the festival names as the API returns them.

The panchang is one part of the wider astrology API. If your product also needs a rising sign for a user's birth, the ascendant calculation API guide uses the same key and the same request style.

If you are building more than a daily card, the API reference lists the related routes for charts, dashas and matching that take similar location inputs, and the free sandbox lets you try the calls before you create a key.

Frequently asked questions

What does a panchang API return?

It returns the tithi, vara, nakshatra, yoga and karana for a date and place, along with the Hindu month, the season, the inauspicious travel direction and a guidance summary. With the include option it can add sunrise, sunset, moonrise, moonset and muhurta windows.

How do I call the Vedika panchang endpoint?

Send a GET request to /v2/astrology/panchang with date, latitude, longitude and timezone as query parameters, or send the same fields as JSON in a POST request to the same path. Authenticate with your key in the Authorization: Bearer header.

Which time does the API use when I send only a date?

A date alone is read at noon India time, so the elements returned are those running at noon. If you need the tithi at sunrise, request the sunrise time first and then call again with a datetime set to that moment.

Why do the muhurta times end in Z?

The start and end times inside the muhurta block are ISO strings in universal time. The sunrise block uses the offset of the requested timezone. Parse each timestamp with its own offset and convert to the user's timezone once, in your application.

Does location change the result?

Yes. Sunrise depends on the place, and a tithi that ends close to sunrise can belong to a different day in two nearby cities. The default is Delhi, so pass the user's own coordinates and an IANA timezone.

How much does a panchang call cost?

Each response reports the charge in its billing block. Read the field in the response instead of hard-coding a price; the pricing page lists current rates.

Build on the Vedika astrology API

1,138 operations, Vedic + Western + KP, 30 language codes, an open-source XALEN ephemeris, and a built-in LLM. Free sandbox — no signup.

Try the free sandbox