Camille Baldock

Scraping the TFL Oyster journey history

May 11, 2014 | 0 Minute Read

I wrote a Ruby script (with a sprinkle of Poltergeist/PhantomJS) to scrape my Transport for London Oyster journey history.

I was hoping that TFL would provide an API to get my rencet journeys but they don’t… My second hope was that journey history was available without javascript: the Oyster website doesn’t work once you disable javascript.

So after a few minutes of despair…

No API

I wrote a scraping script to get my journey history from the TFL oyster website.

It is available as a gist here.

I hope it can be of some use to someone else who, like me, does not want to export their data manually by logging in to the site every week and downloading CSV files.