Build a Telegram Alert Bot for Vacant Berths After Chart Preparation
Learn how to monitor Indian Railways chart preparation 4 hours before departure and send instant Telegram push notifications when vacant berths open for Current Booking.
- •Node.js 18+ installed locally or on a cloud server
- •A Telegram account to create a bot token with @BotFather
- •Free IRCTC Developer API key from https://irctc.dev/dashboard
Cron job polls https://api.irctc.dev/api/v1/trains/:trainNo/chart-vacant every 2 minutes starting 4.5 hours before departure ➔ Checks isChartPrepared === true ➔ Extracts vacant seats in 3A/2A/SL ➔ Sends rich Telegram alert with 1-click booking link.
Create Your Telegram Bot with @BotFather
Open Telegram, search for @BotFather, send /newbot, and follow prompts to name your bot. Save the HTTP API bot token (e.g. 7182938491:AAH...g).
Project Setup & Package Installation
Create a directory and install node-telegram-bot-api for Telegram notifications, irctc-api for real-time vacant berth checking, and node-cron for automated scheduling.
Configure .env Secrets
Store your Telegram credentials and IRCTC API key in .env.
Implement the Chart Vacant Monitoring Engine
Create bot.ts to poll the vacant berth endpoint, filter target travel classes (e.g. 3A, 2A, SL), and dispatch formatted Telegram push alerts.
Run with Docker or PM2
Keep the script running 24/7 on a cloud server so you never miss a chart preparation announcement.
Vacant Berths After Charting API
Test live queries and inspect sub-100ms response payloads directly in the browser sandbox.
Frequently Asked Questions
Related Tutorials
View All Guides →Build a WhatsApp Train Running Status & PNR Bot in Node.js
Step-by-step guide to building a production-ready WhatsApp bot for live Indian Railways GPS tracking, PNR verification, and seat availability using Baileys and the irctc-api SDK.
Check Indian Railway PNR Status Programmatically
The definitive developer guide to querying live 10-digit PNR status, passenger manifests, berth allocations, and charting status with Node.js and Python.
Automated 14-Day Seat Availability Tracker in Python
Monitor Indian Railways seat availability across classes and quotas with a recurring Python daemon and instant Telegram/Discord alerts.