Live Train Status
GET
GET /v1/train/:number/status?date=YYYY-MM-DDDescription
Live running status for one train on one journey date: running state, current/previous/next station, GPS position with its observed time, speed, delay, ETA, route progress and exceptions. Every response carries honest freshness (LIVE, RECENT or STALE) and a confidence level (HIGH, MEDIUM or LOW) instead of guessed data.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
number | PATH | string | YES | Path param — 5-digit train number, e.g. 12919. |
date | QUERY | string | NO | Query 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/status",
{ headers: { "x-api-key": "YOUR_KEY" } },
);
const { status, data, error, meta } = await res.json();
if (status === "SUCCESS" || status === "STALE_DATA") {
console.log(data.status, data.currentStation, data.freshness.state, data.confidence);
} else {
console.error(status, error?.code, error?.message);
}Notes
Errors: 400 INVALID_REQUEST (bad train number or date), 404 TRAIN_NOT_FOUND, 429 RATE_LIMITED, 503 PROVIDER_UNAVAILABLE. When only an older observation exists the API returns HTTP 200 with status STALE_DATA and the data it actually has — treat STALE_DATA as real but ageing data, not as an error. Example values are illustrative; live values vary.
Response Example