Timetables / RailMiles Mileage Engine API

Details

Access to the Timetables API is free for all non-commercial use and allows you to query any of the data that you would typically find on the website. Commercial use is considered on a case by case basis (or you could try yourself for nothing - ATOC timetable data and CIFReader should get you started). You should credit Network Rail for the timetable data in use, and preferably also credit Tom Cairns for the API.

Use of the RailMiles Mileage Engine in searches requires the use of API keys which can be requested from Tom Cairns by email. RMME use is free for low volume non-commercial purposes but is chargeable for commercial use on a currently negotiable basis. Documentation is available on request.

Documentation

You should query the lead directory each time for the appropriate file, with a GET request. Results are always returned in JSON format. While I prefer it that you cache your results under most circumstances (RMME use has different rules), I don't mind if you don't. If you do, I've given some pointers as to how often you should refresh the data to ensure you have up to date results.

To make the JSON sample output a bit easier to read, you can use something like JSONLint.