This page covers two kinds of transport data:
- Transit: public transport stations, stops and lines, for modes such as rail, bus, coach and ferry
- Roads: major roads and where you get on or off them
This page answers questions such as:
- Which stations are within walking distance?
- Which lines connect these two stations?
- Where's the nearest motorway entry?
Stations and lines come from our public transport data (traveltime_pt). Major roads and their entries and exits come from Overture Maps (overture). /v1/catalog/{country} lists the transit modes and operators in a country, and gives the updated_at of each dataset, which is the date it was last loaded.
Required authentication header. Use the same application id as for the TravelTime API.
Required authentication header.
GET /v1/transport/transit/stationsGet the stations and stops in a location. Stops that are grouped under a station are left out. With q, results are sorted by best match. Otherwise they are sorted nearest first with near, in the order sent with cells, or by id.
For long cell lists, POST /v1/transport/transit/stations takes the same fields as a JSON body (see Long requests).
| Parameter | Type | Default | What it does | Example |
|---|---|---|---|---|
q | text | — | Search by name, with the best match first. Requires a location, or country to search the whole country. Has no next page, so raise limit to get more results. | q=kings+cross |
mode | transit mode | — | Only return stations that this mode serves, either at the station's own stop or on a line that calls there. One of bus, cable_car, coach, ferry, overground, rail or underground. | mode=underground |
The endpoint also takes the following common parameters:
- Location:
near,radius_m,bbox,cellsandat, orcountrywithq - Paging:
limitandcursor - Long requests: the same fields as a POST body
Each result has these fields:
id(st_gb_…)namemodes: a list of the station's own mode and the modes of its lineslatandlng, in degreescell: its resolution-9 H3 cellline_count: the number of lines that call theretrips_per_hour: departures per hour in each ofam_peak,interpeak,pm_peak,eveningandweekend, or null for a period with nonetrips_per_week: the number of trips a week that call theredistance_m: the distance in metres, only withnear
Errors
| Code | HTTP | When |
|---|---|---|
location_required | 400 | The request has no near, bbox, cells or at, or it has q with neither a location nor country. |
country_not_allowed | 400 | country is sent without q. |
invalid_mode | 400 | mode is not a transit mode. allowed lists them. |
All the location and paging error codes also apply.
All 41 stops and stations within 800 m of King's Cross station, nearest first, each with its distance.
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"41 pins inside the 800 m circle; a pin opens its row.
| Namename | Distancedistance_m | Modesmodes | H3 cellcell | Map |
|---|---|---|---|---|
| London Kings Cross | 3 m | rail | 89195da4d8fffff | |
| King's Cross St. Pancras | 32 m | underground | 89195da4dbbffff | |
| King's Cross Stn / York Way | 45 m | bus | 89195da4d8fffff | |
| King's Cross St. Pancras Underground Station | 57 m | bus | 89195da4d8fffff | |
| King's Cross St. Pancras Underground Station | 97 m | bus | 89195da4dbbffff |
5 of 41 shown · the other 36 are in the response
Response
{
"results": [
{
"id": "st_gb_218003af11f9",
"name": "London Kings Cross",
"modes": [
"rail"
],
"lat": 51.53088,
"lng": -0.12293,
"cell": "89195da4d8fffff",
"line_count": 48,
"trips_per_hour": {
"am_peak": 11.2,
"interpeak": 10.32,
"pm_peak": 10.63,
"evening": 5,
"weekend": 7.87
},
"distance_m": 3
},
"… 40 more rows"
],
"next_cursor": null
}All 81 stations inside a map viewport.
Request
curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
"https://data.traveltimeapp.com/v1/transport/transit/stations?bbox=51.522,-0.140,51.538,-0.110"81 pins; a pin opens its row.
| Namename | Modesmodes | H3 cellcell | Line countline_count | Map |
|---|---|---|---|---|
| Oakley Square | bus | 89195da4dc3ffff | 1 | |
| Kings Cross / Caledonian Road | bus | 89195da4d87ffff | 7 | |
| London Euston | overground, rail | 89195da4d0bffff | 33 | |
| Upper Woburn Place/Euston Road | bus | 89195da4d03ffff | 4 | |
| Carnegie Street | bus | 89195da6b2fffff | 3 |
5 of 81 shown · the other 76 are in the response
Response
{
"results": [
{
"id": "st_gb_06247e5667b7",
"name": "Oakley Square",
"modes": [
"bus"
],
"lat": 51.536,
"lng": -0.13589,
"cell": "89195da4dc3ffff",
"line_count": 1,
"trips_per_hour": {
"am_peak": 5.2,
"interpeak": 4.62,
"pm_peak": 4.67,
"evening": 3.75,
"weekend": 1.62
}
},
"… 80 more rows"
],
"next_cursor": null
}The 15 stations inside seven H3 cells around Euston Square, in the order the cells were sent.
Request
curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
"https://data.traveltimeapp.com/v1/transport/transit/stations?cells=89195da4d03ffff,89195da4d07ffff,89195da4d0bffff,89195da4d0fffff,89195da4d13ffff,89195da4d17ffff,89195da4d1bffff"Shade = stations in the H3 cell15An H3 cell opens its count; a pin opens its row.
| Namename | Modesmodes | H3 cellcell | Line countline_count | Map |
|---|---|---|---|---|
| Upper Woburn Place/Euston Road | bus | 89195da4d03ffff | 4 | |
| Euston Bus Station | bus | 89195da4d03ffff | 2 | |
| Euston | underground | 89195da4d03ffff | 2 | |
| Euston Station | bus | 89195da4d03ffff | 5 | |
| Euston Station / Eversholt Street | bus | 89195da4d03ffff | 4 |
5 of 15 shown · the other 10 are in the response
Response
{
"results": [
{
"id": "st_gb_0b9479ff3bdc",
"name": "Upper Woburn Place/Euston Road",
"modes": [
"bus"
],
"lat": 51.52716,
"lng": -0.13078,
"cell": "89195da4d03ffff",
"line_count": 4,
"trips_per_hour": {
"am_peak": 20,
"interpeak": 17.99,
"pm_peak": 18.67,
"evening": 16.5,
"weekend": 6.88
}
},
"… 14 more rows"
],
"next_cursor": null
}Search for a station by name to get its id. This returns 16 matches across the country, with the best match first.
Request
curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
"https://data.traveltimeapp.com/v1/transport/transit/stations?q=kings+cross&country=gb"16 pins; a pin opens its row.
| Namename | Modesmodes | H3 cellcell | Line countline_count | Map |
|---|---|---|---|---|
| London Kings Cross | rail | 89195da4d8fffff | 48 | |
| Kings Cross / Caledonian Road | bus | 89195da4d87ffff | 7 | |
| Kings Cross Road | bus | 89195da4d87ffff | 7 | |
| Kings Cross Lane | bus | 89194ace19bffff | 2 | |
| Kings Cross Lane | bus | 89194ace567ffff | 2 |
5 of 16 shown · the other 11 are in the response
Response
{
"results": [
{
"id": "st_gb_218003af11f9",
"name": "London Kings Cross",
"modes": [
"rail"
],
"lat": 51.53088,
"lng": -0.12293,
"cell": "89195da4d8fffff",
"line_count": 48,
"trips_per_hour": {
"am_peak": 11.2,
"interpeak": 10.32,
"pm_peak": 10.63,
"evening": 5,
"weekend": 7.87
}
},
"… 15 more rows"
],
"next_cursor": null
}Filter by mode to get only the Underground stations within 1.5 km, of which there are 9.
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.5307,-0.1238&radius_m=1500&mode=underground"9 pins inside the 1,500 m circle; a pin opens its row.
| Namename | Distancedistance_m | Modesmodes | H3 cellcell | Map |
|---|---|---|---|---|
| King's Cross St. Pancras | 71 m | underground | 89195da4dbbffff | |
| Euston | 686 m | underground | 89195da4d03ffff | |
| Russell Square | 810 m | underground | 89195da4d33ffff | |
| Euston Square | 978 m | underground | 89195da4d73ffff | |
| Mornington Crescent | 1.1 km | underground | 89195da4dcfffff |
5 of 9 shown · the other 4 are in the response
Response
{
"results": [
{
"id": "st_gb_7d4f15682232",
"name": "King's Cross St. Pancras",
"modes": [
"underground"
],
"lat": 51.53062,
"lng": -0.12279,
"cell": "89195da4dbbffff",
"line_count": 6,
"trips_per_hour": {
"am_peak": 76.8,
"interpeak": 63.7,
"pm_peak": 68.68,
"evening": 58.5,
"weekend": 27.45
},
"distance_m": 71
},
"… 8 more rows"
],
"next_cursor": null
}GET /v1/transport/transit/stations/{id}Get one station or stop, with every line that calls there, the stations near it and, for a stop, the station it is grouped under.
The response has the same fields as a list result, plus:
lines: every line that calls there, as{id, name, operator, mode}, with rail first, then underground, overground, ferry, coach, bus and cable carnearby: up to 5 stations within 500 m, as{id, name, modes, lat, lng, distance_m}parent: for a stop, the id of the station it is grouped under, or null
Errors
| Code | HTTP | When |
|---|---|---|
invalid_id | 400 | The id is not a station id (st_gb_…). |
not_found | 404 | There is no station with this id. |
London Kings Cross, with the 48 lines that call there and the five stations nearest to it.
Request
curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
"https://data.traveltimeapp.com/v1/transport/transit/stations/st_gb_218003af11f9"1 pin; it opens its row.
| Idid | st_gb_218003af11f9 |
|---|---|
| Namename | London Kings Cross |
| Modesmodes | rail |
| Latlat | 51.53088 |
| Lnglng | -0.12293 |
| H3 cellcell | 89195da4d8fffff |
| Line countline_count | 48 |
| Trips per hour am peaktrips_per_hour.am_peak | 11.2 |
| Trips per hour interpeaktrips_per_hour.interpeak | 10.32 |
| Trips per hour pm peaktrips_per_hour.pm_peak | 10.63 |
| Trips per hour eveningtrips_per_hour.evening | 5 |
| Trips per hour weekendtrips_per_hour.weekend | 7.87 |
Response
{
"id": "st_gb_218003af11f9",
"name": "London Kings Cross",
"modes": [
"rail"
],
"lat": 51.53088,
"lng": -0.12293,
"cell": "89195da4d8fffff",
"line_count": 48,
"trips_per_hour": {
"am_peak": 11.2,
"interpeak": 10.32,
"pm_peak": 10.63,
"evening": 5,
"weekend": 7.87
},
"lines": [
{
"id": "ln_gb_8ee71c4ca30d",
"name": "Aberdeen ↔ London Kings Cross",
"operator": {
"id": "london_north_eastern_railway",
"name": "London North Eastern Railway"
},
"mode": "rail"
},
"… 47 more rows"
],
"nearby": [
{
"id": "st_gb_7d4f15682232",
"name": "King's Cross St. Pancras"
},
"… 4 more rows"
]
}GET /v1/transport/transit/stations/cellsCount the stations in each H3 cell, with a count per mode. With a boundary type, such as group_by=borough, you get one row per boundary, and with group_by=all you get one total for everything you send. With include=walk_15_min, you also get what a 15-minute walk reaches. Only stations are counted, not the stops grouped under them, so the counts cover the same stations that the list returns. For long cell lists, POST /v1/transport/transit/stations/cells takes the same fields as a JSON body.
| Parameter | Type | Default | What it does | Example |
|---|---|---|---|---|
include | walk_15_min | — | Adds walk_15_min: whether a station is within a 15-minute walk, and how many. Walk times exist for Australia, France, Germany, Lithuania, the Netherlands, Spain, Sweden, Switzerland, the United Kingdom and the United States. | include=walk_15_min |
The endpoint also takes the following common parameters:
- Location:
near,radius_m,bbox,cellsandat - Per-cell endpoints:
group_by(cell,allor a boundary type, which needs resolution 9) andresolution(6 to 10) - Paging:
limitandcursor - Output:
format - Long requests: the same fields as a POST body
Each result has a cell, a count of stations and mode_counts, the number of stations per mode with the most first. With group_by=all, there is one row with cell_count, count and mode_counts, and with a boundary type, one such row per boundary, with its boundary.
With include=walk_15_min, each cell's row has a walk_15_min block. Walk times are worked out per res-9 cell, so a res-10 cell reads its parent, and a coarser cell is covered if any res-9 cell in it is.
covered: true if a station is within a 15-minute walkstations: the number of stations within a 15-minute walk. For a cell coarser than res 9, it is the most that any one of its res-9 cells reachesmodes: the modes of those stationsoperators: the operators serving them, each as{id, name}. At resolutions 6 to 8, up to the 50 that serve most of the celllines: the number of lines calling at those stations
Neighbouring cells reach the same stations and lines, so stations and lines cannot be added up over cells. In a total (group_by=all or a boundary type, at resolution 9 or coarser), walk_15_min instead has people_covered, the residents with a station within a 15-minute walk, people, all the residents, people_covered_share, from 0 to 1, operator_count, and lines, with each operator and line counted once.
The rollup is sum for the counts, ratio_of_sums for people_covered_share, and distinct for operator_count and lines.
Errors
| Code | HTTP | When |
|---|---|---|
invalid_resolution | 400 | resolution is outside 6 to 10, the resolutions that transit data has, or is not 9 with a boundary type in group_by, or is 10 for a walk_15_min total. allowed lists the valid ones. |
invalid_group_by | 400 | group_by is not cell, all or a boundary type the country has. allowed lists them. |
invalid_include | 400 | include is anything other than walk_15_min. |
too_many_cells | 400 | A walk_15_min total at resolution 8 is sent more res-8 cells than the country's walk times can read in one request. allowed_max gives the maximum. |
invalid_format | 400 | geojson is requested with group_by=all. |
All the location and paging error codes also apply.
Put the id of one H3 cell in cells. You get back one row for that cell. count is the number of stations in it, and mode_counts splits them by mode.
You send
curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
"https://data.traveltimeapp.com/v1/transport/transit/stations/cells?cells=89195da4d03ffff"You get
{
"resolution": 9,
"results": [
{
"cell": "89195da4d03ffff",
"count": 5,
"mode_counts": {
"bus": 4,
"underground": 1
}
}
],
"next_cursor": null
}Separate the cell ids with commas. You get one row for each cell, in the order you sent them. These seven cells lie between Euston and St Pancras. The map shades each cell by its number of stations, from 1 to 5. Select a cell to see its row.
Request
curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
"https://data.traveltimeapp.com/v1/transport/transit/stations/cells?cells=89195da4d03ffff,89195da4d07ffff,89195da4d0bffff,89195da4d0fffff,89195da4d13ffff,89195da4d17ffff,89195da4d1bffff"Shade = count157 H3 cells; click a cell to open its row.
| H3 cellcell | Stationscount | Busmode_counts.bus | Railmode_counts.rail | Undergroundmode_counts.underground | Map |
|---|---|---|---|---|---|
| 89195da4d03ffff | 5 | 4 | — | 1 | |
| 89195da4d07ffff | 2 | 2 | — | — | |
| 89195da4d0bffff | 1 | — | 1 | — | |
| 89195da4d0fffff | 2 | 2 | — | — | |
| 89195da4d13ffff | 2 | 1 | 1 | — | |
| 89195da4d17ffff | 2 | 2 | — | — | |
| 89195da4d1bffff | 1 | 1 | — | — |
Response
{
"resolution": 9,
"results": [
{
"cell": "89195da4d03ffff",
"count": 5,
"mode_counts": {
"bus": 4,
"underground": 1
}
},
"… 6 more rows"
],
"next_cursor": null
}Add group_by=all to get one total row instead. The same seven cells hold 15 stations: 12 bus, 2 rail and 1 Underground. These are the same 15 stations that the list returns.
For a long list of cells, send POST /v1/transport/transit/stations/cells with the same fields in a JSON body. See Long requests.
You send
curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
"https://data.traveltimeapp.com/v1/transport/transit/stations/cells?cells=89195da4d03ffff,89195da4d07ffff,89195da4d0bffff,89195da4d0fffff,89195da4d13ffff,89195da4d17ffff,89195da4d1bffff&group_by=all"You get
{
"resolution": 9,
"results": [
{
"cell_count": 7,
"count": 15,
"mode_counts": {
"bus": 12,
"rail": 2,
"underground": 1
}
}
],
"next_cursor": null,
"rollup": {
"cell_count": "sum",
"count": "sum",
"mode_counts": "sum"
}
}Send bbox (south, west, north, east) for a box, or near and radius_m for a circle. You get one row for every cell in the area, and each row has its cell id. This box around King's Cross holds 39 cells, with 0 where there are no stations.
Request
curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
"https://data.traveltimeapp.com/v1/transport/transit/stations/cells?bbox=51.522,-0.140,51.538,-0.110"GET /v1/transport/transit/linesGet the lines that have a stop inside a location, the lines that stop at every station in serves, or the lines run by one operator. With q, results are sorted by best match; otherwise they are sorted by id. For long cell lists, POST /v1/transport/transit/lines takes the same fields as a JSON body.
| Parameter | Type | Default | What it does | Example |
|---|---|---|---|---|
serves | station ids | — | Returns the lines that stop at every station in the comma-separated list. It takes the place of a location, so don't send one with it. | serves=st_gb_7d4f15682232,st_gb_63a8aa9929e4 |
operator | operator id | — | Returns the lines run by this operator. /v1/catalog/{country} lists the operator ids. It takes the place of a location, so don't send one with it. | operator=london_underground_tfl |
mode | transit mode | — | Only return lines of this mode. | mode=bus |
q | text | — | Search by name or number, with the best match first. Requires a location or country. Has no next page, so raise limit to get more results. | q=victoria |
include | stops | — | Adds each line's stops, in the same format as for one line. A page then holds up to 100 rows. | include=stops |
The endpoint also takes the following common parameters:
- Location:
near,radius_m,bbox,cellsandat, orcountrywithq - Paging:
limitandcursor - Long requests: the same fields as a POST body
Each result has these fields:
id(ln_gb_…)nameoperator, as{id, name}modestop_count: the number of stopstrips_per_hour: as for stationsstops: only withinclude=stops, in the same format as for one line
Errors
| Code | HTTP | When |
|---|---|---|
location_required | 400 | The request has no location, serves or operator, or it has q with neither a location nor country. |
too_many_locations | 400 | The request has two of a location, serves and operator. |
country_not_allowed | 400 | country is sent without q. |
invalid_serves | 400 | serves holds something other than station ids, or stations from two countries. |
invalid_mode | 400 | mode is not a transit mode. allowed lists them. |
invalid_include | 400 | include is anything other than stops. |
All the location and paging error codes also apply.
All the lines that stop somewhere inside the box. There are 215, so the first page has 100 of them.
Request
curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
"https://data.traveltimeapp.com/v1/transport/transit/lines?bbox=51.522,-0.140,51.538,-0.110"| Namename | Operator nameoperator.name | Modemode | Stop countstop_count |
|---|---|---|---|
| NL-9 | Replacement Service | bus | 19 |
| London Kings Cross ↔ Royston | Great Northern | rail | 21 |
| 68 | Transport UK | bus | 84 |
| Crewe ↔ London Euston | West Midlands Trains | rail | 24 |
| Hitchin ↔ London Kings Cross | Great Northern | rail | 10 |
5 of the first 100 shown · next_cursor fetches the next page
Response
{
"results": [
{
"id": "ln_gb_01396c2c7f2c",
"name": "NL-9",
"operator": {
"id": "replacement_service",
"name": "Replacement Service"
},
"mode": "bus",
"stop_count": 19,
"trips_per_hour": {
"am_peak": null,
"interpeak": null,
"pm_peak": null,
"evening": null,
"weekend": 2.35
}
},
"… 99 more rows"
],
"next_cursor": "eyJxIjoiZDljY2RiYzVkOGU4NmY1YWE5YzU4ZGZmIiwiayI6WyI3MGExYTBhODZhNmUiXSwiZiI6ImVjMDZlNjE2MGVhNzA3YmQ5Njg5ZTBmZTUwYWNkMDA5In0.gJkVr0dCTh56uBngWFs3Kg"
}The 124 lines that stop in the H3 cells you choose. Of these, 101 are rail, 19 bus, 2 Overground and 2 Underground.
Request
curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
"https://data.traveltimeapp.com/v1/transport/transit/lines?cells=89195da4d03ffff,89195da4d07ffff,89195da4d0bffff,89195da4d0fffff,89195da4d13ffff,89195da4d17ffff,89195da4d1bffff"| Namename | Operator nameoperator.name | Modemode | Stop countstop_count |
|---|---|---|---|
| NL-9 | Replacement Service | bus | 19 |
| 68 | Transport UK | bus | 84 |
| Crewe ↔ London Euston | West Midlands Trains | rail | 24 |
| Peterborough ↔ Three Bridges | Thameslink | rail | 23 |
| London Euston ↔ Tring | West Midlands Trains | rail | 9 |
5 of the first 100 shown · next_cursor fetches the next page
Response
{
"results": [
{
"id": "ln_gb_01396c2c7f2c",
"name": "NL-9",
"operator": {
"id": "replacement_service",
"name": "Replacement Service"
},
"mode": "bus",
"stop_count": 19,
"trips_per_hour": {
"am_peak": null,
"interpeak": null,
"pm_peak": null,
"evening": null,
"weekend": 2.35
}
},
"… 99 more rows"
],
"next_cursor": "eyJxIjoiOTMwNmQ0OTNmYWFmYzc1OTIwOTkzMjE4IiwiayI6WyJkZTM3NmU4YjIwNDEiXSwiZiI6ImVjMDZlNjE2MGVhNzA3YmQ5Njg5ZTBmZTUwYWNkMDA5In0.ANGhd9BMvnr79acuGomV3A"
}The Northern and Victoria lines both connect King's Cross St. Pancras and Euston. The station ids come from Stations by mode, and include=stops adds each line's stops.
Request
curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
"https://data.traveltimeapp.com/v1/transport/transit/lines?serves=st_gb_7d4f15682232,st_gb_63a8aa9929e4&include=stops"| Namename | Operator nameoperator.name | Modemode | Stop countstop_count |
|---|---|---|---|
| Victoria | London Underground (TfL) | underground | 16 |
| Northern | London Underground (TfL) | underground | 52 |
All 2 shown
Response
{
"results": [
{
"id": "ln_gb_8d9e35643776",
"name": "Victoria",
"operator": {
"id": "london_underground_tfl",
"name": "London Underground (TfL)"
},
"mode": "underground",
"stop_count": 16,
"trips_per_hour": {
"am_peak": 34.4,
"interpeak": 27.08,
"pm_peak": 34.67,
"evening": 25.25,
"weekend": 10.27
},
"stops": [
{
"station": {
"id": "st_gb_f756801a50fa",
"name": "Brixton"
},
"sequence": 0,
"lat": 51.46289,
"lng": -0.11409
},
"… 15 more rows"
]
},
"… 1 more row"
],
"next_cursor": null
}All the lines run by one operator, in this case the 11 London Underground lines.
Request
curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
"https://data.traveltimeapp.com/v1/transport/transit/lines?operator=london_underground_tfl"| Namename | Operator nameoperator.name | Modemode | Stop countstop_count |
|---|---|---|---|
| Jubilee | London Underground (TfL) | underground | 28 |
| Piccadilly | London Underground (TfL) | underground | 54 |
| Central | London Underground (TfL) | underground | 50 |
| Metropolitan | London Underground (TfL) | underground | 34 |
| Circle | London Underground (TfL) | underground | 58 |
5 of 11 shown · the other 6 are in the response
Response
{
"results": [
{
"id": "ln_gb_0379924e7dcc",
"name": "Jubilee",
"operator": {
"id": "london_underground_tfl",
"name": "London Underground (TfL)"
},
"mode": "underground",
"stop_count": 28,
"trips_per_hour": {
"am_peak": 16.8,
"interpeak": 11.08,
"pm_peak": 17.33,
"evening": 14,
"weekend": 6.62
}
},
"… 10 more rows"
],
"next_cursor": null
}GET /v1/transport/transit/lines/{id}Get one line with its stops, each with its station's position, mode and number of other lines.
The response has the same fields as a list result, plus stops. Each stop has its station as {id, name}, a sequence, lat and lng, the station's mode, variant_share, the share (0–1) of the line's route variants that call there, and interchange_count, the number of other lines that call at the station. If the line counts cannot be read, the request fails with a 503. Stops on the main run come first, in sequence order. Stops off the main run (on a branch) follow, sorted by name, with sequence set to null.
Errors
| Code | HTTP | When |
|---|---|---|
invalid_id | 400 | The id is not a line id (ln_gb_…). |
not_found | 404 | There is no line with this id. |
The Victoria line and its 16 stops, starting with Brixton.
Request
curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
"https://data.traveltimeapp.com/v1/transport/transit/lines/ln_gb_8d9e35643776"| Idid | ln_gb_8d9e35643776 |
|---|---|
| Namename | Victoria |
| Operator idoperator.id | london_underground_tfl |
| Operator nameoperator.name | London Underground (TfL) |
| Modemode | underground |
| Stop countstop_count | 16 |
| Trips per hour am peaktrips_per_hour.am_peak | 34.4 |
| Trips per hour interpeaktrips_per_hour.interpeak | 27.08 |
| Trips per hour pm peaktrips_per_hour.pm_peak | 34.67 |
| Trips per hour eveningtrips_per_hour.evening | 25.25 |
| Trips per hour weekendtrips_per_hour.weekend | 10.27 |
Response
{
"id": "ln_gb_8d9e35643776",
"name": "Victoria",
"operator": {
"id": "london_underground_tfl",
"name": "London Underground (TfL)"
},
"mode": "underground",
"stop_count": 16,
"trips_per_hour": {
"am_peak": 34.4,
"interpeak": 27.08,
"pm_peak": 34.67,
"evening": 25.25,
"weekend": 10.27
},
"stops": [
{
"station": {
"id": "st_gb_f756801a50fa",
"name": "Brixton"
},
"sequence": 0,
"lat": 51.46289,
"lng": -0.11409
},
"… 15 more rows"
]
}GET /v1/transport/transit/lines/cellsCount the lines that stop in each H3 cell, with a count per mode. With group_by=all, you get one total for everything you send instead. For long cell lists, POST /v1/transport/transit/lines/cells takes the same fields as a JSON body.
The endpoint also takes the following common parameters:
- Location:
near,radius_m,bbox,cellsandat - Per-cell endpoints:
group_by(cellorall) andresolution(6 to 10) - Paging:
limitandcursor - Output:
format - Long requests: the same fields as a POST body
Each result has a cell, a count of the lines that stop there and mode_counts, the number of lines per mode. With group_by=all, there is one row with cell_count, count and mode_counts.
The rollup is distinct for count and mode_counts, so a line through ten H3 cells is counted once, and sum for cell_count.
Errors
This endpoint returns the same errors as /v1/transport/transit/stations/cells.
Put the id of one H3 cell in cells. You get back one row for that cell. count is the number of lines that stop in it, and mode_counts splits them by mode.
You send
curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
"https://data.traveltimeapp.com/v1/transport/transit/lines/cells?cells=89195da4d03ffff"You get
{
"resolution": 9,
"results": [
{
"cell": "89195da4d03ffff",
"count": 16,
"mode_counts": {
"bus": 14,
"underground": 2
}
}
],
"next_cursor": null
}Separate the cell ids with commas. You get one row for each cell, in the order you sent them. These seven cells lie between Euston and St Pancras. The map shades each cell by its number of lines, from 4 to 67. Select a cell to see its row.
Request
curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
"https://data.traveltimeapp.com/v1/transport/transit/lines/cells?cells=89195da4d03ffff,89195da4d07ffff,89195da4d0bffff,89195da4d0fffff,89195da4d13ffff,89195da4d17ffff,89195da4d1bffff"Shade = count4677 H3 cells; click a cell to open its row.
| H3 cellcell | Linescount | Busmode_counts.bus | Railmode_counts.rail | Undergroundmode_counts.underground | Overgroundmode_counts.overground | Map |
|---|---|---|---|---|---|---|
| 89195da4d03ffff | 16 | 14 | — | 2 | — | |
| 89195da4d07ffff | 4 | 4 | — | — | — | |
| 89195da4d0bffff | 41 | — | 39 | — | 2 | |
| 89195da4d0fffff | 8 | 8 | — | — | — | |
| 89195da4d13ffff | 67 | 5 | 62 | — | — | |
| 89195da4d17ffff | 9 | 9 | — | — | — | |
| 89195da4d1bffff | 4 | 4 | — | — | — |
Response
{
"resolution": 9,
"results": [
{
"cell": "89195da4d03ffff",
"count": 16,
"mode_counts": {
"bus": 14,
"underground": 2
}
},
"… 6 more rows"
],
"next_cursor": null
}Add group_by=all to get one total row instead. The same seven cells are served by 124 lines. A line that stops in several of the cells is counted once.
For a long list of cells, send POST /v1/transport/transit/lines/cells with the same fields in a JSON body. See Long requests.
You send
curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
"https://data.traveltimeapp.com/v1/transport/transit/lines/cells?cells=89195da4d03ffff,89195da4d07ffff,89195da4d0bffff,89195da4d0fffff,89195da4d13ffff,89195da4d17ffff,89195da4d1bffff&group_by=all"You get
{
"resolution": 9,
"results": [
{
"cell_count": 7,
"count": 124,
"mode_counts": {
"rail": 101,
"bus": 19,
"overground": 2,
"underground": 2
}
}
],
"next_cursor": null,
"rollup": {
"cell_count": "sum",
"count": "distinct",
"mode_counts": "distinct"
}
}Send bbox (south, west, north, east) for a box, or near and radius_m for a circle. You get one row for every cell in the area, and each row has its cell id. This box around King's Cross holds 39 cells.
Request
curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
"https://data.traveltimeapp.com/v1/transport/transit/lines/cells?bbox=51.522,-0.140,51.538,-0.110"GET /v1/transport/roadsGet the major roads that have an entry or exit in a location, with one row per road and direction. With near, results are sorted nearest first; otherwise they are sorted by id.
Major roads are motorways and freeways: roads Overture Maps classes as motorway. Ramps between two major roads are left out.
The endpoint also takes the following common parameters:
Each result has these fields:
id(rd_gb_…)name, often nullref, such asM1direction: northbound, southbound, eastbound, westbound or nullaccess_counts: the number of entries and exits the road has inside the location, as{entry, exit}
Errors
| Code | HTTP | When |
|---|---|---|
location_required | 400 | The request has no near or bbox. Roads don't take cells or at. |
not_available_in_country | 404 | The location is in a country with no road data. |
too_many_results | 400 | There are over 10,000 entries and exits in the location. Use a smaller location. |
All the location and paging error codes also apply.
The major roads within 10 km of King's Cross. The only one is the M1, which has one row for each direction.
Request
curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
"https://data.traveltimeapp.com/v1/transport/roads?near=51.5307,-0.1238&radius_m=10000"| Refref | Directiondirection | Entriesaccess_counts.entry | Exitsaccess_counts.exit |
|---|---|---|---|
| M1 | southbound | 0 | 1 |
| M1 | northbound | 2 | 0 |
All 2 shown
Response
{
"results": [
{
"id": "rd_gb_423c83e76074",
"name": null,
"ref": "M1",
"direction": "southbound",
"access_counts": {
"entry": 0,
"exit": 1
}
},
"… 1 more row"
],
"next_cursor": null
}GET /v1/transport/roads/{id}Get one major road in one direction, with its entries and exits counted along its whole length. To list them, use GET /v1/transport/roads/access?road=<id>.
The response has the same fields as a list result, but access_counts covers the whole road.
Errors
| Code | HTTP | When |
|---|---|---|
invalid_id | 400 | The id is not a road id (rd_gb_…). |
not_found | 404 | There is no road with this id. |
The M1 northbound, which has 49 entries and 49 exits.
Request
curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
"https://data.traveltimeapp.com/v1/transport/roads/rd_gb_5dd25d5e19ad"| Idid | rd_gb_5dd25d5e19ad |
|---|---|
| Namename | — |
| Refref | M1 |
| Directiondirection | northbound |
| Entriesaccess_counts.entry | 49 |
| Exitsaccess_counts.exit | 49 |
Response
{
"id": "rd_gb_5dd25d5e19ad",
"name": null,
"ref": "M1",
"direction": "northbound",
"access_counts": {
"entry": 49,
"exit": 49
}
}GET /v1/transport/roads/accessGet the junctions, ramps and slip roads where you get on or off a major road. You can search in a location, or along one road with road. With near, results are sorted nearest first; otherwise they are sorted by id.
| Parameter | Type | Default | What it does | Example |
|---|---|---|---|---|
type | entry | exit | both | Only return entries (on-ramps and slip roads onto the road) or only exits. | type=entry |
road | road id | — | Only return this road's entries and exits. It takes the place of a location, so don't send one with it. | road=rd_gb_5dd25d5e19ad |
The endpoint also takes the following common parameters:
Each result has these fields:
id:ra_gb_on-…for an entry,ra_gb_off-…for an exittype: entry or exitroad, as{id, name, ref}: the major road it joins (withroad, the road you asked for)name: the local road it joins, often nulllatandlng, in degreescell: its resolution-9 H3 celldistance_m: the distance in metres, only withnear
Errors
| Code | HTTP | When |
|---|---|---|
location_required | 400 | The request has none of near, bbox or road. |
too_many_locations | 400 | road is sent with near or bbox. |
invalid_type | 400 | type is not entry or exit. |
invalid_id | 400 | road is not a road id. |
not_available_in_country | 404 | The location is in a country with no road data. |
too_many_results | 400 | There are over 10,000 entries and exits in the location. |
All the location and paging error codes also apply.
The nearest motorway entries to King's Cross are two slip roads onto the M1 northbound at Staples Corner, 8.7 km away.
Request
curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
"https://data.traveltimeapp.com/v1/transport/roads/access?near=51.5307,-0.1238&radius_m=10000&type=entry"2 pins inside the 10,000 m circle; a pin opens its row.
| Namename | Distancedistance_m | Typetype | Road refroad.ref | Map |
|---|---|---|---|---|
| — | 8.7 km | entry | M1 | |
| Staples Corner | 8.7 km | entry | M1 |
All 2 shown
Response
{
"results": [
{
"id": "ra_gb_on-d11a8a2b-f21b-437a-9b84-5d84e267b0df",
"type": "entry",
"road": {
"id": "rd_gb_5dd25d5e19ad",
"name": null,
"ref": "M1"
},
"name": null,
"lat": 51.57186,
"lng": -0.23051,
"cell": "89195da4267ffff",
"distance_m": 8682
},
"… 1 more row"
],
"next_cursor": null
}GET /v1/transport/roads/access/{id}Get one entry or exit.
The response has the same fields as a list result, without distance_m.
Errors
| Code | HTTP | When |
|---|---|---|
invalid_id | 400 | The id is not an entry or exit id (ra_gb_on-… or ra_gb_off-…). |
not_found | 404 | There is no entry or exit with this id. |
The M1 northbound entry at Staples Corner.
Request
curl -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" \
"https://data.traveltimeapp.com/v1/transport/roads/access/ra_gb_on-7a1d7c4e-d65c-4d9b-b963-790bc7213b59"1 pin; it opens its row.
| Idid | ra_gb_on-7a1d7c4e-d65c-4d9b-b963-790bc7213b59 |
|---|---|
| Typetype | entry |
| Road idroad.id | rd_gb_5dd25d5e19ad |
| Road nameroad.name | — |
| Road refroad.ref | M1 |
| Namename | Staples Corner |
| Latlat | 51.57234 |
| Lnglng | -0.23042 |
| H3 cellcell | 89195da4267ffff |
Response
{
"id": "ra_gb_on-7a1d7c4e-d65c-4d9b-b963-790bc7213b59",
"type": "entry",
"road": {
"id": "rd_gb_5dd25d5e19ad",
"name": null,
"ref": "M1"
},
"name": "Staples Corner",
"lat": 51.57234,
"lng": -0.23042,
"cell": "89195da4267ffff"
}