Dosha Detection API
Analyze astrological doshas with remedies
Available Dosha Checks
Mangal Dosha
Mars in 1st, 4th, 7th, 8th, or 12th house. Affects marriage.
$0.03
Kaal Sarp Dosha
All planets between Rahu and Ketu. Causes life struggles.
$0.03
Pitru Dosha
Ancestral karma afflictions. Sun/Moon with Rahu/Ketu.
$0.02
Nadi Dosha
Same Nadi in matching. Affects progeny health.
$0.02Mangal Dosha (Manglik Check)
import { VedikaClient } from '@vedika-io/sdk';
const client = new VedikaClient({ apiKey: process.env.VEDIKA_API_KEY });
const mangalDosha = await client.getDoshasV2('mangal-dosha', {
datetime: '1990-05-15T10:30:00',
latitude: 28.6139,
longitude: 77.2090,
timezone: '+05:30'
});
console.log('Is Manglik:', mangalDosha.has_dosha); // true
console.log('Severity:', mangalDosha.severity); // 'Mild'
console.log('Mars House:', mangalDosha.mars.house); // 8
console.log('Cancelled:', mangalDosha.is_cancelled); // true
console.log('Cancellations:', mangalDosha.cancellation_reasons); // ['Jupiter aspects Mars']
Response Structure
// What client.getDoshasV2('mangal-dosha', ...) returns: the "data" object of
// POST /v2/astrology/mangal-dosha (the SDK removes the { success, data } wrapper).
// Raw HTTP callers read the same fields under body.data.
{
"has_dosha": true,
"dosha_type": "Mangal Dosha",
"severity": "Mild",
"percentage": 12,
"description": "Mangal Dosha present from: Lagna (house 8), Venus (house 12)",
// Where the dosha is counted from
"dosha_from_lagna": true,
"dosha_from_moon": false,
"dosha_from_venus": true,
"mars": {
"house": 8,
"house_from_moon": 3,
"house_from_venus": 12,
"sign": "Aquarius",
"is_retrograde": false
},
"is_cancelled": true,
"cancellation_reasons": ["Jupiter aspects Mars"],
"has_exception": true,
"exceptions": [],
"remedies": ["No major remedies needed"],
"interpretation": {
"currentStatus": {
"description": "Mangal Dosha is present but cancelled by astrological exceptions",
"effects": ["Dosha effects are neutralized", "..."],
"guidance": "...",
"severity": "Mild"
},
"matchingAdvice": "...",
"overview": { "affectedHouses": "...", "meaning": "...", "significance": "..." },
"remedialMeasures": {
"charitable": ["..."],
"gemstone": { "stone": "Red Coral (Moonga)", "finger": "Ring finger of right hand", "metal": "Gold or copper", "day": "...", "weight": "..." },
"lifestyle": ["..."],
"spiritual": ["..."]
}
}
}
Kaal Sarp Dosha
const kaalSarp = await client.getDoshasV2('kaal-sarp-dosha', {
datetime: '1990-05-15T10:30:00',
latitude: 28.6139,
longitude: 77.2090,
timezone: '+05:30'
});
console.log('Has Kaal Sarp:', kaalSarp.has_dosha);
console.log('Type:', kaalSarp.type); // e.g. 'Anant Kaal Sarp' when present
console.log('Direction:', kaalSarp.direction);
console.log('Rahu house:', kaalSarp.rahu.house);
console.log('Ketu house:', kaalSarp.ketu.house);
12 Types of Kaal Sarp
| Type | Rahu House | Ketu House | Primary Effect |
|---|---|---|---|
| Anant | 1 | 7 | Health, relationships |
| Kulik | 2 | 8 | Finances, longevity |
| Vasuki | 3 | 9 | Siblings, fortune |
| Shankhpal | 4 | 10 | Property, career |
| Padma | 5 | 11 | Children, gains |
| Mahapadma | 6 | 12 | Enemies, losses |
| Takshak | 7 | 1 | Marriage, self |
| Karkotak | 8 | 2 | Sudden events, family |
| Shankachood | 9 | 3 | Fortune, courage |
| Ghatak | 10 | 4 | Career, home |
| Vishdhar | 11 | 5 | Gains, children |
| Sheshnag | 12 | 6 | Expenses, health |
Pitru Dosha
const pitruDosha = await client.getDoshasV2('pitru-dosha', {
datetime: '1990-05-15T10:30:00',
latitude: 28.6139,
longitude: 77.2090,
timezone: '+05:30'
});
console.log('Has Pitru Dosha:', pitruDosha.has_dosha);
console.log('Severity:', pitruDosha.severity);
console.log('Indicators:', pitruDosha.indicators);
console.log('Sun house:', pitruDosha.sun_house, 'Moon house:', pitruDosha.moon_house);
console.log('Remedies:', pitruDosha.remedies);
Complete Dosha Analysis
// Check all doshas at once
const allDoshas = await client.analyzeDoshas({
datetime: '1990-05-15T10:30:00',
latitude: 28.6139,
longitude: 77.2090,
timezone: '+05:30'
});
console.log('Dosha Summary:');
console.log('Mangal Dosha:', allDoshas.mangal_dosha.has_dosha ? 'Yes' : 'No');
console.log('Kaal Sarp Dosha:', allDoshas.kaal_sarp_dosha.has_dosha ? 'Yes' : 'No');
console.log('Pitru Dosha:', allDoshas.pitru_dosha.has_dosha ? 'Yes' : 'No');
// Get combined remedies
const allRemedies = [
...allDoshas.mangal_dosha.remedies,
...allDoshas.kaal_sarp_dosha.remedies,
...allDoshas.pitru_dosha.remedies
];
console.log('Total remedies:', allRemedies.length);
Dosha Compatibility for Marriage
// Check if two people's doshas are compatible
const person1 = {
datetime: '1990-05-15T10:30:00',
latitude: 28.6139,
longitude: 77.2090,
timezone: '+05:30'
};
const person2 = {
datetime: '1992-08-20T14:00:00',
latitude: 19.0760,
longitude: 72.8777,
timezone: '+05:30'
};
const [match, manglik1, manglik2] = await Promise.all([
client.getGunaMilan(person1, person2), // male first, female second
client.getDoshasV2('mangal-dosha', person1),
client.getDoshasV2('mangal-dosha', person2)
]);
console.log('Compatibility:', match.match_result);
console.log('Score:', `${match.total_points}/${match.maximum_points}`);
console.log('Manglik Status:', {
person1: manglik1.has_dosha,
person2: manglik2.has_dosha
});
// A Nadi score of 0 means Nadi Dosha (both partners share the same Nadi)
console.log('Nadi Dosha:', match.gunaDetails.nadi.score === 0);
console.log('Recommendation:', match.recommendation);
Generate Dosha Report
async function generateDoshaReport(birthDetails) {
const client = new VedikaClient({ apiKey: process.env.VEDIKA_API_KEY });
const analysis = await client.analyzeDoshas(birthDetails);
// Build comprehensive report
const report = {
summary: {
totalDoshasFound: 0,
severityLevel: 'none',
primaryConcern: null
},
doshas: [],
prioritizedRemedies: []
};
// Check each dosha
const doshaTypes = ['mangal_dosha', 'kaal_sarp_dosha', 'pitru_dosha'];
for (const type of doshaTypes) {
if (analysis[type].has_dosha) {
report.summary.totalDoshasFound++;
report.doshas.push({
name: formatDoshaName(type),
severity: analysis[type].severity,
remedies: analysis[type].remedies
});
}
}
// The first dosha found is the primary concern
if (report.doshas.length > 0) {
report.summary.primaryConcern = report.doshas[0].name;
report.summary.severityLevel = report.doshas[0].severity;
}
// Prioritize remedies
report.prioritizedRemedies = report.doshas
.flatMap(d => d.remedies)
.slice(0, 5);
return report;
}
function formatDoshaName(type) {
const names = {
mangal_dosha: 'Mangal Dosha',
kaal_sarp_dosha: 'Kaal Sarp Dosha',
pitru_dosha: 'Pitru Dosha'
};
return names[type] || type;
}
// Usage
const report = await generateDoshaReport({
datetime: '1990-05-15T10:30:00',
latitude: 28.6139,
longitude: 77.2090,
timezone: '+05:30'
});
console.log(JSON.stringify(report, null, 2));