IRS: An Indian Rail Search App with Official IRCTC Fares
Anyone who has planned a train trip in India knows the routine. You check one site for trains between two stations, another for live running status, a third for PNR status, and then a booking site where you hope the fare matches what you saw earlier. Many third-party booking apps also add an agent fee on top of the IRCTC price. I wanted one place that answers the common questions and does not add anything to the fare. That became IRS: Indian Rail Search.
Why I built it
I build web apps, games and AI tools as side projects, and a rail utility was an obvious gap in my own list. The information I wanted already exists, but it is scattered. The second reason was money. The fare IRCTC charges is the fare, and any app that shows a higher number is adding its own commission. I wanted a tool that shows the exact IRCTC fare and sends you to the official booking page to pay.
The data comes from RailKit, a read-only API for Indian railway data. That detail shapes the whole project, so it is worth stating early: IRS can show you trains, fares, availability and status, but it cannot sell you a ticket. Purchase has to happen on IRCTC.
What it does
The app is organised as eight tabs, each answering one question.
- Plan Journey: trains between any two stations with departure and arrival times, travel time, distance in km, halts and running days. Tapping a class shows the official fare breakdown and six-day seat availability with a confirmation chance.
- Train Route: the full route and timetable, total distance, platform numbers, map links, and a calculator for distance and time between any two stops on the route.
- Live Track: live running status with a moving-train progress bar, delays at each station, coach position and optional auto-refresh.
- Run History: actual versus scheduled times for completed runs, plus a punctuality report for the last five days.
- PNR Status: booking and current status per passenger, chart status and fare.
- Station: a live LED-style arrivals and departures board for 2, 4 or 8 hours ahead, amenities, and the full station timetable.
- Cancelled: today's fully and partially cancelled trains, with filters.
- IRCTC Services: direct links to official booking, cancellation and TDR, e-catering, retiring rooms, UTS, NTES and Rail Madad.
Zero commission, honestly described
The Book on IRCTC button copies your trip details (train, stations, date and class) to the clipboard and opens the official IRCTC booking page. No agent is involved, so there is no agent fee. I want to be precise about one thing, though: IRCTC's own small convenience fee, roughly 15 rupees for non-AC and 30 rupees for AC plus GST, still applies at payment. IRS does not remove that and does not claim to.
How it works
The stack is deliberately small: JavaScript, HTML and CSS, with an Express server in front.
server.jsis the Express server. It holds the RailKit API key, validates input, caches responses briefly and exposes a set of/api/*routes.public/contains a dependency-free front end in plain HTML, CSS and JS. It is responsive on mobile, supports light and dark mode, and shows a train-running loader while data loads.
Why a server in the middle
A browser app that calls a paid or keyed API directly has to ship the key to every visitor. Anyone can open the network tab and copy it. Putting a thin proxy between the page and the API keeps the key in a server-side environment file, and the browser only ever talks to my own /api/* routes. The key lives in .env, which is in .gitignore and never committed. A .env.example file documents what is needed without containing a real value.
The proxy also gives you two other places to add value cheaply. First, input validation: a train number or PNR has a known shape, so malformed requests can be rejected before they cost an upstream call. Second, brief caching: timetables and station data do not change by the second, so serving a repeated request from memory for a short time reduces upstream traffic and speeds up the page. The cache has to stay brief for live data such as running status, which is why I kept it short rather than aggressive.
Why no front-end framework
The interface is a set of tabs that fetch data and render tables, lists and a progress bar. That does not need a build step or a component library. Plain HTML, CSS and JS means no bundler, fast first load on slow mobile connections, and nothing to upgrade. For a utility that people may open at a crowded station on a weak signal, that trade-off made sense to me.
Running it locally
- Run
npm install. - Copy
.env.exampleto.envand put your RailKit API key in it. - Run
npm startand open the local address on port 3000.
For development, npm run dev restarts the server when files change.
What I learned
- Be exact about what the tool cannot do. A read-only data API means no ticket purchase. Rather than hiding that, the app hands off cleanly to IRCTC and copies the trip details so you do not retype them. A good hand-off is a feature.
- Keep secrets on the server, always. The proxy pattern is small, but it is the reusable lesson here. If your front end needs a keyed API, add a server layer instead of trusting obscurity.
- Cache by data type. Static timetables and live status deserve different lifetimes. One global cache setting would be either stale or useless.
- Show the numbers people actually decide on. Distance in km, platform numbers, six-day availability and a confirmation chance are the details that change a decision, so I put them in the main views and not behind extra taps.
- Dependency-free is a legitimate choice. For tab-based data viewers, vanilla JS stays readable and light.
Try it
The app is live at https://irs-ir.vercel.app. Try Plan Journey with a route you know and compare the fare with what you see on IRCTC. If you find something that looks wrong or missing, write to me at hello@iramesh.com.
Conclusion
IRS is a small Express proxy and a plain front end that gathers search, tracking, PNR and station information in one place and keeps the fare identical to IRCTC's. It is not a booking engine, and it says so. What it does is remove the tab-hopping before you book, and then step aside.