Station Train Timetable
trainTimetableAtStation(stationCode: string, date?: string)Description
Get all scheduled trains at a station, or filter by a nearby running date.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
stationCode | ARGUMENT | string | YES | Station code such as ASN or NDLS |
date | ARGUMENT | string | NO | Optional DD-MM-YYYY date; only today, yesterday, or tomorrow is accepted |
Code Example
javascript
import { configure, trainTimetableAtStation } from "railkit";
configure(process.env.RAILKIT_API_KEY);
const result = await trainTimetableAtStation( "ASN","18-10-2026" );
if (result.success) {
console.log(result.data.totalTrains);
console.log(result.data.trains[0].trainName);
}Response Example