Live At Station
liveAtStation(stationCode: string, hours?: number)Description
Get upcoming and passing trains at a station with near real-time status, delays, and platform info.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
stationCode | PATH | string | YES | Station code such as NDLS, BCT, HWH |
hours | QUERY | number | NO | Time window in hours — 2, 4, or 8 (default 2) |
Code Example
javascript
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})`);
});
}Response Example