Train Lookup by Number

trainByNumber(trainNumber: string)

Description

Resolve a train number to its stored train name.

Parameters

NameInTypeRequiredDescription
trainNumberPATHstringYESExactly 5 numeric digits

Code Example

javascript
const result = await fetch("/api/train/12345").then((res) => res.json());

if (result.success) {
  console.log(result.data.trainNo, result.data.trainName);
}

Response Example

JSON response
200JSON