search icon
Overview
Developer Tools
Travel Time Matrix API
Isochrone API
Distance Map API
Routes API
Geocoding API
Additional API Reference
Error Handling
ArcGIS plugin
QGIS plugin
Alteryx plugin
TravelTime.comchevronDocs
/v4/routes

Routes

Calculate A to B routes and turn-by-turn directions.

Access URL: https://api.traveltimeapp.com/v4/routes

Supports two HTTP request types:

  • GET - for simple requests using basic parameters only
  • POST - for more complex requests using advanced parameters
POST
GET

POST Request

A POST request should be used when needing to configure the advanced parameters not available in the GET request.

The access URL is the same as the GET request format, but the differences are:

  • Authentication is included in the request Headers
  • Parameters are included in the request Body

Access URL: https://api.traveltimeapp.com/v4/routes

Request Body

array[object]

Define your locations to use later in departure_searches or arrival_searches

Hide child attributes

You will have to reference this id in your searches. It will also be used in the response body. Must be unique among all locations.

The coordinates of the locations.

Show child attributes

Latitude.

Longitude.

array[object]

Searches based on departure time. Leave departure location at no earlier than given time. This allows you to specify a single departure location and multiple arrival locations. You can define a maximum of 10 searches.

Hide child attributes

Used to identify each search in the results array. Must be unique among all searches.

The id of the location we should start the search from. Must reference an id from locations array.

The ids of locations we should find the routes to. Must reference ids from locations array.

date in extended ISO-8601 format

Leave departure location at no earlier than given time. In ISO 8601 format. For example:
2024-12-05T07:00:00Z (representing UTC)
2024-12-05T07:00:00-05:00 (representing New York on Standard Time: UTC-05:00)

Properties to be returned about the locations. Possible values: travel_time, distance, fares, route.

Transportation mode and related parameters. The default parameters are sensible and it is usually enough to only specify the type.

Show child attributes

cycling, driving, driving+train (only in Great Britain), public_transport, walking, coach, bus, train, ferry, driving+ferry, cycling+ferry or cycling+public_transport (only in Netherlands).

Note - a driving+train search is for driving then train (i.e driving to a station and continuing by train). The maximum drive time can be configured using the driving_time_to_station parameter

Additional road types to included when executing search. Only affects driving and driving+ferry transportation modes. Possible values:

  • track - unpaved roads that only allow very slow driving speed or even require an off-road capable vehicle.
  • restricted - roads that are not publicly accessible and may require a special permit. By default all of these roads are excluded from the search.

Maximum time (in seconds) allowed for walking at the start and end of a public transport journey. i.e:

  • the maximum walking time from the origin to the first stop/station, and
  • the maximum walking time from the final stop/station to the destination

These limits are independent and not cumulative. They only apply to the first and last walking legs of the journey - all walking times between public transport legs are limited to 600s (10 minutes) each.

The default value is 900.

Cannot be higher than travel_time.

Used in public_transport, coach, bus, train, driving+train and cycling+public_transport transportation modes.

Time in seconds needed to board public transportation vehicle.
Default is 0.
Used in public_transport, coach, bus, train, driving+train and cycling+public_transport transportation modes.

Maximum time (in seconds) allowed for driving from the origin to the train station.
Default value is 1800.
Used only in driving+train transportation mode.

Maximum time (in seconds) allowed for cycling (including any ferry transfers) from the origin to the first stop/station.
Default value is 900.
Used only in cycling+public_transport transportation mode.

Time in seconds required to park a car or a bicycle.
Default value is 300.
Used in driving+train and cycling+public_transport transportation modes.

Time in seconds required to board a ferry.
Default value is 0.
Used in ferry, driving+ferry, cycling+ferry and cycling+public_transport transportation modes. For public_transport mode, pt_change_delay is used instead.

If set to true, the crossing of country borders is disabled. Only available with the driving transportation mode, and is enabled by default (false).

Upper limit for the number of changes between public transit legs in a journey.
Used in public_transport, coach, bus, train, driving+train and cycling+public_transport transportation modes. For other modes the max_changes parameter is ignored.

Show child attributes

Enable transit leg change limit?

Maximum number of changes between transit legs in a journey. Must be at least 0.

object | optional

When enabled, range adds a departure window to the departure time, and results are returned for any journeys that depart during this window.
In the results array, the properties of these multiple alternative results are sorted by travel_time in ascending order.
Disabled by default.
Used in public_transport, coach, bus, train, driving+train and cycling+public_transport transportation modes. For other modes range search parameters are ignored.

Show child attributes

Enable range search?

Maximum number of results to return. Limited to 5 results.

When enabled, range adds an arrival window to the arrival time, and results are returned for any journeys that arrive during this window.
In the results array, the properties of these multiple alternative results are sorted by travel_time in ascending order.
Disabled by default.
Used in public_transport, coach, bus, train, driving+train and cycling+public_transport transportation modes. For other modes the parameter is ignored.

