Train Schedule

GETGET /v1/train/:number/schedule?date=YYYY-MM-DD

Description

Scheduled journey information for a train on a given date: origin, destination, departure and arrival times, travel time, travel classes and running days. This is timetable data, not live movement — pair it with Live Train Status for position and delay.

Parameters

NameInTypeRequiredDescription
numberPATHstringYESPath param — 5-digit train number, e.g. 12919.
dateQUERYstringNOQuery param — journey date in YYYY-MM-DD. Omit for today. Allowed: yesterday to +7 days (status), yesterday to +90 days (schedule/route).

Code Example

javascript
const res = await fetch(
  "https://railway-engine.apkscope.workers.dev/v1/train/12919/schedule",
  { headers: { "x-api-key": "YOUR_KEY" } },
);

const { status, data, error } = await res.json();
if (status === "SUCCESS") {
  console.log(data.trainName, data.origin.code, "→", data.destination.code);
  console.log(data.departureTime, "→", data.arrivalTime, data.travelTime);
} else {
  console.error(status, error?.code, error?.message);
}

Notes

Errors: 400 INVALID_REQUEST, 404 TRAIN_NOT_FOUND, 429 RATE_LIMITED, 503 PROVIDER_UNAVAILABLE. Schedule responses are timetable data for the requested date and are safe to cache briefly. Field set is trimmed in this example — read the live response for the full list.

Response Example

JSON response
200JSON