Getting route/branch of vehicle

Hello! I am trying to figure out how to figure out what route a train is operating, from beggining to end for trains accessed from the https://api.tfl.gov.uk/Vehicle/{ids}/Arrivals endpoint.

For example, say we had a Piccadilly line train 123 which is going towards Cockfosters, is there any way to figure out that the train has come from, say Heathrow and not Uxbridge

Another example is a District line train currently at South Ken (or really any station near there) going towards Upminster, is it possible to know the train has come from, say Olympia instead of Ealing Broadway/Wimbledon/Richmond?

Thanks in advance

Welcome @noah

“Another example is a District line train currently at South Ken (or really any station near there) going towards Upminster, is it possible to know the train has come from, say Olympia instead of Ealing Broadway/Wimbledon/Richmond?”

The answer to that question is 99.9% no, the Olympia service is “weekends and public holidays”.

I think the only way to know where a train is from is to use a cron job to keep your own log of the Vehicle ID and refer to that.

The District line though Earl’s court is actually three overlaid services:

  • Wimbleware (Wimbledon to Edgeware Road)
  • Baron’s Court lines the Upminster
  • Olympia to Ken High St (sometimes).

but there are other rare possibilities so https://api.tfl.gov.uk/Line/district/Route lists more.

The Piccadilly line has a datapoint for the possible routes:

https://api.tfl.gov.uk/Line/piccadilly/Route

“I think the only way to know where a train is from is to use a cron job to keep your own log of the Vehicle ID and refer to that.”

So there is no way of perhaps referencing the WTT or anything like that to know where a train originates from without doing this?

Also, another issue I’ve seemed to find is that some Metropolitan line trains say they are calling at Neasden, when, of course, they’re not, why is this?

@noah
Even if is possible, I doubt it would help much as the WTT is the ideal service, not what actually operates. A train that is supposed to run to Heathrow may be rerouted onto the Uxbridge branch if the service needs it, so presumably a train can originate from the wrong place too.

Out of interest, what are you trying to do with the train origin? It might be useful to know whether a train has come with loads of luggage from Heathrow or from somewhere else but I’m struggling as to anything else.

1 Like