Underground App

Hi everyone, i am currently writing a Windows app in my spare time to display the trains travelling on the underground… this app will be free.
I initially had a picture in my head of just flashing dots for each train as it moves up and down the line… but it will be more than that, for example, users will be able to switch on/off each line and do various other customizations.

Its in its early stages at the moment but the footings are in place… i will upload a couple of screen shots that show each line and with trains just on the Bakerloo line for now…

What i am after to help me with development is a list of the location strings that are visited for each direction on a line… for example with the Bakerloo line we have this string “North of Piccadilly Circus”, however, is that for a train travelling North or South?
Surely someone must have all the correct locations for each direction?

Any help is appreciated.


1 Like

Welcome @HighTrainsDrifter

This problems is somewhat intractable!

For example trains going one stop from Kings Cross to Euston are southbound and the Victoria Line and Northern bound and the Northern Line (City) branch

The currently conventions are listed in the working timetables…

There are plenty of times where the direction from “here” to the Line end is because the lines have switched oved convention might just be “zone 1 to the end of the line”

The circle line, when it was a circle used “inner rail” for clockwise and “outerrail” for anticlockwise.

Thanks Brian, but the timetables are pretty useless to me unless of course i want to catch a train.

What i am after are the order of a train as moves in a direction as output here for the Bakerloo line:


So for example for a train travelling North we may see: “Between Willesden Junction and Harlesden” in the data…

So what would come after that, then after that until the train completes its journey North?

There must be an exact list of locations that is followed for each direction, otherwise what is the point in it being output in the first place?


I think that you will find that /Line/Route/Sequence provides the data you need

Hi Neil; welcome to the forum!

Firstly, I would like to ask why you want to have a list of locations? What would you do with such a list? What problem are you trying to solve?

The Location attribute is only there to provide a piece of text about the current location of a train, but it’s not intended to be parsed or used in any way other than simply displaying that snippet of text.

I’m unable to provide a list of locations, and even if I could, I’m not sure it would be useful to you. But there may be a different way to solve the same problem, so if you can let us know more about the problem, we could try to provide suggestions.

For example, if you want data about the position of each train so that you can plot them on your diagrams, there are better ways to do that than using the Location field.

Thanks, i will have a look :+1:

Hi Leon, yes i am using that info to update the train position on my diagrams.


Okay, so trying to decipher what this actually means… /Line/Route/Sequence

I am presuming that Line is B for Bakerloo etc…

Route? where does that come from… Destination code? Northbound?
Sequence? where does that come from?


See here for details of the /Line/Route/Sequence call to the Unified Api

Thanks but nothing that is output there relates to what i am looking for.
I am looking for the route strings as given by the output of:


For example we may see in there:

L=“Left Marylebone”

Where i presume the L= means Location

So i am after the full list of locations that would be used.

Latitude and Longitude and other codes are no good to me since i am just plotting locations onto a simple 2D drawing.


Unfortunately only using the location string is unlikely to yield any accurate results, even if you do get your hands on the full list of possible strings, because as you have identified, some strings can be used for track sections in either direction.

Another example of strings you’ll see often is something like “Approaching Oxford Circus” or “Departing Oxford Circus”, without any platform or direction information. Because of this, you can’t really judge the direction of a train based off of a single observation of a track section description.

Your options here are:

  • Use the Unified API (api.tfl.gov.uk/Line/bakerloo/Arrivals) instead of the TrackerNet APIs, as this will provide you with a direction value along with the currentLocation string for every predicted train.

  • When using the TrackerNet API, consider which platform the train is being returned under to figure out the current direction. Note that this may cause some weird behaviour at terminal/common turnaround stations or where the signalling system doesn’t know which platform a train will go into yet, so will duplicate it across multiple platforms.

  • Track the same train across multiple track sections, until you see it go into a track section that does disclose the direction (e.g. “Between Oxford Circus and Green Park” vs “Between Green Park and Oxford Circus” reveals that a train is going southbound vs northbound respectively). You can then presume that the direction remains the same until you see it in a track section going the opposite direction. Unfortunately there doesn’t seem to be a full list in the public domain anywhere, so you’ll need to poll the API every so often to get a wider sample of all the possible locations you may encounter.

  • The most accurate but most time-consuming method would be to rely on the much more specific track section codes (e.g. TV6523 is one of the codes for the southbound Victoria line platform at Oxford Circus). Note that you’ll need to use the PredictionDetailed feed of TrackerNet, not the PredictionSummary, as the codes aren’t included in the summary. For more detail on how to work with these you can watch a talk from EMF2022 about this at https://www.youtube.com/watch?v=osAfQLD59Kc

1 Like

Yep, thanks for your reply.

I dont want to use the Unified API if i can help it because it does not (i believe?) include all underground stations etc. Although i did try it and found it easier to use than the Trackernet data.
However i have now gone down the route of parsing the XML file myself rather than using any extra packages, i am not even using JSON yet although that may change later on.

And yes, i did discover that the strings ‘approaching station’ and ‘left station’ kind of left me in no mans land as far as knowing which side of the actual station they were referring to!

And i did notice the codes (such as TV6523) in the PredictionDetailed output, however i have not got a clue as to what the actual location for each code number is? Is there any info out there?

and thanks again for your help

Quite the opposite - it is TrackerNet which currently does not have a detailed prediction for all stations (Battersea Power Station and Nine Elms, specifically) - the Unified API covers all TfL stations and more, as the name suggests.

The limitation of the Unified API comes in the detail of the data, rather than the coverage or scope - for example it does not provide you with track section codes.

There is no comprehensive list or graph of all the track sections in the public domain, and the diagrams that show an overview of them are internal only. TfL has previously rejected FOI requests for the TrackerNet diagrams, so the only way to build out a list/graph of your own is to do what eta did in her talk, as linked above.

Almost right :slight_smile:

It helps to remember that in the UK trains and cars drive on the left. The outer rail will be on the left when going clockwise.

of course. unlike Italy where it’s the other way around…

I thought it was the shaded side…

Of course…


Except when it isn’t.