Train History

getTrainHistory(trainNumber: string, journeyDate: string)

Description

Get the completed journey history of a train for a specific date — full station-by-station timeline, per-stop delays, and final coach position once the train has reached its destination.

Parameters

NameInTypeRequiredDescription
trainNumberPATHstringYES5-digit train number
journeyDatePATHstringYESJourney date in DD-MM-YYYY

Code Example

javascript
const result = await getTrainHistory("12301", "11-06-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)`);
  });
}

Response Example

JSON response
200JSON