Any Bus Towards from CSV

Hi,
I am very new to here, I want to ask is that, did TfL provide any bus towards (for example, 125 it should be to Winchmore Hill, not Station Road, the destination name of the route. Do anyone know any csv document that provided the bus towards.

Thanks

1 Like

Hello, welcome to the forum!

Towards information is available from the Unified API. For Route 125, for example, you can make a request to:
https://api.tfl.gov.uk/Line/125/Route/Sequence/all

The OP may find it easier to work with the response from the legacy API. For example:
https://countdown.api.tfl.gov.uk/interfaces/ura/instant_V1?StopAlso=1&ReturnList=StopPointName,Towards&LineName=125
There are many other useful parameters which are listed in the documentation
PS
With thanks to @LeonByford who told me about this some time ago. :slightly_smiling_face:

Good point, although please note that this will give you the Towards information for bus stops, which can be different to the Towards information for bus routes which you’ll get from the Unified API’s route sequence data.

Just to complicate things further, this can also differ from the Destination information of an individual service.

@LeonByford Could you explain please which part of the Unified API response you are looking at for bus route Towards information. The main part of the response comprises individual blocks for every stop served by the 125. Each block starts with an entry such as:

            "$type": "Tfl.Api.Presentation.Entities.MatchedStop, Tfl.Api.Presentation.Entities",
            "icsId": "1000054",
            "topMostParentId": "490000054CA",
            "towards": "Kingsbury Or Colindale Asda",
            "modes": [

which seems to be the same bus stop Towards information as returned by Countdown.

2 Likes

Hi, I do apologise. You’re totally correct. I was trying to work out how we show “Towards Winchmore Hill” at the top of the route web page and thought it came from the Route Sequence response, but I realise now that is not the case!

I consulted the web site’s source code, and we actually make a request to:
https://api.tfl.gov.uk/Line/Search/125?modes=bus
You’ll see “Winchmore Hill” in the vehicleDestinationText property of the inbound LineRouteSection.

1 Like

Thanks for all the replies, it works absolutely fine, but I just want to ask one thing, is there anyway to query the bus route directly? Example, when I enter “2” after the search, it will pop up all the bus route including 2 in the bus route instead just finding route no.2.

Hi, unfortunately I’m not aware of a way to do that. But we’ll certainly take that as a feature suggestion!

Thank you for your reply, one more thing, how can I see Run column from bus-sequences.csv in the website?

The information published on our website is based on the TransXChange data (which we also publish as open data), rather than the bus-sequences.csv file. Therefore that information isn’t available on the website, sorry!