Live Station Board API
liveAtStation(stationCode: string, hours?: 2 | 4 | 8)Description
Build a live arrivals and departures board by station code. Choose a 2-, 4-, or 8-hour window for upcoming and passing trains, with reported delays and platform details when available.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
stationCode | ARGUMENT | string | YES | Station code such as NDLS, BCT, HWH |
hours | ARGUMENT | number | NO | Time window in hours — 2, 4, or 8 (default 2) |
Code Example
javascript
import { configure, liveAtStation } from "railkit";
configure(process.env.RAILKIT_API_KEY);
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