Station Search by Name
stationsByName(name: string)Description
Find up to 10 matching stations by partial name.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
name | PATH | string | YES | At least 2 characters; partial matching supported |
Code Example
javascript
const result = await fetch(
"/api/stations/search?name=delhi"
).then((res) => res.json());
result.data.stations.forEach((station) => {
console.log(station.name, station.code);
});Response Example