Transport
Copy link

Two halves. Transit: stations, stops and lines, by rail, Underground, Overground, bus, coach, ferry and cable car. Roads: major roads and where you get on or off them.

Questions this page answers

  • Which stations are within walking distance?
  • Which lines connect these two stations?
  • Where's the nearest motorway entry?

Stations and lines come from TravelTime's public transport data (traveltime_pt); major roads and their entries and exits from Overture Maps (overture). /v1/catalog/{country} lists the country's transit modes and operators and carries each dataset's updated_at, the date it was last loaded.

Request headers
Copy link

Required authentication header. The same application id as the TravelTime API.

string

Required authentication header.

Stations and stops
Copy link

GET /v1/transport/transit/stations

Stations and stops in the location you give, without the stops grouped under a station: best match first with q, otherwise nearest first with near, in the order sent with cells, otherwise by id. POST /v1/transport/transit/stations takes the same fields as JSON, for long cell lists (Long requests).

Every stop and station within 800 m of King's Cross station, nearest first: 41 of them, each with how far away it is.

Request

curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
  "https://data.traveltimeapp.com/v1/transport/transit/stations?near=51.5309,-0.1229&radius_m=800"
200 · 41 stations, one page

41 pins inside the 800 m circle; a pin opens its row.Drawn from the response on this page; the playground runs it live.

Every station inside a map viewport: 81.

Stations inside seven hexagons around Euston Square: 15, in the order the hexagons were sent.

Find a station by name to get its id: 16 matches across the country, best first.

Only Underground stations within 1.5 km: 9 of them.

Parameters
Copy link

ParameterTypeDefaultWhat it doesExample
qtext—Search by name, best match first. Needs a location, or country for the whole country. One page: raise limit for more.q=kings+cross
modetransit mode—Only stations this mode serves, at their own stop or on a line calling there: bus, cable_car, coach, ferry, overground, rail or underground.mode=underground

Also takes Where: near, radius_m, bbox, cells, at; country with q · Paging: limit, cursor · Long requests: the POST body.

Each row: id (st_gb_…), name, modes (a list: the station's own mode and its lines' modes), lat and lng (degrees), cell (its resolution-9 hexagon), line_count (lines calling there) and trips_per_hour: departures an hour at am_peak, interpeak, pm_peak, evening and weekend, null in a period with none; distance_m (metres) with near.

Errors

CodeHTTPWhen
location_required400No near, bbox, cells or at; q with neither a location nor country.
country_not_allowed400country without q.
invalid_mode400Not a transit mode; allowed lists them.

… and every Where and Paging code.

One station
Copy link

GET /v1/transport/transit/stations/{id}

One station with every line that calls there and the stations next to it.

London Kings Cross: the 48 lines that call there, and the five stations nearest it.

Each row: the list row plus lines, every line calling there as {id, name, operator, mode}, rail first, then underground, overground, ferry, coach, bus and cable car; and nearby, up to 5 stations within 500 m as {id, name}.

Errors

CodeHTTPWhen
invalid_id400Not a station id (st_gb_…).
not_found404No station with this id.

Stations per hexagon
Copy link

GET /v1/transport/transit/stations/cells

How many stations are in each hexagon, with a count per mode, or one total over what you send with group_by=all. Only stations count, not the stops grouped under them: the stations the list returns. POST /v1/transport/transit/stations/cells takes the same fields as JSON, for long cell lists.

How many stations are in each of the 39 hexagons in the box, 0 where there are none.

Stations per hexagon for hexagons you choose, in the order sent. Add group_by=all for one row: 15 stations over the seven, 12 bus, 2 rail and 1 Underground, the 15 rows the list returns.

Also takes Where: near, radius_m, bbox, cells, at · Per-hexagon routes: group_by (cell or all), resolution (6 to 10) · Paging: limit, cursor · Output: format · Long requests: the POST body.

Each row: cell, count (stations) and mode_counts (stations per mode, most first); with group_by=all, one row of cell_count, count and mode_counts.

Rollup: sum.

Errors

CodeHTTPWhen
invalid_resolution400Transit has resolutions 6 to 10; allowed lists them.
invalid_group_by400Not cell or all: transit has no totals per boundary.
invalid_format400geojson with group_by=all.

… and every Where and Paging code.

Bus routes, Underground lines, rail services
Copy link

GET /v1/transport/transit/lines

The lines with a stop inside the location you give, the lines that stop at every station in serves, or one operator's lines: best match first with q, otherwise by id. POST /v1/transport/transit/lines takes the same fields as JSON, for long cell lists.

Every line that stops somewhere inside the box: 215, so 100 on this page.

Every line that stops in hexagons you choose: 114 lines, 91 of them rail, 19 bus, 2 Overground and 2 Underground.

Which lines connect King's Cross St. Pancras and Euston? Northern and Victoria. The station ids come from Stations by mode; include=stops adds each line's stops.

Every line one operator runs: the 11 London Underground lines.

Parameters
Copy link

ParameterTypeDefaultWhat it doesExample
servesstation ids—Lines that stop at every station listed, comma-separated. A where of its own: no location with it.serves=st_gb_7d4f15682232,st_gb_63a8aa9929e4
operatoroperator id—Lines run by this operator, from /v1/catalog/{country}. A where of its own: no location with it.operator=london_underground_tfl
modetransit mode—Only lines of this mode.mode=bus
qtext—Search by name or number, best match first. Needs a location or country. One page: raise limit for more.q=victoria
includestops—Adds each line's stops, as on one line; up to 100 rows a page.include=stops

