Station by Code

GETGET /v1/station/:code

Description

Resolve a station code such as NDLS to its full record: canonical name, known aliases, coordinates, state, zone and division.

Parameters

NameInTypeRequiredDescription
codePATHstringYESPath param — station code, e.g. NDLS, HWH, BCT.

Code Example

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

const { status, data, error } = await res.json();
if (status === "SUCCESS") {
  console.log(data.code, data.name, data.zone, data.division);
  console.log(data.latitude, data.longitude, "aliases:", data.aliases);
} else {
  console.error(status, error?.code, error?.message);
}

Notes

Errors: 400 INVALID_REQUEST (malformed code), 404 NOT_FOUND for unknown codes, 429 RATE_LIMITED. Station records change rarely, so responses are cached and safe to store.

Response Example

JSON response
200JSON