object | optional

Adjusts the process of looking up the nearest roads from the departure / arrival points.

Show child attributes
  • enabled (default) - walking time and distance from the departure location to the nearest road and from the nearest road to the arrival location are added to the total travel time and distance of a journey.
  • disabled - these walking times and distances are not added to the total reported values (i.e the journey effectively starts and ends at the nearest points on the road network).
  • both_drivable_and_walkable (default) - journey can only start or end on roads that are accessible by both: cars and pedestrians. This effectively means journeys can not start / end on motorways.
  • any_drivable - journey can start or end on any road accessible by a car (including motorways).

array[object]

Searches based on arrival time. Arrive at destination location at no later than given time. This allows you to specify a single arrival location and multiple departure locations. You can define a maximum of 10 searches

Show child attributes

Used to identify each search in the results array. Must be unique among all searches.

The id of the location we should start the search from. Must reference an id from locations array.

The ids of locations we should find the routes to. Must reference ids from locations array.

date in extended ISO-8601 format

Be at arrival location at no later than given time. In ISO 8601 format. For example:
2024-12-05T07:00:00Z (representing UTC)
2024-12-05T07:00:00-05:00 (representing New York on Standard Time: UTC-05:00)

Properties to be returned about the locations. Possible values: travel_time, distance, fares, route.

Transportation mode and related parameters. The default parameters are sensible and it is usually enough to only specify the type.

Show child attributes

cycling, driving, driving+train (only in Great Britain), public_transport, walking, coach, bus, train, ferry, driving+ferry, cycling+ferry or cycling+public_transport (only in Netherlands).

Note - a driving+train search is for driving then train (i.e driving to a station and continuing by train). The maximum drive time can be configured using the driving_time_to_station parameter

Additional road types to included when executing search. Only affects driving and driving+ferry transportation modes. Possible values:

  • track - unpaved roads that only allow very slow driving speed or even require an off-road capable vehicle.
  • restricted - roads that are not publicly accessible and may require a special permit. By default all of these roads are excluded from the search.

Maximum time (in seconds) allowed for walking at the start and end of a public transport journey. i.e:

  • the maximum walking time from the origin to the first stop/station, and
  • the maximum walking time from the final stop/station to the destination

These limits are independent and not cumulative. They only apply to the first and last walking legs of the journey - all walking times between public transport legs are limited to 600s (10 minutes) each.

The default value is 900.

Cannot be higher than travel_time.

Used in public_transport, coach, bus, train, driving+train and cycling+public_transport transportation modes.

Time in seconds needed to board public transportation vehicle.
Default is 0.
Used in public_transport, coach, bus, train, driving+train and cycling+public_transport transportation modes.

Maximum time (in seconds) allowed for driving from the origin to the train station.
Default value is 1800.
Used only in driving+train transportation mode.

Maximum time (in seconds) allowed for cycling (including any ferry transfers) from the origin to the first stop/station.
Default value is 900.
Used only in cycling+public_transport transportation mode.

Time in seconds required to park a car or a bicycle.
Default value is 300.
Used in driving+train and cycling+public_transport transportation modes.

Time in seconds required to board a ferry.
Default value is 0.
Used in ferry, driving+ferry, cycling+ferry and cycling+public_transport transportation modes. For public_transport mode, pt_change_delay is used instead.

If set to true, the crossing of country borders is disabled. Only available with the driving transportation mode, and is enabled by default (false).

Upper limit for the number of changes between public transit legs in a journey.
Used in public_transport, coach, bus, train, driving+train and cycling+public_transport transportation modes. For other modes the max_changes parameter is ignored.

Show child attributes

Enable transit leg change limit?

Maximum number of changes between transit legs in a journey. Must be at least 0.

object | optional

When enabled, range adds an arrival window to the arrival time, and results are returned for any journeys that arrive during this window.
In the results array, the properties of these multiple alternative results are sorted by travel_time in ascending order.
Disabled by default.
Used in public_transport, coach, bus, train, driving+train and cycling+public_transport transportation modes. For other modes range search parameters are ignored.

Show child attributes

Enable range search?

Maximum number of results to return. Limited to 5 results.

When enabled, range adds an arrival window to the arrival time, and results are returned for any journeys that arrive during this window.
In the results array, the properties of these multiple alternative results are sorted by travel_time in ascending order.
Disabled by default.
Used in public_transport, coach, bus, train, driving+train and cycling+public_transport transportation modes. For other modes the parameter is ignored.

object | optional

Adjusts the process of looking up the nearest roads from the departure / arrival points.

Show child attributes
  • enabled (default) - walking time and distance from the departure location to the nearest road and from the nearest road to the arrival location are added to the total travel time and distance of a journey.
  • disabled - these walking times and distances are not added to the total reported values (i.e the journey effectively starts and ends at the nearest points on the road network).
  • both_drivable_and_walkable (default) - journey can only start or end on roads that are accessible by both: cars and pedestrians. This effectively means journeys can not start / end on motorways.
  • any_drivable - journey can start or end on any road accessible by a car (including motorways).