Also takes Where: near, radius_m, bbox, cells, at; country with q · Paging: limit, cursor · Long requests: the POST body.

Each row: id (ln_gb_…), name, operator as {id, name}, mode, stop_count (stops) and trips_per_hour (as on stations); stops with include=stops, as on one line.

Errors

CodeHTTPWhen
location_required400No location, serves or operator; q with neither a location nor country.
too_many_locations400Two of a location, serves and operator.
country_not_allowed400country without q.
invalid_serves400Not station ids, or stations from two countries.
invalid_mode400Not a transit mode; allowed lists them.
invalid_include400include other than stops.

… and every Where and Paging code.

One line
Copy link

GET /v1/transport/transit/lines/{id}

One line with its stops, each with its station's lat and lng.

The Victoria line: 16 stops, Brixton first.

Each row: the list row plus stops, each with its station as {id, name}, sequence, lat and lng: the main run in sequence order, then stops off it (a branch) by name with sequence null.

Errors

CodeHTTPWhen
invalid_id400Not a line id (ln_gb_…).
not_found404No line with this id.

Lines per hexagon
Copy link

GET /v1/transport/transit/lines/cells

How many lines stop in each hexagon, with a count per mode, or one total over what you send with group_by=all. POST /v1/transport/transit/lines/cells takes the same fields as JSON, for long cell lists.

How many lines stop in each hexagon in the box. Over the seven hexagons of Stations for a list of cells, group_by=all counts 114 lines.

Also takes Where: near, radius_m, bbox, cells, at · Per-hexagon routes: group_by (cell or all), resolution (6 to 10) · Paging: limit, cursor · Output: format · Long requests: the POST body.

Each row: cell, count (lines stopping there) and mode_counts (lines per mode); with group_by=all, one row of cell_count, count and mode_counts.

Rollup: distinct for count and mode_counts, so a line through ten hexagons counts once; sum for cell_count.

Errors: those of /v1/transport/transit/stations/cells.

Major roads
Copy link

GET /v1/transport/roads

Major roads with an entry or exit in the location you give, one row per road and direction: nearest first with near, otherwise by id.

Within 10 km of King's Cross: the M1, one row per direction.

Also takes Where: near, radius_m, bbox · Paging: limit, cursor.

Each row: id (rd_gb_…), name (often null), ref (M1), direction (northbound, southbound, eastbound, westbound, or null) and access_counts: its entries and exits inside the location, as {entry, exit}.

Errors

CodeHTTPWhen
location_required400No near or bbox; roads take neither cells nor at.
not_available_in_country404The location is in a country with no road data.
too_many_results400Over 10,000 entries and exits in the location; ask for a smaller one.

… and every Where and Paging code.

One road
Copy link

GET /v1/transport/roads/{id}

One major road in one direction, its entries and exits counted along all of it. GET /v1/transport/roads/access?road=<id> lists them.

The M1 northbound: 49 entries and 49 exits.

Each row: the list row, with access_counts over the whole road.

Errors

CodeHTTPWhen
invalid_id400Not a road id (rd_gb_…).
not_found404No road with this id.

Where you get on or off a major road
Copy link

GET /v1/transport/roads/access

Where you get on or off a major road: junctions, ramps, slip roads. In the location you give, or along one road with road: nearest first with near, otherwise by id.

The nearest motorway entries to King's Cross: two slip roads onto the M1 northbound at Staples Corner, 8.7 km away.

Parameters
Copy link

ParameterTypeDefaultWhat it doesExample
typeentry | exitbothOnly entries (on-ramps, slip roads on) or only exits.type=entry
roadroad id—Only this road's entries and exits. A where of its own: no location with it.road=rd_gb_5dd25d5e19ad

Also takes Where: near, radius_m, bbox · Paging: limit, cursor.

Each row: id (ra_gb_on-… for an entry, ra_gb_off-… for an exit), type (entry or exit), road as {id, name, ref} (the road it joins; with road, that one), name (the local road it joins, often null), lat and lng (degrees), cell (its resolution-9 hexagon); distance_m (metres) with near.

Errors

CodeHTTPWhen
location_required400None of near, bbox or road.
too_many_locations400road with near or bbox.
invalid_type400Not entry or exit.
invalid_id400road is not a road id.
not_available_in_country404The location is in a country with no road data.
too_many_results400Over 10,000 entries and exits in the location.

… and every Where and Paging code.

One entry or exit
Copy link

GET /v1/transport/roads/access/{id}

One entry or exit.

The M1 northbound entry at Staples Corner.

Each row: the list row, without distance_m.

Errors

CodeHTTPWhen
invalid_id400Not an entry or exit id (ra_gb_on-…, ra_gb_off-…).
not_found404No entry or exit with this id.

Request

curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
  "https://data.traveltimeapp.com/v1/transport/transit/stations?near=51.5309,-0.1229&radius_m=800"
200 · 41 stations, one page

41 pins inside the 800 m circle; a pin opens its row.Drawn from the response on this page; the playground runs it live.