1

Is there an API for rail company/ies, preferably for all UK locations?

Lat/long, train Id at a minimum but data such as train name, speed, from/to station, ETA, number of coaches/passengers, train type (freight/mail/passenger), etc will be useful too.

3

The UK is relatively good when it comes to open transport data. You might want to have a look at the APIs produced by Real Time Trains (although some of these are chargeable) or the Network Rail data feeds that cover both trains and infrastructure (e.g. temporary speed restrictions on particular pieces of track).

There is also lots of useful information on the openraildata.com wiki including a list of projects using open train data.

One thing that might be difficult is precise lat/lon data, since the rail network is set up to track trains between pairs of signals, so it may be that the available data only includes the location at what is referred to as 'signal berth' level. It should be possible to map trains to a point relating to each signal berth, but possibly not within each berth.

Good luck!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.