Response Body

array[object]

The results array which is sorted lexicographically by the id attribute.

Hide child attributes

array[object]

Show child attributes

Properties array. May contain multiple elements if range was enabled, single element otherwise. Sorted by travel_time. Only the properties included in the request are returned.

Show child attributes

Travel time in seconds.

Distance in meters.

Show child attributes

date in extended ISO-8601 format

2024-12-05T07:00:00+03:00 or 2024-12-05T07:00:00Z.

date in extended ISO-8601 format

Example 2024-12-05T07:00:00+03:00 or 2024-12-05T07:00:00Z.

Show child attributes

A sequential id, used to relate route parts with fare data.

Possible values: basic, start_end, road or public_transport.

car, parking, boarding, walk, bike, bike_parking, train, rail_national, rail_overground, rail_underground, rail_dlr, bus, cable_car, plane, ferry or coach.

Distance in meters.

Travel time in seconds.

Only available when type is start_end.

May be present on parts where type is road.

May be present on parts where type is road.

Only available when type is public_transport.

Only available when type is public_transport.

Only available when type is public_transport.

Local departure time. Only available when type is public_transport.

Local arrival time. Only available when type is public_transport.

Only available when type is public_transport.

Show child attributes
Show child attributes

Mode covered by the ticket, can be: car, parking, boarding, walk, bike, bike_parking, train, rail_national, rail_overground, rail_underground, rail_dlr, bus, cable_car, plane, ferry or coach.

Id's of route parts that are covered by these tickets.

Show child attributes
Show child attributes

Possible values: single, week, month or year.

ISO 4217 currency code.

array[string]

Id's of locations for which we cannot find a route. This can happen if the point cannot be reached within 12 hours.

Limitations

Currently “departure_searches.arrival_location_ids” and “arrival_searches.departure_location_ids” array sizes are limited to a maximum of 2 values.

You can use time-filter with route property to work around this limitation, but you will have to specify “travel_time”.

Examples

Request

Loading

Response Body

Loading

Request When a Route Cannot Be Found

Loading

Response Body

Loading

GET Request

A GET request is the simplest way to calculate a route. A single route can be generated by specifying the query parameters in the URL.

Query parameters

string

Mode of transport used.
Available options: walking, public_transport, driving, cycling.

Latitude of the start location.

Longitude of the start location.

Latitude of the end location.

Longitude of the end location.

date in extended ISO-8601 format | optional

If this is specified, the journey must depart from the origin no earlier than the specified time.

date in extended ISO-8601 format | optional

If this is specified, the journey must arrive at the destination no later than the specified time.

string

Used for authenticating the request. Visit our developer portal to access your credentials or generate new ones.

string

Used for authenticating the request. Visit our developer portal to access your credentials or generate new ones.

Query response

Successful requests will return an HTTP 200 response.

Response schema - application/json

array[object]

The results array which is sorted lexicographically by the id attribute.

Hide child attributes
Show child attributes

The properties array containing the route.

Show child attributes

Travel time in seconds.

Distance in meters.

Show child attributes

date in extended ISO-8601 format

2024-12-05T07:00:00+03:00 or 2024-12-05T07:00:00Z.

date in extended ISO-8601 format

Example 2024-12-05T07:00:00+03:00 or 2024-12-05T07:00:00Z.

Show child attributes

A sequential id, used to relate route parts with fare data.

Possible values: basic, start_end, road or public_transport.

car, parking, boarding, walk, bike, bike_parking, train, rail_national, rail_overground, rail_underground, rail_dlr, bus, cable_car, plane, ferry or coach.

Distance in meters.

Travel time in seconds.

Only available when type is start_end.

May be present on parts where type is road.

May be present on parts where type is road.

Only available when type is public_transport.

Only available when type is public_transport.

Only available when type is public_transport.

Local departure time. Only available when type is public_transport.

Local arrival time. Only available when type is public_transport.

Only available when type is public_transport.

array[string]

Array of unreachable locations. A location will be unreachable if either of the following is true:

  1. The required travel time is greater than 2 hours.
  2. The location is in an inaccessible location (e.g on a body of water, or in an extremely remote area).
  3. The location is more than 15 minutes walk from the nearest public transport stop/station (public transport mode only).

Example

Example request

https://api.traveltimeapp.com/v4/routes?type=public_transport&origin_lat=51.41070&origin_lng=-0.15540&destination_lat=51.59974&destination_lng=-0.19531&arrival_time=2024-12-05T08:00:00Z&app_id=YOUR_APP_ID&api_key=YOUR_APP_KEY

Please note that to send the GET request you will need to replace the YOUR_APP_ID and YOUR_APP_KEY values with your own credentials.

Example Request

Loading

Response Body

Loading