Line Networks
The Line Networks service provides information about the connections between stations that belong to the various lines in the TFL network.
Each "line" has both a name and an index (ranging from 0 to 20 inclusive), as listed below:
| Line index | Name |
|---|---|
| 0 | Bakerloo |
| 1 | Central |
| 2 | Circle |
| 3 | District |
| 4 | Hammersmith & City |
| 5 | Jubilee |
| 6 | Metropolitan |
| 7 | Northern |
| 8 | Piccadilly |
| 9 | Victoria |
| 10 | Waterloo & City |
| 11 | Docklands Light Railway |
| 12 | TFL Tram |
| 13 | Elizabeth |
| 14 | Liberty |
| 15 | Lioness |
| 16 | Mildmay |
| 17 | Suffragette |
| 18 | Weaver |
| 19 | Windrush |
| 20 | Walking |
Querying this service will return the connections that belong to the line with the index provided. The main page details a service that allows you to translate between the indexes of the lines and their names.
Note that line 20 (Walking) represents connections between stations that are within walking distance of each other, and as such not all stations on this line are guaranteed to connect to each other in a continuous path(s).
Querying
Query for the connections that belong to a line: https://rse-with-python.arc.ucl.ac.uk/londontube-service/line/query?line_identifier=ID.
Parameters
line_identifier: Either the name or index of a line, as per the table above. Defaults to0(Bakerloo).
String-like values passed to line_identifier are case-insensitive, however we recommend you match the cases given in the table above, just to be safe.
Examples
https://rse-with-python.arc.ucl.ac.uk/londontube-service/line/query?line_identifier=3- fetch the connections that belong to the District line.https://rse-with-python.arc.ucl.ac.uk/londontube-service/line/query?line_identifier=Victoria- fetch the connections that belong to the Victoria line.
Return format
The service will return a .csv file without headers, each row representing a connection between two stations on the line and the travel time between them.
That is, each row has the format
station 1 index, station 2 index, time (mins)
implying that the two stations with the respective indices are directly connected by this line, and it takes time minutes to travel between them using this line.