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.
- •Python 3.9+ with requests and schedule installed (pip install requests schedule)
- •Free API key from https://irctc.dev/dashboard
- •Telegram bot token and chat ID for notifications
Background Python daemon schedules periodic requests to https://api.irctc.dev/api/v1/trains/:trainNo/availability with date in DD-MM-YYYY format ➔ Parses 14-day availability array and tracks status changes in memory ➔ Fires Telegram webhook whenever status transitions from WL/RAC to AVAILABLE.
Install Dependencies & Setup Environment
Create a virtual environment and install requests for API communication and schedule for recurring execution.
Query 14-Day Live Availability with Date Parsing
Construct an authenticated HTTP GET request to the Seat Availability endpoint. Note that the date parameter must follow the DD-MM-YYYY format.
State Machine & Change Detection
Keep an in-memory dictionary of last known statuses to prevent duplicate alert notifications. Trigger an alert only when a seat status flips to AVAILABLE.
Dispatch Telegram Alert & Run Recurring Daemon
Send markdown formatted notifications via Telegram Bot API and schedule the checker to run every 10 minutes.
IRCTC Seat Availability 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.
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.
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.