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.
- •Basic familiarity with JavaScript/TypeScript or Python
- •A valid 10-digit Indian Railways PNR number
- •Free API key from https://irctc.dev/dashboard
Client application sends HTTP GET https://api.irctc.dev/api/v1/pnr/:pnr with x-api-key header ➔ Gateway queries central PRS reservation engine with zero browser overhead ➔ Returns normalized JSON passenger manifest with coach, berth, and chartStatus in under 100ms.
Anatomy of an Indian Railways PNR
A Passenger Name Record (PNR) is a unique 10-digit number generated by the PRS reservation system upon ticket booking. The first 3 digits indicate the PRS booking zone (e.g. 2 for Northern Railway, 8 for South Eastern), and the remaining 7 digits form the unique passenger record.
Check PNR in Node.js / TypeScript
Using the irctc-api npm package, checking a PNR requires just 3 lines of code with complete TypeScript types.
Check PNR in Python
In Python, you can use the standard requests library to call the gateway directly with standard JSON parsing.
Understanding Passenger Status Transitions
Indian Railways passengers transition across three primary booking states: CNF (Confirmed), RAC (Reservation Against Cancellation), and WL (Waitlist).
Smart Polling vs Anti-Patterns
Do NOT poll PNR every 5 seconds. PNR status only changes upon cancellation or chart preparation (4 hours prior to departure). A smart backoff algorithm polls once daily until 24h before travel, then once every 30 minutes.
Real-Time PNR Status 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.
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.