Fare Lookup

fareLookup(trainNo: string, fromStnCode: string, toStnCode: string, date: string, travelClass: string, quota: string)

Description

Get the full fare breakdown for a journey — base fare, reservation, superfast, catering, GST, dynamic fare, and total collectible amount.

Parameters

NameInTypeRequiredDescription
trainNoARGUMENTstringYES5-digit train number
fromStnCodeARGUMENTstringYESOrigin station code
toStnCodeARGUMENTstringYESDestination station code
dateARGUMENTstringYESJourney date in DD-MM-YYYY
travelClassARGUMENTstringYES1A · 2A · 3A · 3E · CC · EC · EA · FC · SL · 2S · VS · CH · HS · VC · VA
quotaARGUMENTstringYESGN · 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",
  "25-10-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

JSON response
200JSON