Platform Numbers

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

Description

Platform allocation for a train at every station the source has reports for: the platform label, the source's own confidence tag (a share such as "88%" or the word "most") and the feedback count behind it, exactly as upstream reported them. Stations without a usable report are omitted rather than guessed, and trainName stays null when the source names no train.

Parameters

NameInTypeRequiredDescription
numberPATHstringYESPath param — 5-digit train number, e.g. 12951.
dateQUERYstringNOQuery param — journey date in YYYY-MM-DD. Omit for today. Allowed: yesterday to +7 days.

Code Example

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

const { status, data, error } = await res.json();
if (status === "SUCCESS") {
  for (const stop of data.stations) {
    const best = stop.assignments[0];
    console.log(stop.station.code, "-> platform", best?.platform, best?.confidence ?? "");
  }
} else {
  console.error(status, error?.code, error?.message);
}

Notes

Platforms come from rider feedback on WhereIsMyTrain, so every assignment carries the source's own confidence tag — treat it as a hint, not a guarantee, and check the station displays on arrival. meta deliberately carries no freshness: allocation is decided per run, not per second, so the payload is cached for up to 10 minutes instead (observedAt is the source's snapshot time). Only stations with at least one usable report appear; an empty stations array means the source has no record of the run. Errors: 400 INVALID_REQUEST (bad number or date outside the window), 404 TRAIN_NOT_FOUND, 429 RATE_LIMITED, 503 PROVIDER_UNAVAILABLE.

Response Example

JSON response
200JSON