@vedika-io/sdk
v1.0.0
Published
The only B2B astrology API with AI-powered chatbot queries - JavaScript/Node.js SDK
Maintainers
Readme
Vedika JavaScript/Node.js SDK
Official JavaScript/Node.js SDK for the Vedika Astrology API - The only B2B astrology API with AI-powered chatbot queries.
🌟 What Makes Vedika Unique?
Vedika is the ONLY B2B astrology API that offers:
- ✅ AI-Powered Chatbot Queries (conversational astrology questions)
- ✅ Multi-Agent Swarm Intelligence (6 specialized AI agents)
- ✅ 108+ Traditional Features (birth charts, dashas, yogas, doshas, compatibility)
- ✅ 97.2% Prediction Accuracy (vs 51% industry average)
- ✅ 99.9% Uptime (3-tier ephemeris fallback)
- ✅ 22 Language Support (including 11 Indian languages)
In summary: All the features of traditional astrology APIs, PLUS conversational AI capabilities no other provider has.
🚀 Quick Start
Installation
npm install vedika-sdk
# or
yarn add vedika-sdkBasic Usage (Node.js)
const { VedikaClient } = require('vedika-sdk');
// Initialize client
const client = new VedikaClient({
apiKey: 'vk_test_your_api_key_here'
});
// Ask a conversational astrology question (UNIQUE to Vedika!)
const response = await client.askQuestion({
question: 'What are my career prospects for this year?',
birthDetails: {
datetime: '1990-06-15T14:30:00+05:30',
latitude: 28.6139,
longitude: 77.2090,
timezone: 'Asia/Kolkata'
},
language: 'en' // Supports 22 languages!
});
console.log(response.answer);
console.log(`Confidence: ${response.confidence}`);
console.log(`Credits used: ${response.creditsUsed}`);ES6 Modules
import { VedikaClient } from 'vedika-sdk';
const client = new VedikaClient({ apiKey: 'vk_test_...' });
// Use async/await
const response = await client.askQuestion({
question: 'When should I start my new business?',
birthDetails: { /* ... */ }
});React Example
import { VedikaClient } from 'vedika-sdk';
import { useState } from 'react';
function AstrologyChat() {
const [answer, setAnswer] = useState('');
const client = new VedikaClient({ apiKey: process.env.REACT_APP_VEDIKA_API_KEY });
const askQuestion = async (question) => {
const response = await client.askQuestion({
question,
birthDetails: {
datetime: '1990-06-15T14:30:00+05:30',
latitude: 28.6139,
longitude: 77.2090,
timezone: 'Asia/Kolkata'
}
});
setAnswer(response.answer);
};
return (
<div>
<button onClick={() => askQuestion('What are my career prospects?')}>
Ask AI Astrologer
</button>
<p>{answer}</p>
</div>
);
}📚 Features
🤖 AI Chatbot Queries (Unique Feature!)
// Conversational astrology - No other API has this!
const response = await client.askQuestion({
question: 'When should I start my new business?',
birthDetails: birthInfo,
language: 'hi' // Ask in Hindi!
});📊 Birth Chart Analysis
// Generate complete birth chart
const chart = await client.getBirthChart({
datetime: '1990-06-15T14:30:00+05:30',
latitude: 28.6139,
longitude: 77.2090,
ayanamsa: 'lahiri' // 8 ayanamsa systems supported
});
console.log(chart.planets);
console.log(chart.houses);
console.log(chart.ascendant);🔮 Dasha Periods
// Get Vimshottari Dasha periods
const dashas = await client.getDashas({ birthDetails: birthInfo });
dashas.mahadashas.forEach(dasha => {
console.log(`${dasha.planet}: ${dasha.startDate} to ${dasha.endDate}`);
});💑 Compatibility Analysis
// Ashtakoota matching for marriage compatibility
const compatibility = await client.checkCompatibility({
person1: birthInfo1,
person2: birthInfo2
});
console.log(`Total score: ${compatibility.totalScore}/36`);
console.log(`Compatibility: ${compatibility.level}`);🌟 Yoga Detection
// Detect 300+ astrological yogas
const yogas = await client.detectYogas({ birthDetails: birthInfo });
console.log(`Found ${yogas.yogas.length} yogas:`);
yogas.yogas.forEach(yoga => {
console.log(`- ${yoga.name}: ${yoga.description}`);
});⚠️ Dosha Analysis
// Check for Kaal Sarp, Mangal, Sade Sati doshas
const doshas = await client.analyzeDoshas({ birthDetails: birthInfo });
if (doshas.kaalSarpDosha.present) {
console.log('Kaal Sarp Dosha detected');
console.log(`Type: ${doshas.kaalSarpDosha.type}`);
console.log(`Remedies: ${doshas.kaalSarpDosha.remedies}`);
}🎯 Muhurtha (Auspicious Timing)
// Find auspicious times for important events
const muhurtha = await client.getMuhurtha({
date: '2025-11-01',
location: { latitude: 28.6139, longitude: 77.2090 },
eventType: 'wedding'
});
console.log(`Auspicious times: ${muhurtha.goodTimes}`);
console.log(`Inauspicious times: ${muhurtha.badTimes}`);🔢 Numerology
// 37 numerology calculations
const numerology = await client.getNumerology({
name: 'John Doe',
birthDate: '1990-06-15'
});
console.log(`Life Path Number: ${numerology.lifePath}`);
console.log(`Expression Number: ${numerology.expression}`);
console.log(`Soul Urge Number: ${numerology.soulUrge}`);🌍 Multi-Language Support
Vedika supports 22 languages:
// Ask in Hindi
const response = await client.askQuestion({
question: 'मेरी कुंडली में कौन से योग हैं?',
birthDetails: birthInfo,
language: 'hi'
});
// Ask in Tamil
const response = await client.askQuestion({
question: 'என் ஜாதகத்தில் என்ன யோகங்கள் உள்ளன?',
birthDetails: birthInfo,
language: 'ta'
});Supported languages:
- 🇮🇳 Indian: Hindi, Bengali, Telugu, Tamil, Gujarati, Kannada, Malayalam, Marathi, Punjabi, Odia, Assamese
- 🌍 International: English, Spanish, French, German, Italian, Portuguese, Russian, Japanese, Korean, Chinese, Arabic
🎨 Advanced Features
Streaming Responses (Real-Time)
// Stream responses for better UX
for await (const chunk of client.askQuestionStream({
question: 'What are my career prospects?',
birthDetails: birthInfo
})) {
process.stdout.write(chunk);
}Batch Processing
// Process multiple queries efficiently
const queries = [
{ question: 'Career prospects?', birthDetails: birth1 },
{ question: 'Marriage timing?', birthDetails: birth2 },
{ question: 'Business success?', birthDetails: birth3 }
];
const results = await client.batchProcess(queries);Error Handling
try {
const response = await client.askQuestion({
question: 'What are my career prospects?',
birthDetails: birthInfo
});
console.log(response.answer);
} catch (error) {
if (error.name === 'AuthenticationError') {
console.error('Invalid API key');
} else if (error.name === 'InsufficientCreditsError') {
console.error('Add more credits at https://vedika.io/dashboard.html');
} else if (error.name === 'RateLimitError') {
console.error('Rate limit exceeded, please wait');
} else {
console.error('API error:', error.message);
}
}💰 Pricing
Token-based pricing - pay only for what you use:
| Query Type | Cost | Tokens | |------------|------|--------| | Simple (daily horoscope) | $0.19 | ~500 | | Standard (birth chart) | $0.35 | ~800 | | Complex (comprehensive) | $0.65 | ~1,500 |
Free tier: Test API with free credits on signup!
See full pricing: https://vedika.io/pricing.html
🔧 Configuration
Environment Variables
# .env file
VEDIKA_API_KEY=vk_test_your_api_key_here
VEDIKA_API_URL=https://vedika-api-854222120654.us-central1.run.app # OptionalClient Options
const client = new VedikaClient({
apiKey: 'vk_test_...',
baseUrl: 'https://vedika-api-854222120654.us-central1.run.app', // Optional
timeout: 60000, // Request timeout in milliseconds
maxRetries: 3, // Retry failed requests
cacheEnabled: true, // Enable prompt caching for cost savings
language: 'en' // Default language for responses
});🧪 Testing
# Install dev dependencies
npm install --save-dev
# Run tests
npm test
# Run tests with coverage
npm run test:coverage
# Run specific test
npm test -- test/chatbot.test.js📝 Examples
Check out the examples/ directory:
basic-chatbot.js- Simple conversational astrology botbirth-chart.js- Complete birth chart generationcompatibility.js- Marriage compatibility analysisdosha-detector.js- Comprehensive dosha analysismuhurtha-finder.js- Find auspicious timesmulti-language.js- Multi-language support demostreaming.js- Real-time streaming responsesexpress-app.js- Express server examplereact-app.jsx- React component example
🐛 Troubleshooting
"Invalid API Key"
Make sure you're using a valid API key from https://vedika.io/dashboard.html
Keys start with:
vk_test_for testingvk_live_for production
"Insufficient Credits"
Add credits to your account: https://vedika.io/dashboard.html
"Request Timeout"
For complex queries, increase timeout:
const client = new VedikaClient({
apiKey: '...',
timeout: 120000 // 2 minutes
});"Rate Limit Exceeded"
You're sending too many requests. Wait a moment or upgrade your plan.
📊 Performance
- Average response time: 2.14 seconds (simple queries)
- Complex queries: 28-36 seconds (multi-agent processing)
- Uptime: 99.9% (3-tier ephemeris fallback)
- Accuracy: 97.2% prediction accuracy
🔒 Security
- ✅ API keys encrypted in transit (HTTPS)
- ✅ GDPR compliant
- ✅ No data retention (unless explicitly enabled)
- ✅ Security score: 95/100 (A grade)
📜 License
MIT License - see LICENSE file
🌐 Links
- Website: https://vedika.io
- Documentation: https://vedika.io/docs.html
- API Reference: https://vedika.io/api-reference.html
- Dashboard: https://vedika.io/dashboard.html
- Support: [email protected]
- GitHub: https://github.com/vedika-intelligence
⭐ Support
If you find this SDK helpful, please:
- ⭐ Star this repository
- 🐛 Report issues on GitHub
- 💬 Join our community discussions
- 📧 Contact [email protected] for help
🎯 Why Choose Vedika?
Vedika vs Traditional Astrology APIs
| Feature | Vedika | Others | |---------|--------|--------| | AI Chatbot Queries | ✅ YES (UNIQUE!) | ❌ No | | Birth Charts | ✅ Yes | ✅ Yes | | Dashas | ✅ Yes | ✅ Yes | | Compatibility | ✅ Yes | ✅ Yes | | 300+ Yogas | ✅ Yes | ⚠️ Limited | | Dosha Analysis | ✅ Complete | ⚠️ Basic | | Multi-Agent AI | ✅ 6 Agents | ❌ No | | 22 Languages | ✅ Yes | ❌ English only | | Streaming | ✅ Yes | ❌ No | | Uptime | 99.9% | ~99% | | Security Score | 95/100 (A) | Unknown | | Unique Value | Traditional + AI | Traditional only |
Bottom line: Vedika provides everything other astrology APIs offer, PLUS the only conversational AI chatbot capability in the market.
Built with ❤️ by Vedika Intelligence
The only B2B astrology API with AI-powered chatbot queries.
Get started: https://vedika.io
