Find neighbor station

Hello everyone,

If I want to find some neighbor stations by specific station eg the neighbor stations from Holborn in Central line are “Tottenham Court Road” and “Chancery Lane”, could someone tell me which api I should use. I couldn’t find the related information Stoppoint and Line api.

Thanks in advance.

@Fanco

Use Stop Point location find with a GPS co-ordinate. The docs aren’t qutte right, the syntax is…

$strTFLurl = "https://api.tfl.gov.uk/StopPoint?lat=" . $row->fpNorthing . "&lon=" . $row->fpEasting . "&stopTypes=NaptanPublicBusCoachTram&radius=800&useStopPointHierarchy=True&returnLines=True&" . ApiConfig::TFLAPISUFFIX;

It’s SLOW so you will need to collect and cache the data if you want to use it more than once.

To get the list of stopTypes use https://api.tfl.gov.uk/StopPoint/Meta/stoptypes?app_id=&app_key=

However, it’s not clear (to me, sorry) from the question if what you actually want is the list of stations (in order) on the Central line, which is