How can one retrieve list of unique staions data for tube,dlr ,tram and overground?

If I point to https://api.tfl.gov.uk/Stoppoint/mode/tube the api returns 1683 objects. Which includes duplicated entry in the form of entrance 1, entrance 2 etc.

For example, point to that endpoint above and search for “stationNaptan”: “940GZZLUAMS” youll get 14 results including children element. My aim is to create a List with unique stations name for tube, dlr, tram and overground. Cant figure out how or if it can be done using the api?

hi @syed-hoque,

it may be worth filtering the response from the API using the StopPoint types (perhaps NaptanMetroStation or NaptanRailStation)

regards,

James Evans
Technology Service Operations

Is there an API which returns a list of all the Overground station coordinates, like it does for the tube stations?
Thank you.

@Kupod5uR

Start with this to get the list of id values

https://api.tfl.gov.uk/line/mode/tube,overground,dlr,tflrail,tram/status

and plug in into line…arrivals

https://api.tfl.gov.uk/line/london-overground/arrivals

and then loop though the naptanId to get the lat and lon

https://api.tfl.gov.uk/stoppoint/910GLYTNSHR

image

1 Like

I’ve already looked at those URLs. Yes, I know I can extract lat and lon values manually. Several Tube URLs have a “coordinates” array where they include all the coordinates for a given line. Do any Overground URLs have this? Thank you.

Have a look at /Line/london-overground/Route/Sequence/{direction], where direction is outbound or inbound. This has both the linestrings array and the individual stop coordinates

1 Like

Try Naptan >>> NaPTAN and NPTG - NaPTAN - DfT

Simon

1 Like