# RailKit — Unofficial IRCTC API and Indian Railways API reference RailKit is an unofficial, independent Indian Railways API with a Node.js SDK and a free plan with usage limits. It is not affiliated with or endorsed by IRCTC, CRIS, or Indian Railways. Use it for PNR status, live train tracking, train schedules and search, seat availability, fares, and station data. The free plan is accessed through the SDK; direct REST API access requires Advance or Scale. Base URL: `https://api.railkit.in`. All listed routes use GET and require `x-api-key`. Direct REST access requires the Advance or Scale plan. The Live Train Map endpoint requires Scale. SDK calls require `configure(apiKey)` first; keep keys on the server. ## First SDK request ```bash npm install railkit ``` ```js import { configure, stationAmenities } from "railkit"; configure(process.env.RAILKIT_API_KEY); const result = await stationAmenities("ASN"); if (result.success) console.log(result.data); else console.error(result.error); ``` ## Responses and errors Most successes use `{ "success": true, "data": ... }`; failures use `{ "success": false, "error": "..." }`. Always check `success`. Cancelled trains also return top-level `summary` and `scan` metadata. Empty or nullable fields depend on the endpoint and upstream data. HTTP 400 indicates invalid input, 401/403 key or access issues, 404 an absent record, 429 rate or usage limits, 500 server failure, and 503 a missing current-day train-exception snapshot. Also handle network errors. Sample responses below illustrate structure, not guaranteed values. ## Endpoints (19) ### PNR Status Get complete PNR status with passenger details, journey route, and confirmation updates. SDK: `checkPNRStatus(pnr: string)` - `pnr`: 10-digit PNR number REST: `GET /api/v1/pnr/:pnr` - `pnr` (path): 10-digit PNR number PNR must be 10 digits. Example URL: `https://api.railkit.in/api/v1/pnr/6948325823` SDK example (server-side): ```js import { configure, checkPNRStatus } from "railkit"; configure(process.env.RAILKIT_API_KEY); const result = await checkPNRStatus("6948325823"); if (result.success) { console.log(result.data.train.name); console.log(result.data.journey.source.name); console.log(result.data.passengers[0].current.details); } ``` Illustrative response (fields and values vary): ```json { "success": true, "data": { "pnr": "6948325823", "train": { "number": "18021", "name": "KGP KUR EXP" }, "journey": { "dateOfJourney": "Sep 4, 2026 4:40:00 AM", "class": "CC", "quota": "GN", "source": { "code": "KGP", "name": "KHARAGPUR JN" }, "destination": { "code": "KUR", "name": "KHURDA ROAD JN" }, "boardingPoint": { "code": "KGP", "name": "KHARAGPUR JN" }, "distance": 366, "arrivalDate": "Sep 4, 2026 1:50:00 PM" }, "chart": { "status": "Chart Not Prepared" }, "booking": { "fare": 1050, "ticketFare": 1050, "bookingDate": "Aug 18, 2026 8:04:06 PM" }, "passengers": [ { "serialNumber": "Passenger 1", "coachPosition": 0, "booking": { "status": "CNF", "coach": "C1", "berthNo": 30, "berthCode": "WS", "details": "CNF/C1/30/WS" }, "current": { "status": "CNF", "coach": "C1", "berthNo": 30, "berthCode": "WS", "details": "CNF/C1/30/WS" } }, { "serialNumber": "Passenger 2", "coachPosition": 0, "booking": { "status": "CNF", "coach": "C1", "berthNo": 31, "berthCode": null, "details": "CNF/C1/31" }, "current": { "status": "CNF", "coach": "C1", "berthNo": 31, "berthCode": null, "details": "CNF/C1/31" } } ] } } ``` [Full docs](https://railkit.in/docs/pnr-status) ### Train Schedule & Route API Look up an Indian Railways train schedule by train number. Get the route, scheduled stops, arrival and departure times, running days, travel classes, and station codes. SDK: `getTrainInfo(trainNumber: string)` - `trainNumber`: 5-digit train number REST: `GET /api/v1/trains/:trainNumber/info` - `trainNumber` (path): 5-digit train number Train number must be 5 digits. Example URL: `https://api.railkit.in/api/v1/trains/12345/info` SDK example (server-side): ```js import { configure, getTrainInfo } from "railkit"; configure(process.env.RAILKIT_API_KEY); const result = await getTrainInfo("12345"); if (result.success) { console.log(result.data.trainInfo.train_name); console.log(result.data.route.length); } ``` Illustrative response (fields and values vary): ```json { "success": true, "data": { "trainInfo": { "train_no": "12345", "train_name": "SARAIGHAT EXP", "from_stn_name": "HOWRAH JN", "from_stn_code": "HWH", "to_stn_name": "GUWAHATI", "to_stn_code": "GHY", "from_time": "16:05", "to_time": "09:40", "travel_time": "17:35 hrs", "running_days": "1111111", "type": "SUPERFAST", "train_name_hindi": "हव्ह् घ्य् सरैघत् इएक्सप्रेस्स्", "type_code": "SUF", "total_distance": 998, "destination_day": 2, "classes": ["1A", "2A", "3A", "SL", "GEN", "PWD"], "pantry_type": "PC" }, "route": [{ "stnCode": "HWH", "stnName": "HOWRAH JN", "arrival": "--", "departure": "16:05", "halt": "0 min", "haltMinutes": 0, "distance": "0", "day": "1", "platform": 15, "coordinates": { "latitude": 22.584058, "longitude": 88.340979 }, "stationNameHindi": "हावड़ा जं", "division": "HWH", "daysOfArrival": "DAILY", "directionChangeCount": 0 }] } } ``` [Full docs](https://railkit.in/docs/train-info) ### NTES Live Train Running Status API Look up live train running status with a train number and journey date. The NTES response includes reported delays, stop times, route progress, distance, and coach details. Hindi station names and coach layout changes appear when available. SDK: `trackTrain(trainNumber: string, date: string)` - `trainNumber`: 5-digit train number - `date`: Required DD-MM-YYYY date; today through five days ago (IST) REST: `GET /api/v1/trains/:trainNumber/live/:date` - `trainNumber` (path): 5-digit train number - `date` (path): Journey date; today through five days ago (IST) Date: DD-MM-YYYY or YYYY-MM-DD; from today through five days ago (IST). Literal `today` is not accepted. Example URL: `https://api.railkit.in/api/v1/trains/12345/live/04-12-2026` SDK example (server-side): ```js import { configure, trackTrain } from "railkit"; configure(process.env.RAILKIT_API_KEY); const result = await trackTrain("12345", "04-12-2026"); if (result.success) { console.log(result.data.statusNote); console.log(result.data.timeline); } ``` Illustrative response (fields and values vary): ```json { "success": true, "data": { "trainNo": "12345", "trainName": "SARAIGHAT EXP", "trainNameHindi": "हव्ह् घ्य् सरैघत् इएक्सप्रेस्स्", "date": "17-Oct-2026", "statusNote": "Arrived at RAMPUR HAT (RPH)", "lastUpdate": "17-Oct-2026 19:19", "totalStations": 161, "totalStoppageStations": 18, "currentStationCode": "RPH", "totalDistanceKm": 998, "averageSpeedKmph": 61.29, "progress": { "journeyStatus": "running", "currentStationIndex": 50, "totalStations": 161, "passedStations": 49, "remainingStations": 111, "currentDistanceKm": 207, "distanceRemainingKm": 791, "percent": 20.74 }, "timeline": [ { "type": "stoppage", "status": "passed", "stationCode": "HWH", "stationName": "HOWRAH JN", "stationNameHindi": "हावड़ा जं", "platform": "15", "distanceKm": "0", "arrival": { "scheduled": "SRC", "actual": "SRC", "delay": "" }, "departure": { "scheduled": "16:05 17-Oct", "actual": "16:06 17-Oct", "delay": "00:01" } }, { "type": "intermediate", "status": "passed", "stationCode": "SYAE", "stationName": "Example intermediate station", "distanceKm": "3", "arrival": { "scheduled": "16:10" }, "departure": { "scheduled": "16:10" } } ], "coachPosition": [{ "type": "HA1", "number": "HA1", "position": "4", "id": "710580", "operatedBy": "ER", "coachType": "LWFCWAC", "coachNo": "194544", "manufacturedIn": 2019, "coachClass": "1A+2A", "variant": "1A-10-2A-28-V1" }], "coachPositionTimeline": [{ "fromStationCode": "HWH", "fromStationName": "HOWRAH JN", "coachPosition": [{ "type": "HA1", "number": "HA1", "position": "4", "id": "710580", "operatedBy": "ER", "coachType": "LWFCWAC", "coachNo": "194544", "manufacturedIn": 2019, "coachClass": "1A+2A", "variant": "1A-10-2A-28-V1" }] }] } } ``` [Full docs](https://railkit.in/docs/live-tracking) ### Track Train — V2 WIMT Track live movement using the WIMT-backed v2 endpoint, with expanded route points, current location, halt summaries, delay, speed, and coach-position data. SDK: `trackTrainV2(trainNumber: string, date: string)` - `trainNumber`: Exactly 5 numeric digits - `date`: Required date in DD-MM-YYYY or YYYY-MM-DD; today through five days ago REST: `GET /api/v2/trains/:trainNumber/live/:date` - `trainNumber` (path): 5-digit train number - `date` (path): Journey date; today through five days ago (IST) Date is required in DD-MM-YYYY or YYYY-MM-DD, from today through five days ago (IST). Example URL: `https://api.railkit.in/api/v2/trains/20888/live/04-12-2026` SDK example (server-side): ```js import { configure, trackTrainV2 } from "railkit"; configure(process.env.RAILKIT_API_KEY); const result = await trackTrainV2("20888", "04-12-2026"); if (result.success) { console.log(result.data.statusText); console.log(result.data.currentLocation); console.log(result.data.route); } ``` Illustrative response (fields and values vary): ```json { "success": true, "data": { "startDate": "12-09-2026", "lastUpdatedAt": "Sep 12, 2026, 16:22", "status": "running", "isLive": true, "statusText": "Arriving Kashi (KEI)", "trainInfo": [{ "number": "20888", "name": "VANDE BHARAT EXP", "source": { "code": "BSB", "name": "Varanasi Junction" }, "destination": { "code": "RNC", "name": "Ranchi Junction" }, "totalHalts": 10, "coachPosition": "C7,C6,C5,C4,C3,E1,C2,C1" }], "currentLocation": { "stnCode": "BSB", "stnName": "Varanasi Junction", "status": "departed", "distanceToNextStationKm": 16.85, "delayMinutes": 13 }, "nextHalt": { "stnCode": "DDU", "stnName": "Pt. DD Upadhyaya Junction (Mughalsarai)", "distance": 18.1 }, "delayMinutes": 13, "route": [ { "sequence": 1, "stnCode": "BSB", "stnName": "Varanasi Junction", "isHalt": true, "status": "departed" } ], "_provider": "wimt" } } ``` [Full docs](https://railkit.in/docs/live-tracking-v2) ### Train History API Look up a completed Indian Railways journey by five-digit train number and the date it departed its origin. RailKit returns scheduled and actual arrival and departure times, reported delays by stop, and final coach positions when available. SDK: `getTrainHistory(trainNumber: string, journeyDate: string)` - `trainNumber`: 5-digit train number - `journeyDate`: Journey date in DD-MM-YYYY REST: `GET /api/v1/trains/:trainNo/history/:journeyDate` - `trainNo` (path): 5-digit train number - `journeyDate` (path): DD-MM-YYYY journey date Use the date the train departed its origin in DD-MM-YYYY format, even for a journey that finishes the next day. A 404 means a completed record is unavailable. Example URL: `https://api.railkit.in/api/v1/trains/12301/history/03-12-2026` SDK example (server-side): ```js import { configure, getTrainHistory } from "railkit"; configure(process.env.RAILKIT_API_KEY); const result = await getTrainHistory("12301", "03-12-2026"); if (result.success) { console.log(`🚂 ${result.data.trainName} — ${result.data.journeyDate}`); result.data.stations.forEach((stop) => { console.log(`🚉 ${stop.stationName} (${stop.stationCode}) | PF ${stop.platform}`); console.log(` Arr: ${stop.arrival.scheduled} → ${stop.arrival.actual} (delay ${stop.arrival.delay}m)`); }); } ``` Illustrative response (fields and values vary): ```json { "success": true, "data": { "trainNo": "12301", "trainName": "RAJDHANI EXPRES", "journeyDate": "11-06-2026", "sourceStationCode": "HWH", "sourceStationName": "Howrah Jn", "destinationStationCode": "NDLS", "destinationStationName": "New Delhi", "coachPosition": [ { "type": "ENG", "number": "ENG", "position": "0" }, { "type": "LPR", "number": "LPR", "position": "1" }, { "type": "3A", "number": "B1", "position": "2" }, { "type": "3A", "number": "B2", "position": "3" }, { "type": "2A", "number": "A1", "position": "16" }, { "type": "VP", "number": "VP", "position": "23" } ], "stations": [ { "stationCode": "HWH", "stationName": "HOWRAH JN", "platform": "9", "arrival": { "scheduled": "SRC", "actual": "SRC" }, "departure": { "scheduled": "16:50 11-Jun", "actual": "16:50 11-Jun", "delay": "On Time" } }, { "stationCode": "ASN", "stationName": "ASANSOL JN.", "platform": "4", "distanceKm": "200", "arrival": { "scheduled": "18:47 11-Jun", "actual": "19:03 11-Jun", "delay": "16 Min" }, "departure": { "scheduled": "18:49 11-Jun", "actual": "19:05 11-Jun", "delay": "16 Min" } }, { "stationCode": "NDLS", "stationName": "NEW DELHI", "platform": "14", "distanceKm": "1449", "arrival": { "scheduled": "10:05 12-Jun", "actual": "10:13 12-Jun", "delay": "8 Min" }, "departure": { "scheduled": "DSTN", "actual": "DSTN" } } ], "lastUpdate": "12-06-2026 11:12:53 IST" } } ``` [Full docs](https://railkit.in/docs/train-history) ### Historical Train Delays API Check train punctuality by station. RailKit calculates average arrival and departure delays from completed journeys in the last three calendar months and excludes missing delay values. SDK: `getTrainDelays(trainNumber: string)` - `trainNumber`: Exactly 5 numeric digits REST: `GET /api/v1/trains/:trainNo/delays` - `trainNo` (path): Exactly 5 numeric digits Uses completed runs from the last three calendar months (IST). All averages are minutes. Missing values do not count as zero. Returns 404 when no completed runs exist in the window. Example URL: `https://api.railkit.in/api/v1/trains/12342/delays` SDK example (server-side): ```js import { configure, getTrainDelays } from "railkit"; configure(process.env.RAILKIT_API_KEY); const result = await getTrainDelays("12342"); if (result.success) { console.log(result.data.period); console.log(result.data.summary.averageDelayMinutes); console.log(result.data.stations); } ``` Illustrative response (fields and values vary): ```json { "success": true, "data": { "trainNo": "12342", "trainName": "AGNIVEENA EXP", "period": { "fromDate": "10-08-2026", "toDate": "10-11-2026" }, "summary": { "totalRuns": 92, "averageDelayMinutes": 14.5, "averageDestinationArrivalDelayMinutes": 2.8 }, "stations": [ { "stationCode": "ASN", "stationName": "ASANSOL JN", "arrival": { "averageDelayMinutes": null }, "departure": { "averageDelayMinutes": 0.6 } }, { "stationCode": "RNG", "stationName": "RANIGANJ", "arrival": { "averageDelayMinutes": 10.2 }, "departure": { "averageDelayMinutes": 10 } }, { "stationCode": "HWH", "stationName": "HOWRAH JN", "arrival": { "averageDelayMinutes": 2.8 }, "departure": { "averageDelayMinutes": null } } ] } } ``` [Full docs](https://railkit.in/docs/train-delays) ### Live Train Map Scale plan exclusive. Get current running-train positions for map clients, with location coordinates, snapshot time, and freshness flag. SDK: `getLiveTrainMap()` No parameters. REST: `GET /api/v1/trains/live-map` No parameters. Exclusive to the Scale plan. No parameters. Returns running trains, coordinates when known, lastSweepAt, count, mappedCount, and stale. The snapshot is stale when the last sweep is over five minutes old or unavailable. Example URL: `https://api.railkit.in/api/v1/trains/live-map` SDK example (server-side): ```js import { configure, getLiveTrainMap } from "railkit"; configure(process.env.RAILKIT_API_KEY); const result = await getLiveTrainMap(); if (result.success) { console.log(result.data.lastSweepAt, result.data.stale); console.log(result.data.mappedCount, result.data.trains); } ``` Illustrative response (fields and values vary): ```json { "success": true, "data": { "lastSweepAt": "2026-11-10T09:30:00.000Z", "count": 1, "mappedCount": 1, "trains": [{ "trainNo": "12342", "journeyDate": "10-11-2026", "trainName": "AGNIVEENA EXP", "trainType": "EXPRESS", "currentStation": { "code": "RNG", "name": "RANIGANJ", "lat": 23.62, "lon": 87.11 }, "upcomingStation": { "code": "UDL", "name": "ANDAL JN" }, "lastChangedAt": "2026-11-10T09:25:00.000Z" }], "stale": false } } ``` [Full docs](https://railkit.in/docs/live-train-map) ### Live Station Board API Build a live arrivals and departures board by station code. Choose a 2-, 4-, or 8-hour window for upcoming and passing trains, with reported delays and platform details when available. SDK: `liveAtStation(stationCode: string, hours?: 2 | 4 | 8)` - `stationCode`: Station code such as NDLS, BCT, HWH - `hours` (optional): Time window in hours — 2, 4, or 8 (default 2) REST: `GET /api/v1/stations/:stnCode/live?hrs=2|4|8` - `stnCode` (path): Station code - `hrs` (query, optional): 2, 4, or 8; defaults to 2 Use an uppercase station code. Optional `hrs` accepts 2, 4, or 8; default is 2. Example URL: `https://api.railkit.in/api/v1/stations/NDLS/live?hrs=4` SDK example (server-side): ```js import { configure, liveAtStation } from "railkit"; configure(process.env.RAILKIT_API_KEY); const result = await liveAtStation("NDLS", 2); if (result.success) { console.log(result.data.summary); console.log("Total trains:", result.data.totalTrains); result.data.trains.forEach((t) => { console.log(`🚂 ${t.trainNo} — ${t.trainName}`); console.log(` ${t.sourceName} → ${t.destName} | PF ${t.platform}`); console.log(` Arr: ${t.arrival.actual} (scheduled ${t.arrival.scheduled}, delay ${t.arrival.delay})`); }); } ``` Illustrative response (fields and values vary): ```json { "success": true, "data": { "summary": "39 Trains departing from/arriving at NDLS- NEW DELHI in next 2 Hrs.", "totalTrains": 39, "trains": [{ "trainNo": "12138", "trainName": "PUNJAB MAIL", "source": "FZR", "sourceName": "FIROZPUR CANT", "dest": "CSMT", "destName": "C SHIVAJI MAH T", "trainType": "SUPERFAST", "classes": "1A,2A,3A,SL,GEN,PWD", "runDate": "27-Aug-2026", "platform": "3", "cancelled": null, "arrival": { "actual": "05:16", "scheduled": "04:55", "delay": "21 Mins.", "delayed": true }, "departure": { "actual": "05:21", "scheduled": "05:10", "delay": "11 Mins.", "delayed": true } }] } } ``` [Full docs](https://railkit.in/docs/station-live) ### Trains Between Stations API Find direct Indian Railways trains between two station codes, with optional journey date filtering. Results include scheduled departures and arrivals, travel time, distance, and running days. SDK: `searchTrainBetweenStations(fromStnCode: string, toStnCode: string, date?: string)` - `fromStnCode`: Origin station code - `toStnCode`: Destination station code - `date` (optional): Journey date in DD-MM-YYYY (optional) REST: `GET /api/v1/trains/between/:fromStnCode/:toStnCode?date=DD-MM-YYYY` - `fromStnCode` (path): Origin station code - `toStnCode` (path): Destination station code - `date` (query, optional): Optional DD-MM-YYYY journey date The `date` query parameter is optional. Example URL: `https://api.railkit.in/api/v1/trains/between/NDLS/BCT?date=04-12-2026` SDK example (server-side): ```js import { configure, searchTrainBetweenStations } from "railkit"; configure(process.env.RAILKIT_API_KEY); const result = await searchTrainBetweenStations("NDLS", "BCT", "04-12-2026"); if (result.success) { console.log(result.data.map((t) => t.train_name)); } ``` Illustrative response (fields and values vary): ```json { "success": true, "data": [{ "train_no": "12904", "train_name": "GOLDEN TEMPLE M", "source_stn_name": "Amritsar Jn", "source_stn_code": "ASR", "dstn_stn_name": "Bandra Terminus", "dstn_stn_code": "BDTS", "from_stn_name": "Hazrat Nizamuddin", "from_stn_code": "NZM", "to_stn_name": "Bandra Terminus", "to_stn_code": "BDTS", "from_time": "04:00", "to_time": "23:55", "travel_time": "19:55 hrs", "running_days": "1111111", "distance": "1365", "halts": 20 }] } ``` [Full docs](https://railkit.in/docs/train-search) ### Seat Availability Check availability forecasts and detailed fare breakup by quota and class. SDK: `getAvailability(trainNo: string, fromStnCode: string, toStnCode: string, date: string, coach: string, quota: string)` - `trainNo`: 5-digit train number - `fromStnCode`: Origin station code - `toStnCode`: Destination station code - `date`: Journey date in DD-MM-YYYY - `coach`: 1A, 2A, 3A, 3E, CC, EC, EA, FC, SL, 2S, VS, CH, HS, VC, VA - `quota`: GN, TQ, LD, DF, FT, LB, PT, YU, DP, HP, PH, SS REST: `GET /api/v1/seats/:trainNo/:fromStnCode/:toStnCode/:date/:coach/:quota` - `trainNo` (path): 5-digit train number - `fromStnCode` (path): Origin station code - `toStnCode` (path): Destination station code - `date` (path): DD-MM-YYYY journey date - `coach` (path): Travel class - `quota` (path): Booking quota Date format: DD-MM-YYYY. Example URL: `https://api.railkit.in/api/v1/seats/12904/NZM/BDTS/11-12-2026/3A/GN` SDK example (server-side): ```js import { configure, getAvailability } from "railkit"; configure(process.env.RAILKIT_API_KEY); const result = await getAvailability( "12904", "NZM", "BDTS", "11-12-2026", "3A", "GN" ); ``` Illustrative response (fields and values vary): ```json { "success": true, "data": { "train": { "trainNo": "12904", "trainName": "GOLDEN TEMPLE M", "from": "NZM", "to": "BDTS", "fromStationName": "Delhi Hazrat Nizamuddin", "toStationName": "Mumbai Bandra Terminus", "distance": 1366, "travelClass": "3A", "quota": "GN" }, "fare": { "baseFare": 1505, "reservationCharge": 40, "superfastCharge": 45, "serviceTax": 80, "totalFare": 1670 }, "availability": [{ "date": "1-9-2026", "status": "WAITLIST", "availabilityText": "WL 23", "rawStatus": "RLWL31/WL23", "prediction": "73% Chance", "predictionPercentage": 73, "canBook": true }] } } ``` [Full docs](https://railkit.in/docs/seat-availability) ### Train Fare Enquiry API Look up an Indian Railways train fare by train number, station pair, date, class, and quota. The fare breakdown can include reservation and superfast charges, catering, GST, dynamic fare, and the total. SDK: `fareLookup(trainNo: string, fromStnCode: string, toStnCode: string, date: string, travelClass: string, quota: string)` - `trainNo`: 5-digit train number - `fromStnCode`: Origin station code - `toStnCode`: Destination station code - `date`: Journey date in DD-MM-YYYY - `travelClass`: 1A · 2A · 3A · 3E · CC · EC · EA · FC · SL · 2S · VS · CH · HS · VC · VA - `quota`: GN · TQ · PT · LD · DF · FT · LB · YU · DP · HP · PH · SS REST: `GET /api/v1/fare/:trainNo/:date/:fromStation/:toStation/:class/:quota` - `trainNo` (path): 5-digit train number - `date` (path): DD-MM-YYYY journey date - `fromStation` (path): Origin station code - `toStation` (path): Destination station code - `class` (path): Travel class - `quota` (path): Booking quota Returns full fare breakdown. Date format: DD-MM-YYYY. Example URL: `https://api.railkit.in/api/v1/fare/12904/11-12-2026/NZM/BDTS/3A/GN` SDK example (server-side): ```js import { configure, fareLookup } from "railkit"; configure(process.env.RAILKIT_API_KEY); const result = await fareLookup( "12904", "NZM", "BDTS", "11-12-2026", "3A", "GN" ); if (result.success) { const d = result.data; console.log(`${d.trainName} (${d.trainNo})`); console.log(`${d.from} → ${d.to} | ${d.distance} km`); console.log(`Base: ₹${d.baseFare} GST: ₹${d.gst} Total: ₹${d.totalFare}`); } ``` Illustrative response (fields and values vary): ```json { "success": true, "data": { "trainNo": "12904", "trainName": "GOLDEN TEMPLE M", "from": "NZM", "to": "BDTS", "class": "3A", "distance": 1366, "baseFare": 1505, "reservation": 40, "superfast": 45, "fuelAmount": 0, "concession": 0, "tatkalFare": 0, "gst": 80, "otherCharge": 0, "catering": 0, "dynamicFare": 0, "totalFare": 1670 } } ``` [Full docs](https://railkit.in/docs/fare-lookup) ### Cancelled Trains Get today's IST snapshot of fully and partially cancelled trains plus diversions. Includes routes, affected segments, reasons, and scan coverage. SDK: `cancelList()` No parameters. REST: `GET /api/v1/trains/cancelled` No parameters. Returns today's IST scan only; date changes at 00:00 IST. No parameters. summary.total counts cancellations; summary.diverted counts diversions separately, and one train can appear in both lists. reportedAt is scan observation time, not exception creation time; sourceUpdatedAt is the NTES response update time. reason may be null. scan.complete is false when some train checks failed. Returns 503 if today's snapshot is unavailable; no previous or next-day fallback. Example URL: `https://api.railkit.in/api/v1/trains/cancelled` SDK example (server-side): ```js import { configure, cancelList } from "railkit"; configure(process.env.RAILKIT_API_KEY); const result = await cancelList(); if (result.success) { console.log("Cancellations:", result.summary.total); console.log("Fully cancelled:", result.summary.fullyCancelled); console.log("Partially cancelled:", result.summary.partiallyCancelled); console.log("Diverted:", result.summary.diverted); console.log("Scan complete:", result.scan.complete); result.data.fullyCancelledTrains.forEach((train) => { console.log(train.trainNo + " — " + train.trainName, train.reason); }); result.data.partiallyCancelledTrains.forEach((train) => { console.log( train.trainNo + ": " + (train.cancelledSegment.from?.name ?? "Unknown") + " → " + (train.cancelledSegment.to?.name ?? "Unknown"), train.reason ); }); result.data.divertedTrains.forEach((train) => { console.log(train.trainNo + " diverted", train.diversion.from?.code, "→", train.diversion.to?.code, train.reason); }); } ``` Illustrative response (fields and values vary): ```json { "success": true, "summary": { "total": 2, "fullyCancelled": 1, "partiallyCancelled": 1, "diverted": 1, "unknownSchedules": 7, "skippedUnknownSchedules": 7, "journeyDates": ["11-11-2026"] }, "data": { "fullyCancelledTrains": [{ "trainNo": "52451", "trainName": "KLK-SML SHIVALIK DELUXE", "journeyDate": "11-11-2026", "status": "fully_cancelled", "route": { "source": { "code": "KLK", "name": "KALKA" }, "destination": { "code": "SML", "name": "SHIMLA" } }, "cancelledSegment": null, "trainType": "PAS", "reportedAt": "10-11-2026 20:00:00 IST", "sourceUpdatedAt": "10-Nov-2026 19:59", "reason": "Track restoration work", "message": "Train is Cancelled" }], "partiallyCancelledTrains": [{ "trainNo": "11002", "trainName": "NANDIGRAM EXP", "journeyDate": "11-11-2026", "status": "partially_cancelled", "route": { "source": { "code": "BPQ", "name": "BALHARSHAH" }, "destination": { "code": "CSMT", "name": "C SHIVAJI MAH T" } }, "cancelledSegment": { "from": { "code": "DR", "name": "DADAR" }, "to": { "code": "CSMT", "name": "CHHATRAPATI SHIVAJI MAHARAJ TERMINUS" } }, "trainType": "MEX", "reportedAt": "10-11-2026 20:00:00 IST", "sourceUpdatedAt": "10-Nov-2026 19:59", "reason": "Platform work", "message": "Train is Partially Cancelled" }], "divertedTrains": [{ "trainNo": "22411", "trainName": "NAHARLAGUN - NEW DELHI AC SF", "journeyDate": "11-11-2026", "status": "diverted", "route": { "source": { "code": "NHLN", "name": "NAHARLAGUN" }, "destination": { "code": "ANVT", "name": "ANAND VIHAR TRM" } }, "trainType": "SUPERFAST", "reportedAt": "10-11-2026 20:00:00 IST", "sourceUpdatedAt": "10-Nov-2026 19:59", "reason": "Corridor block", "message": "Train is Diverted", "diversion": { "from": { "code": "NCB", "name": "NEW COOCH BEHAR" }, "to": { "code": "YLSC", "name": "Y LEG SPL CLASS STAT" }, "route": [{ "code": "NCB", "name": "NEW COOCH BEHAR" }, { "code": "YLSC", "name": "Y LEG SPL CLASS STAT" }] } }] }, "scan": { "journeyDate": "11-11-2026", "scannedAt": "2026-11-10T14:30:00.000Z", "checked": 8593, "totalCandidates": 8593, "failed": 0, "unknownSchedules": 7, "skippedUnknownSchedules": 7, "trainDataUpdatedAtIST": "10/11/2026, 06:54:48", "complete": true } } ``` [Full docs](https://railkit.in/docs/cancelled-trains) ### Station Timetable API Find scheduled trains at an Indian railway station by station code, with arrival and departure times, running days, and travel classes. Omit the date for the full timetable, or filter by yesterday, today, or tomorrow (IST). SDK: `trainTimetableAtStation(stationCode: string, date?: string)` - `stationCode`: Station code such as ASN or NDLS - `date` (optional): Optional DD-MM-YYYY date; only today, yesterday, or tomorrow is accepted REST: `GET /api/v1/stations/:stationCode/timetable?date=DD-MM-YYYY` - `stationCode` (path): Station code - `date` (query, optional): Optional DD-MM-YYYY date: yesterday, today, or tomorrow (IST) Omit date for all trains. A supplied DD-MM-YYYY date must be yesterday, today, or tomorrow (IST). Example URL: `https://api.railkit.in/api/v1/stations/ASN/timetable?date=04-12-2026` SDK example (server-side): ```js import { configure, trainTimetableAtStation } from "railkit"; configure(process.env.RAILKIT_API_KEY); const result = await trainTimetableAtStation( "ASN","04-12-2026" ); if (result.success) { console.log(result.data.totalTrains); console.log(result.data.trains[0].trainName); } ``` Illustrative response (fields and values vary): ```json { "success": true, "data": { "summary": "168 Trains scheduled at ASN - ASANSOL JN. on 28-Aug-2026", "station": "ASN", "date": "28-Aug-2026", "totalTrains": 168, "trains": [{ "trainNo": "15052", "trainName": "GKP KOAA EXP", "source": "GKP", "sourceName": "Gorakhpur Jn", "destination": "KOAA", "destinationName": "Kolkatta Terminal", "trainType": "Mail Express", "classes": "1A,2A,3A,SL,GEN,PWD", "runningDays": "", "arrival": "00:01", "departure": "00:11" }] } } ``` [Full docs](https://railkit.in/docs/station-timetable) ### Station Lookup by Code Resolve a station code to its name and coordinates. SDK: `stationByCode(stationCode: string)` - `stationCode`: Station code such as NDLS or HWH REST: `GET /api/v1/stations/:stationCode` - `stationCode` (path): 1-5 letters or digits Station code must be 1-5 letters or digits. Example URL: `https://api.railkit.in/api/v1/stations/NDLS` SDK example (server-side): ```js import { configure, stationByCode } from "railkit"; configure(process.env.RAILKIT_API_KEY); const result = await stationByCode("NDLS"); if (result.success) { console.log(result.data.code, result.data.name); } ``` Illustrative response (fields and values vary): ```json { "success": true, "data": { "code": "NDLS", "name": "NEW DELHI", "lat": 28.642464, "lon": 77.220154 } } ``` [Full docs](https://railkit.in/docs/station-by-code) ### Station Amenities Get station facilities in a readable structure, including platforms, passenger amenities, counts, and facility availability. SDK: `stationAmenities(stationCode: string)` - `stationCode`: Station code such as ASN or NDLS REST: `GET /api/v1/stations/:stationCode/amenities` - `stationCode` (path): 1-5 letters or digits Station code must be 1-5 letters or digits. Availability fields are booleans; measurements and counts retain their source values. Example URL: `https://api.railkit.in/api/v1/stations/ASN/amenities` SDK example (server-side): ```js import { configure, stationAmenities } from "railkit"; configure(process.env.RAILKIT_API_KEY); const result = await stationAmenities("ASN"); if (result.success) { console.log(result.data.platforms); console.log(result.data.wheelchairAvailable); console.log(result.data.dailyPassengerCount); } ``` Illustrative response (fields and values vary): ```json { "success": true, "data": { "stationCategory": "NSG2 (A)", "platforms": "1-2, 3-4, 5-6, 7", "dailyPassengerCount": 29206, "footOverBridgeCount": 4, "subwayCount": 0, "atmCount": 2, "toiletCount": 65, "retiringRoomCount": 7, "waitingRoomSeatCount": 230, "seatingCapacity": 1300, "escalatorCount": 2, "wheelchairAvailable": true, "enquiryOfficeCount": 1, "bookingWindowCount": 13, "concourseArea": 14000, "foodPlazaAvailable": true, "electronicTrainDisplayAvailable": true, "fanCount": 143, "liftCount": 2, "waterFacilityCount": 142, "parkingAvailable": true, "entryCount": 2, "exitCount": 2, "passengerReservationWindowAvailable": true, "cashCoinSmartCardTicketVendingMachineAvailable": true } } ``` [Full docs](https://railkit.in/docs/station-amenities) ### Station Search by Name Find up to 10 matching stations by partial name. SDK: `stationsByName(name: string)` - `name`: At least 2 characters; partial matching supported REST: `GET /api/v1/stations/search?name=...` - `name` (query): At least 2 characters Name must contain at least 2 characters. Returns at most 10 matches. Example URL: `https://api.railkit.in/api/v1/stations/search?name=delhi` SDK example (server-side): ```js import { configure, stationsByName } from "railkit"; configure(process.env.RAILKIT_API_KEY); const result = await stationsByName("delhi"); if (result.success) { result.data.stations.forEach((station) => { console.log(station.name, station.code); }); } ``` Illustrative response (fields and values vary): ```json { "success": true, "data": { "query": "delhi", "count": 2, "stations": [ { "code": "ANDI", "name": "ADARSH NAGAR DELHI", "lat": 28.714265, "lon": 77.166767 }, { "code": "DAZ", "name": "DELHI AZADPUR", "lat": 28.703086, "lon": 77.177153 } ] } } ``` [Full docs](https://railkit.in/docs/station-search) ### Railway Routes Between Stations API Find railway paths between two station codes from recorded train routes. Results list the stations along each path and rank paths by the number of trains that serve them, then distance. SDK: `stationRoutes(fromCode: string, toCode: string)` - `fromCode`: Origin station code, 1-5 letters only - `toCode`: Destination station code, 1-5 letters only REST: `GET /api/v1/stations/route/:fromStationCode/:toStationCode` - `fromStationCode` (path): Origin station code, 1-5 letters only - `toStationCode` (path): Destination station code, 1-5 letters only Returns up to three distinct ordered station segments found on actual cached NTES train routes that contain both station codes in this direction, ranked by descending train count then ascending distance. If no train covers both stations, returns estimated paths derived from recorded rail segments with estimated: true and empty train lists. Names and coordinates refresh from station.json when it changes. Example URL: `https://api.railkit.in/api/v1/stations/route/NDLS/CNB` SDK example (server-side): ```js import { configure, stationRoutes } from "railkit"; configure(process.env.RAILKIT_API_KEY); const result = await stationRoutes("NDLS", "DLI"); if (result.success) { for (const route of result.data.routes) { console.log(route.rank, route.distanceKm, route.stations.map((station) => station.code)); } } ``` Illustrative response (fields and values vary): ```json { "success": true, "data": { "from": { "code": "NDLS", "name": "NEW DELHI", "lat": 28.642314, "lon": 77.220004 }, "to": { "code": "DLI", "name": "DELHI JN", "lat": 28.661816, "lon": 77.228356 }, "routes": [ { "rank": 1, "distanceKm": 441, "stationCount": 68, "intermediateStationCount": 66, "stations": [ { "code": "NDLS", "name": "NEW DELHI", "lat": 28.642314, "lon": 77.220004 }, { "code": "DSB", "name": "SADAR BAZAR", "lat": 28.6586, "lon": 77.2168 } ] } ], "note": "Each returned station sequence is served by the train numbers listed on that route." } } ``` [Full docs](https://railkit.in/docs/station-routes) ### Train Lookup by Number Find up to 10 stored trains matching a train-number prefix. SDK: `trainByNumber(trainNumber: string)` - `trainNumber`: 2-5 digit train-number prefix REST: `GET /api/v1/trains/:trainNumber` - `trainNumber` (path): 2-5 digit train-number prefix Accepts a 2-5 digit prefix and returns up to 10 matches. Example URL: `https://api.railkit.in/api/v1/trains/12345` SDK example (server-side): ```js import { configure, trainByNumber } from "railkit"; configure(process.env.RAILKIT_API_KEY); const result = await trainByNumber("12345"); if (result.success) { result.data.trains.forEach((train) => console.log(train.trainNo, train.trainName)); } ``` Illustrative response (fields and values vary): ```json { "success": true, "data": { "query": "12345", "count": 1, "trains": [{ "trainNo": "12345", "trainName": "HWH GHY SARAIGHAT EXPRESS" }] } } ``` [Full docs](https://railkit.in/docs/train-by-number) ### Train Search by Name Find up to 10 trains matching a partial train name. SDK: `trainsByName(name: string)` - `name`: At least 2 letters; letters and spaces only REST: `GET /api/v1/trains/search?name=...` - `name` (query): At least 2 letters Name must contain letters and spaces only, at least 2 letters. Returns at most 10 matches. Example URL: `https://api.railkit.in/api/v1/trains/search?name=rajdhani` SDK example (server-side): ```js import { configure, trainsByName } from "railkit"; configure(process.env.RAILKIT_API_KEY); const result = await trainsByName("rajdhani"); if (result.success) { result.data.trains.forEach((train) => { console.log(train.trainName, train.trainNo); }); } ``` Illustrative response (fields and values vary): ```json { "success": true, "data": { "query": "rajdhani", "count": 2, "trains": [ { "trainNo": "12301", "trainName": "RAJDHANI EXPRES" }, { "trainNo": "12302", "trainName": "HWH RAJDHANI" } ] } } ``` [Full docs](https://railkit.in/docs/train-name-search)