Complete list of bus stops?

Greetings,

On TfL’s open data webpage (Our open data - Transport for London), one of the examples of data available is a list of bus stops in the region. I’ve been looking through the API documentation, but is there a way to obtain a complete list?

@itsbenchase

Welcome.

Yes, they’re all in https://tfl.gov.uk/tfl/syndication/feeds/journey-planner-timetables.zip in an XML format called transxchange.

As far as I am aware, the stops are spread over the several hundred individual route files within the Journey Planner Datastore zip file.

I found that the information that I already extract from them was actually capable with some tweaking of yielding a complete list of stops. I have uploaded this to

http://timetablegraveyard.co.uk/FullStopInfo.txt

This is a delimited file with five fields:-

  • NAPTAN stop code (typically 49000… for stops within Greater London)
  • Last date seen (see below)
  • Stop name
  • Easting
  • Northing

The “Last Date Seen” field has enabled me to include stops which have been suspended or dropped since November 2021. Some will definitely return when diversions end; others have been replaced or permanently closed. The date is meant to be the date of creation of the JP file and should not be taken as some form of withdrawal date.

Naturally any faults in the stop data in the original files will appear in the file that I have created. I hope that I have not added my own errors! Sometimes only the principal stops on a route are included in the file for the route; unless those stops are in another individual file they could be missing until it is corrected (another good argument for including apparently dropped stops).

Hope the file is of use.

1 Like

Is the file I have produced of any use to anybody? If not, I won’t bother thinking about how to update it efficiently.

Are we sure that the two csv files TfL produce are definitely NOT being updated anymore? @jamesevans

Simon

My impression is that although there are updates they are infrequent and sporadic, thus hard to rely upon. It would be useful to know what the updating timetable actually is.

Once upon a time Gerard’s weekly Journey Planner Newsletter listed all changes to stop data but I think there was an issue which prevented that, an issue which presumably was never resolved. That would have included the other codes for the stop, neither of which are in the Datastore Journey Planner files. Come to think of it, I don’t think I have seen a Newsletter for a few weeks now either.

The page @itsbenchase originally referred to says the files are updated weekly but I know the community here have had doubts about that.

@itsbenchase are you a registered TfL open data user?

Simon

@SJCooper I suspect that the page which states that the files are updated weekly is years out of date.

1 Like

Maybe that page also needs updating weekly :slight_smile:

2 Likes

@jamesevans Can you help before we resort to putting in some FoI requests? :wink:

Thanks!

@itsbenchase @SJCooper I think these are the files which have the data:

https://tfl.gov.uk/bus-stops.csv
https://tfl.gov.uk/bus-sequences.csv

They are generated automatically by an internal service and we try to upload these every week. They are snapshots of the entire bus stops so can sometimes contain errors but otherwise useful as a reference.

@neamanshafiq
Could I suggest that they are also placed in the data bucket so that the date of creation is visible to any user who is wondering whether they need to download again?

1 Like

The bus working timetables also present stop metadata for the minority of stops that are not formal Timing Points but rather surprisingly they do not seem to use the same basic source data as the stops.csv file. Although the stop names for a particular stop code are related, the WTTs show them in mixed rather than upper case and the spacing is sometimes different. The major difference is that special codes like [DLR} or <> which presumably indicate a station or similar are stripped out form the bus WTT info.

I don’t know whether it is any practical importance but the stop metadata in the bus WTTs ae not entirely consistent. For example stop 1078 (Kentish Town Road) is assigned transit node code A8K08 (Kentish Town Station) on all routes except the day 134, for which it is AU672 (Kentish Town Road). On the CSV file the transit node is shown as 8K08 (on the WTTs the codes are all prefixed by an additional A). There aren’t many of these though.

There are rather more cases where the stop is assigned different alpha codes amongst the WTTs (the alpha codes are not in the CSV file). For example, stop 1011 is CLTNKR for all routes except N38, for which it is CLTNPD. I know this ican occur as a result of diversions (change the stop but leave the alpha code alone) but I’m not sure this explains most of them. At Victoria three stops (7806, 33447 and BP5458) are shared between three different alpha codes and three more between two.

As I say, none of this may not affect “fitness for purpose” of the WTTs in the slightest but it is puzzling me a bit why the wheel seems to have been reinvented for the bus stop names.

1 Like

The ‘bus-sequences.csv’ file would appear to be at least two months out of date as it still includes route 332, 507 & 521. The 3 is still shown as going to Whitehall and not Victoria, I’ve not checked but I presume all the other routes affected by the Central London changes are also incorrect.

Simon

I realise this thread is nearly a year old but it seems to be an apt home for my query.

Back in 2016 I was able to download a .csv bus stop database from the Legacy API with a very extensive set of fields:
Route,Bus_Stop_Code,Naptan_Atco,Stop_Name,Location_Easting,Location_Northing,Heading,Latitude,Longitude,Number,Street,Locality,Postal town,Admin level 3,Admin level 2,Admin level 1,Postcode,Country

I am still using parts of that database with some additions from the NaPTAN data as well as various corrections. The Postcode and Postal town fields in particular are extremely useful but the Legacy API is long gone and I have been unable to find any current TfL bus stop downloads with at least those fields.

Is anyone on here aware of a similar current database available to download?

Have a look for a recent post of mine that mentions a Freedom of Information request, the two files are contained in that.

Sorry I’m replying from my phone, I’ll try to post a link later.

Link to FoI request with the requested files >> FOI request detail - Transport for London

Simon

I can’t find your post but did you mean these files:
https://tfl.gov.uk/bus-stops.csv
https://tfl.gov.uk/bus-sequences.csv
I already have them but neither includes Post code data for the stops.

Just saw your edit - the FOI attachments are different files but still w/o Post codes.
Thanks anyway.

@SJCooper
Thanks again for the FOI link. The two listings they provided are a major update on those from the regular URLs and I was able to add my postcode data by pasting the stop map references into an online Batch Postcode Finder.

The person that made the FoI request was hoping that it might prompt the two files you mentioned to be updated but sadly not. Maybe he’ll just re-submit the FoI request on a monthly basis to keep getting updates… :wink: :slight_smile:

Simon

There’s a maintained (by the Department for Transport) list of all UK stops here - https://beta-naptan.dft.gov.uk/Download/National/csv - if you really want an updated CSV list.

Watch out for the last column being “inactive”.

image