Train Fare Enquiry API
fareLookup(trainNo: string, fromStnCode: string, toStnCode: string, date: string, travelClass: string, quota: string)Description
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.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
trainNo | ARGUMENT | string | YES | 5-digit train number |
fromStnCode | ARGUMENT | string | YES | Origin station code |
toStnCode | ARGUMENT | string | YES | Destination station code |
date | ARGUMENT | string | YES | Journey date in DD-MM-YYYY |
travelClass | ARGUMENT | string | YES | 1A · 2A · 3A · 3E · CC · EC · EA · FC · SL · 2S · VS · CH · HS · VC · VA |
quota | ARGUMENT | string | YES | GN · TQ · PT · LD · DF · FT · LB · YU · DP · HP · PH · SS |
Code Example
javascript
import { configure, fareLookup } from "railkit";
configure(process.env.RAILKIT_API_KEY);
const result = await fareLookup(
"12904", "NZM", "BDTS",
"10-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}`);
}Response Example