USE CASE
Daily Rashifal Automation: Automate Horoscope Content
Generate daily horoscopes for all 12 signs automatically. Perfect for websites, apps, and newsletters.
January 7, 2026
-
12 min read
Automation Script
// Cron job to fetch daily horoscopes at midnight
const cron = require('node-cron');
const { Vedika } = require('@vedika/sdk');
const vedika = new Vedika({ apiKey: process.env.VEDIKA_API_KEY });
const SIGNS = ['aries', 'taurus', 'gemini', 'cancer', 'leo', 'virgo',
'libra', 'scorpio', 'sagittarius', 'capricorn', 'aquarius', 'pisces'];
// Run at 12:01 AM every day
cron.schedule('1 0 * * *', async () => {
console.log('Fetching daily horoscopes...');
const horoscopes = await Promise.all(
SIGNS.map(sign => vedika.horoscope({ sign, period: 'daily' }))
);
// Save to database or cache
for (let i = 0; i < SIGNS.length; i++) {
await saveToDatabase(SIGNS[i], horoscopes[i]);
}
console.log('Daily horoscopes updated!');
});
async function saveToDatabase(sign, horoscope) {
// Your database logic here
await db.horoscopes.upsert({
sign,
date: new Date().toISOString().split('T')[0],
prediction: horoscope.prediction,
luckyNumber: horoscope.luckyNumber,
luckyColor: horoscope.luckyColor
});
}
Multi-Language Support
// Fetch horoscopes in multiple languages
const LANGUAGES = ['en', 'hi', 'ta', 'te', 'bn', 'gu', 'mr', 'kn'];
async function fetchMultiLanguageHoroscopes() {
for (const lang of LANGUAGES) {
for (const sign of SIGNS) {
const horoscope = await vedika.horoscope({
sign,
period: 'daily',
language: lang
});
await saveToDatabase(sign, lang, horoscope);
}
}
}
// Total: 12 signs x 8 languages = 96 horoscopes per day
Email Newsletter Integration
// Send personalized daily horoscope emails
const sendgrid = require('@sendgrid/mail');
async function sendDailyHoroscopeEmails() {
// Get subscribers grouped by sign
const subscribers = await db.subscribers.findAll();
for (const user of subscribers) {
const horoscope = await getCachedHoroscope(user.sign, user.language);
await sendgrid.send({
to: user.email,
from: '[email protected]',
subject: `Your ${user.sign} Horoscope for ${today}`,
html: generateEmailTemplate(horoscope, user)
});
}
}
Cost Optimization
- Cache aggressively: Same horoscope for all users of same sign
- Batch requests: Fetch all 12 signs at once, not per-user
- Pre-generate: Run cron job at off-peak hours
- CDN caching: Serve from edge for API responses
Automate Your Rashifal
Vedika API provides daily, weekly, and monthly horoscopes in 30 languages. One API call per sign per day.
Get API Key