Muhurta — the Vedic science of auspicious timing — is one of the highest-demand features in Indian astrology apps. Wedding apps, real estate platforms, and business planning tools all benefit from a "best date finder" powered by Panchang calculations. Vedika API exposes Muhurta, Panchang, Choghadiya, Hora, and Abhijit Muhurta through dedicated endpoints, enabling developers to build production-grade timing features without any Jyotish expertise.
This guide covers the Panchang fundamentals developers need to know, walks through every relevant Vedika API endpoint, and provides complete JavaScript code to build a Muhurta finder with date-range scanning and a Choghadiya day-planner widget.
What You Will Build: A date-range Muhurta scanner that evaluates each day's Panchang, scores auspiciousness for a given event type (wedding, business launch, travel), highlights the best windows, and renders a Choghadiya grid for any selected date.
Panchang Fundamentals for Developers
Panchang (Sanskrit: five limbs) is the Vedic almanac that describes the quality of any moment in time. Every Muhurta calculation starts with evaluating these five elements:
| Element |
What It Represents |
Values |
| Tithi | Lunar day (moon's distance from sun) | 30 tithis: Pratipada through Amavasya |
| Vara | Weekday, each ruled by a planet | 7 varas: Sun (Sunday) through Saturn (Saturday) |
| Nakshatra | Moon's current asterism (27 divisions) | 27 nakshatras from Ashwini to Revati |
| Yoga | Sun+Moon combined longitude / 13.33° | 27 yogas from Vishkambha to Vaidhriti |
| Karana | Half a Tithi | 11 karanas: 4 fixed + 7 repeating |
For any event type, classical texts specify which Tithis, Nakshatras, and Yogas are auspicious. A good Muhurta typically requires at least 3 of 5 Panchang elements to be favourable, plus no major planetary afflictions (no Rahu Kaal, Gulik Kaal, or Durmuhurta).
Fetching Panchang from Vedika API
Panchang Endpoint
async function getPanchang(date, latitude, longitude, timezone) {
const response = await fetch('https://api.vedika.io/v2/astrology/panchang', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'vk_live_YOUR_KEY_HERE'
},
body: JSON.stringify({
date,
latitude,
longitude,
timezone
})
});
return response.json();
}
{
"success": true,
"data": {
"tithi": {
"name": "Panchami",
"number": 5,
"paksha": "Shukla",
"endTime": "14:32:00"
},
"vara": { "name": "Shukra Vara", "lord": "Venus" },
"nakshatra": {
"name": "Rohini",
"lord": "Moon",
"pada": 2,
"endTime": "19:15:00"
},
"yoga": { "name": "Siddha", "type": "auspicious" },
"karana": { "name": "Balava", "endTime": "14:32:00" },
"rahuKaal": { "start": "10:30:00", "end": "12:00:00" },
"gulikKaal": { "start": "07:30:00", "end": "09:00:00" },
"durmuhurta": [
{ "start": "08:30:00", "end": "09:18:00" }
],
"sunrise": "06:02:00",
"sunset": "19:08:00"
}
}
Muhurta Scoring for Different Event Types
Each type of event has specific auspicious Nakshatra and Tithi requirements. Here is a scorer function for three common types:
const MUHURTA_RULES = {
vivah: {
auspiciousNakshatras: [
'Rohini', 'Mrigashira', 'Magha', 'Uttara Phalguni',
'Hasta', 'Swati', 'Anuradha', 'Moola',
'Uttara Ashadha', 'Uttara Bhadrapada', 'Revati'
],
inauspiciousNakshatras: ['Bharani', 'Krittika', 'Ardra', 'Ashlesha', 'Jyeshtha'],
auspiciousTithis: [2, 3, 5, 7, 10, 11, 13],
inauspiciousTithis: [4, 8, 9, 12, 14, 30],
auspiciousVaras: ['Shukra Vara', 'Budha Vara', 'Guru Vara', 'Soma Vara'],
auspiciousYogas: ['Siddha', 'Shubha', 'Amrita', 'Sarvartha Siddhi']
},
business: {
auspiciousNakshatras: [
'Ashwini', 'Mrigashira', 'Punarvasu', 'Pushya',
'Hasta', 'Chitra', 'Swati', 'Anuradha',
'Shravana', 'Dhanishtha', 'Revati'
],
inauspiciousNakshatras: ['Bharani', 'Ardra', 'Ashlesha', 'Jyeshtha', 'Moola'],
auspiciousTithis: [1, 2, 3, 5, 7, 10, 11, 13],
inauspiciousTithis: [4, 8, 9, 14, 30],
auspiciousVaras: ['Budha Vara', 'Guru Vara', 'Shukra Vara'],
auspiciousYogas: ['Siddha', 'Shubha', 'Sarvartha Siddhi', 'Amrita']
},
travel: {
auspiciousNakshatras: [
'Ashwini', 'Mrigashira', 'Punarvasu', 'Pushya',
'Hasta', 'Chitra', 'Anuradha', 'Shravana', 'Revati'
],
inauspiciousNakshatras: ['Bharani', 'Krittika', 'Ardra', 'Ashlesha'],
auspiciousTithis: [2, 3, 5, 7, 10, 11, 12, 13],
inauspiciousTithis: [4, 8, 9, 14, 30],
auspiciousVaras: ['Budha Vara', 'Shukra Vara', 'Guru Vara'],
auspiciousYogas: ['Siddha', 'Shubha', 'Amrita']
}
};
function scoreMuhurta(panchangData, eventType = 'vivah') {
const rules = MUHURTA_RULES[eventType];
if (!rules) throw new Error(`Unknown event type: ${eventType}`);
const { tithi, vara, nakshatra, yoga } = panchangData;
let score = 0;
const reasons = [];
if (rules.inauspiciousNakshatras.includes(nakshatra.name)) {
score -= 30;
reasons.push(`Inauspicious Nakshatra: ${nakshatra.name}`);
} else if (rules.auspiciousNakshatras.includes(nakshatra.name)) {
score += 30;
reasons.push(`Auspicious Nakshatra: ${nakshatra.name}`);
}
if (rules.inauspiciousTithis.includes(tithi.number)) {
score -= 20;
reasons.push(`Inauspicious Tithi: ${tithi.name}`);
} else if (rules.auspiciousTithis.includes(tithi.number)) {
score += 20;
reasons.push(`Auspicious Tithi: ${tithi.name}`);
}
if (rules.auspiciousVaras.includes(vara.name)) {
score += 15;
reasons.push(`Favourable day: ${vara.name}`);
}
if (rules.auspiciousYogas.includes(yoga.name)) {
score += 15;
reasons.push(`Auspicious Yoga: ${yoga.name}`);
}
if (tithi.paksha === 'Shukla' && eventType !== 'travel') {
score += 10;
reasons.push('Shukla Paksha (waxing moon — favourable for new beginnings)');
}
return {
score,
rating: score >= 60 ? 'Excellent' : score >= 30 ? 'Good' : score >= 0 ? 'Fair' : 'Avoid',
reasons,
nakshatra: nakshatra.name,
tithi: `${tithi.paksha} ${tithi.name}`,
vara: vara.name,
yoga: yoga.name
};
}
Date Range Scanner
With the scorer in place, scanning a date range to find the best Muhurta windows is straightforward. The following function checks every day in a given range and returns the top results sorted by score:
async function findBestMuhurta({
startDate,
endDate,
latitude,
longitude,
timezone,
eventType,
topN = 5
}) {
const results = [];
const current = new Date(startDate);
const end = new Date(endDate);
while (current <= end) {
const dateStr = current.toISOString().split('T')[0];
try {
const panchangResponse = await getPanchang(dateStr, latitude, longitude, timezone);
if (panchangResponse.success) {
const scoreResult = scoreMuhurta(panchangResponse.data, eventType);
results.push({
date: dateStr,
...scoreResult,
rahuKaal: panchangResponse.data.rahuKaal,
gulikKaal: panchangResponse.data.gulikKaal,
sunrise: panchangResponse.data.sunrise,
sunset: panchangResponse.data.sunset
});
}
} catch (err) {
console.warn(`Skipping ${dateStr}:`, err.message);
}
current.setDate(current.getDate() + 1);
await new Promise(resolve => setTimeout(resolve, 200));
}
return results
.sort((a, b) => b.score - a.score)
.slice(0, topN);
}
const bestDates = await findBestMuhurta({
startDate: '2026-04-01',
endDate: '2026-04-30',
latitude: 28.6139,
longitude: 77.2090,
timezone: '+05:30',
eventType: 'vivah',
topN: 5
});
console.log(bestDates);
Build Your Muhurta Feature Today
Vedika API's free sandbox has 65 mock endpoints — test the Panchang and Muhurta endpoints instantly, no key required.
Try Free Sandbox
Choghadiya Day Planner
Choghadiya is ideal for building a "best time of day" widget. Each of the 8 daytime and 8 nighttime segments has a quality rating that users can understand at a glance:
async function getChoghadiya(date, latitude, longitude, timezone) {
const response = await fetch('https://api.vedika.io/v2/astrology/choghadiya', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'vk_live_YOUR_KEY_HERE'
},
body: JSON.stringify({ date, latitude, longitude, timezone })
});
return response.json();
}
const CHOGHADIYA_STYLES = {
'Amrit': { color: '#16a34a', bg: '#dcfce7', label: 'Excellent' },
'Shubh': { color: '#65a30d', bg: '#ecfccb', label: 'Good' },
'Labh': { color: '#0891b2', bg: '#cffafe', label: 'Gain' },
'Char': { color: '#6b7280', bg: '#f3f4f6', label: 'Neutral' },
'Rog': { color: '#dc2626', bg: '#fee2e2', label: 'Avoid' },
'Kaal': { color: '#7c3aed', bg: '#ede9fe', label: 'Very Inauspicious' },
'Udveg': { color: '#b45309', bg: '#fef3c7', label: 'Anxiety' }
};
function renderChoghadiyaGrid(choghadiyaData) {
const { daySegments, nightSegments } = choghadiyaData;
function renderSegments(segments, label) {
return `
<h3>${label}</h3>
<div style="display:grid;grid-template-columns:repeat(4,1fr);gap:0.5rem;margin-bottom:1.5rem">
${segments.map(seg => {
const style = CHOGHADIYA_STYLES[seg.quality] || CHOGHADIYA_STYLES['Char'];
return `
<div style="background:${style.bg};border-radius:8px;padding:0.75rem;text-align:center">
<div style="font-weight:bold;color:${style.color}">${seg.quality}</div>
<div style="font-size:0.8rem;color:#555">${seg.startTime}–${seg.endTime}</div>
<div style="font-size:0.75rem;color:#777">${seg.lord}</div>
</div>
`;
}).join('')}
</div>
`;
}
return renderSegments(daySegments, 'Day Choghadiya')
+ renderSegments(nightSegments, 'Night Choghadiya');
}
Abhijit Muhurta and Hora Integration
Abhijit Muhurta is a universal auspicious window that overrides many Panchang-level inauspiciousness. Hora tracks the planetary ruler of each hour of the day. Both are valuable additions to any Muhurta feature:
async function getAbhijitAndHora(date, latitude, longitude, timezone) {
const [abhijit, hora] = await Promise.all([
fetch('https://api.vedika.io/v2/astrology/abhijit-muhurta', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'x-api-key': 'vk_live_YOUR_KEY_HERE' },
body: JSON.stringify({ date, latitude, longitude, timezone })
}).then(r => r.json()),
fetch('https://api.vedika.io/v2/astrology/hora', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'x-api-key': 'vk_live_YOUR_KEY_HERE' },
body: JSON.stringify({ date, latitude, longitude, timezone })
}).then(r => r.json())
]);
return {
abhijitMuhurta: {
start: abhijit.data.startTime,
end: abhijit.data.endTime,
isAuspicious: true
},
currentHora: hora.data.currentHora,
horaSequence: hora.data.horaSequence
};
}
Building the Complete Muhurta UI Component
Combining all the above into a React-style component (framework-agnostic logic shown here):
class MuhurtaFinder {
constructor(apiKey, location) {
this.apiKey = apiKey;
this.location = location;
}
async findBestDates(startDate, endDate, eventType) {
const dates = await findBestMuhurta({
startDate,
endDate,
...this.location,
eventType
});
return dates.map(d => ({
...d,
formattedDate: new Date(d.date).toLocaleDateString('en-IN', {
weekday: 'long', year: 'numeric', month: 'long', day: 'numeric'
}),
ratingColor: d.rating === 'Excellent' ? '#16a34a'
: d.rating === 'Good' ? '#65a30d'
: d.rating === 'Fair' ? '#ca8a04'
: '#dc2626'
}));
}
async renderDayDetail(date) {
const [panchang, choghadiya, timing] = await Promise.all([
getPanchang(date, ...Object.values(this.location)),
getChoghadiya(date, ...Object.values(this.location)),
getAbhijitAndHora(date, ...Object.values(this.location))
]);
return {
panchang: panchang.data,
choghadiya: choghadiyaData.data,
abhijitWindow: timing.abhijitMuhurta,
bestHoras: timing.horaSequence.filter(h =>
['Jupiter', 'Venus', 'Mercury'].includes(h.planet)
)
};
}
}
Endpoint Summary
/v2/astrology/panchang
All 5 Panchang elements, Rahu Kaal, Gulik Kaal, Durmuhurta, sunrise/sunset for any date and location.
/v2/astrology/choghadiya
8 daytime + 8 nighttime segments with quality ratings (Amrit, Shubh, Labh, Char, Rog, Kaal, Udveg).
/v2/astrology/hora
Planetary ruler of each hour of the day and night — 24 hora sequence for any date and location.
/v2/astrology/abhijit-muhurta
Precise start and end times of the universally auspicious midday window based on local sunrise/sunset.
/v2/astrology/brahma-muhurta
Pre-dawn auspicious period (approximately 96 minutes before sunrise). Ideal for meditation and new beginnings.
/v2/astrology/gowri-nalla-neram
Auspicious time slots used in Tamil astrology tradition. Complementary to Choghadiya for South Indian apps.
Why Vedika API for Muhurta Features
- All timing endpoints in one subscription — Panchang, Muhurta, Choghadiya, Hora, Abhijit, Brahma Muhurta, and Gowri Nalla Neram are all included.
- Swiss Ephemeris precision — Sunrise, sunset, and all celestial positions computed with astronomical accuracy. No shortcuts.
- AI narrative integration — Pass Panchang data to the Vedika AI endpoint and get a natural language Muhurta explanation for your users in 30 languages.
- $12/month starting — No per-endpoint pricing. One subscription covers the full 140+ endpoint catalogue.
- 30 languages — Hindi, Tamil, Telugu, Bengali, Gujarati, Marathi, Kannada — users can receive Muhurta explanations in their native language.
Conclusion
A Muhurta finder is one of those features that users remember. It requires no birth chart — just a date range, location, and event type — making it accessible to every user in your app regardless of whether they have their birth details handy. Vedika API's Panchang and timing endpoints handle all the astronomical computation, leaving you to focus entirely on UI and user experience.
Next steps:
- Get your API key at vedika.io/dashboard
- Test the Panchang endpoint in the free sandbox
- Read the full Panchang API reference and Muhurta API docs
- Add AI narrative via the chat endpoint for contextual Muhurta explanations
About Vedika Intelligence: Vedika is the only B2B astrology API with AI-powered conversational capabilities, 140+ Vedic and Western calculation endpoints, and Swiss Ephemeris precision. Starting at $12/month, supporting 30 languages, used by production apps worldwide.