TfL live tube data

TfL API

<https://api.tfl.gov.uk/Line/{line_id}/Arrivals>
<https://api.tfl.gov.uk/Vehicle/{vehicle_id}/Arrivals>

<aside> đź”®

You will regret using this data. You will regret using this API.

It serves data from individual arrivals boards, which all spell stations differently.

It describes train status in free text that varies between stations. “Approaching Barnet”, “Near Waterloo”, “Heading to Bank”, “Departing Southgate”, “Leaving Hampstead”, etc.

It has a load-balancer that regularly returns data that is older than the data returned in the previous request.

</aside>

image.png

Tube station locations

TfL API

<https://api.tfl.gov.uk/Line/{line_id}/Route/Sequence/all>

Station depths

TfL freedom of information

https://tfl.gov.uk/corporate/transparency/freedom-of-information/foi-request-detail?referenceId=FOI-0493-2223

Tube paths

Open Street Maps via Oliver O'Brien

https://github.com/oobrien/vis/blob/master/tubecreature/data/tfl_lines.json?short_path=1627147