Station Lookup by Code

stationByCode(stationCode: string)

Description

Resolve a station code to its name and coordinates.

Parameters

NameInTypeRequiredDescription
stationCodeARGUMENTstringYESStation code such as NDLS or HWH

Code Example

javascript
import { configure, stationByCode } from "railkit";

configure(process.env.RAILKIT_API_KEY);

const result = await stationByCode("NDLS");

if (result.success) {
  console.log(result.data.code, result.data.name);
}

Response Example

JSON response
200JSON
{
  "success": true,
  "data": {
    "code": "NDLS",
    "name": "NEW DELHI",
    "lat": 28.642464,
    "lon": 77.220154
  }
}