About

On a recent trip to Nottingham my mind was racing. As usual. I was thinking about how under-utilised my tube data set was. It'd been used in the tube walk page, which describes the duration of every tube journey if taken on foot. But it only got a few retweets, a couple of favourites, and not much else.

So I created an API to expose the data to the rest of the world, in the hope I'll get more!

The URL stub is:

http://marquisdegeek.com/api/tube/


Parameters

These are filters, and are combined using the 'AND' operation. i.e. all filters must conform.

nameFilter by name
zoneFilter by zone
long/longitudeFilter by longitude, within a given distance
lat/latitudeFilter by latitude, within a given distance
distanceThe distance to used when filtering by long/lat, in meters
These are extras:
sortbySorting parameter. Can be name, zone, longitude, latitude or distance (only if filtering by long/lat)
sortorderIf provided, must be 'asc' or 'desc', and orders the parameters in 'sortby'


Examples

Find the most easterly stations:

	http://marquisdegeek.com/api/tube/?sortby=longitude&sortorder=desc

Or north-most stations in zone 1:

	http://marquisdegeek.com/api/tube/?sortby=latitude&sortorder=desc&zone=1

Or the closest to the meridan, sorted by distance

	http://marquisdegeek.com/api/tube/?long=0&lat=51.50&distance=1000&sortby=distance

Or the closest to the meridian, ignoring the latitude:

	http://marquisdegeek.com/api/tube/?long=0&distance=1000&sortby=distance