TUTORIAL
Build a Python Astrology Bot with Vedika API
Create an intelligent astrology bot in Python using Vedika API. Telegram, Discord, or WhatsApp integration with AI-powered responses.
March 6, 2026
-
12 min read
Setup
pip install vedika-sdk python-telegram-bot aiohttp Vedika Python SDK Integration
# bot.py
from vedika import VedikaClient
from telegram import Update
from telegram.ext import ApplicationBuilder, CommandHandler, MessageHandler, filters
vedika = VedikaClient(api_key="vk_live_your_key_here")
async def birth_chart(update: Update, context):
# Parse: /chart 1990-06-15 10:30 Delhi
args = context.args
if len(args) < 3:
await update.message.reply_text(
"Usage: /chart YYYY-MM-DD HH:MM City"
)
return
result = vedika.astrology.birth_chart(
datetime=f"{args[0]}T{args[1]}:00",
latitude=28.6139, longitude=77.2090,
timezone="+05:30"
)
# Format planetary positions
planets = result['planets']
text = "Your Birth Chart:\n\n"
for planet in planets:
text += f"{planet['name']}: {planet['sign']} ({planet['house']}H)\n"
await update.message.reply_text(text)
async def ask_vedika(update: Update, context):
question = update.message.text
response = vedika.chat.query(
question=question,
birth_details={
"datetime": "1990-06-15T10:30:00",
"latitude": 28.6139,
"longitude": 77.2090,
"timezone": "+05:30"
}
)
await update.message.reply_text(response['answer'])
app = ApplicationBuilder().token("YOUR_TELEGRAM_TOKEN").build()
app.add_handler(CommandHandler("chart", birth_chart))
app.add_handler(MessageHandler(filters.TEXT, ask_vedika))
app.run_polling() Key Features to Implement
Birth chart generation with /chart command. AI-powered Q&A for astrology questions. Daily horoscope notifications using scheduled jobs. Kundali matching for compatibility checks. Multi-language support (Vedika API supports 30 languages).
For production deployment, store user birth details in a database (PostgreSQL or SQLite) keyed by Telegram user ID. This enables personalized follow-up queries without re-entering birth data. Rate limit API calls per user to manage costs.
Ready to integrate astrology into your app?
Start with our free sandbox — no API key required.
Try Sandbox Free