Public Transit API Developer's Guide

Transit Routing

Use the route resource to request routes between two sets of WGS-84 compliant geocoordinates.

.../metarouter/rest/routeservice/v2/route.{format}?<parameter>=<value>...
      
Table 1. Mandatory Parameters
Parameter Data Type Description
app_code String

A 20 bytes Base64 URL-safe encoded string used for the authentication of the client application.
You must include an app_id and app_code with every request. To get an app_code assigned to you, please see Acquiring Credentials.

app_id String

A 20 bytes Base64 URL-safe encoded string used for the authentication of the client application.
You must include an app_id and app_code with every request. To get an app_code assigned to you, please see Acquiring Credentials.

startX Double Specifies the longitude of the starting point of your route in WGS 84-compliant degrees between -180 and 180.
startY Double Specifies the latitude of the starting point of your route in WGS 84-compliant degrees between -90 and 90.
destX Double Specifies the longitude of the end point of your route in WGS 84-compliant degrees between -180 and 180.
destY Double Specifies the latitude of the end point of your route in WGS 84-compliant degrees between -90 and 90.
routing String Specifies the requested routing type. Can be one of:
  • sr - for estimated routing
  • tt - for timetable
  • all - for both estimated and timetable routing>
  • rt - for real-time routing (available in Advanced Plan)
time DateTime Specifies the time in ISO 8601 (for example, 2016-06-22T06:36:40) format.
Table 2. Optional Parameters
Parameter Data Type Description
arrival Integer Switches between arrival and departure time. If enabled, makes routing request to interpret time as arrival time for the journey.

1 (enabled), 0 (disabled)

The default is 0.

backward Integer Specifies the number of preceding departures/arrivals the response should include. The possible values are:

0-6 – If you provide a value for the parameter forward, a backward value of 0 results in only forward routes in the response.

The default is 0.

The sum of the parameters backward and forward cannot be > 6.

callback_func String Specifies an arbitrary string used to wrap the JSON object in the response.
callback_id Integer If you specify the parameter callback_id, specifies the first argument to the function specified by the callback_func.
changes Integer Specifies the maximum number of changes or transfers allowed in a route.

0-6 or -1.

The default is -1 (which disables the filter, or unlimited no of changes permitted).

Note: In areas where this parameter is not supported, the route response includes the attribute sup_changes="0" in the Connection node.
dest String Specifies a descriptive text for the end point of your route.
details Integer Requests the inclusion of a list of intermediate stops within the routes in the response. If enabled, the response includes stop/station names, WGS-84 geocoordinates, and the departure/arrival times at the stops.

1 (enabled), 0 (disabled)

The default is 1.

forward Integer Specifies the number of following departure/arrivals the response should include. The possible values are:

0-6 – If you do not provide a value for the parameter backward, a forward value of 0 results in the same behavior as if it was a value of 1.

The default is 3.

The sum of the parameters backward and forward cannot be > 6.

Note: The total number of routes you can request also includes any backward routes.
graph Integer Requests coordinate pairs to allow the drawing of a polyline for the route. The possible values are:

1 (enabled), 0 (disabled)

The default is 0.

lang String Specifies the language of the response. The value complies with the ISO 639-1 standard and defaults to en.
prod Integer

Specifies the transit type filter used to determine which types of transit to include in the response.
The default is 1111111111111111, meaning all supported transit types are permitted.
See Transit Modes page for more information.
            

start String Specifies a descriptive text for the starting location.
strict Integer Specifies if the number of returned connections must be strict.

1 (enabled), 0 (disabled)

The default is 0.

tariff Integer Return fare information for the requested route in the response (available in Advanced Plan).

1 (enabled), 0 (disabled)

The default is 0.

walk String Specifies a maximum walking distance and walking speed in the format max_distance,speed as follows:
  • max_distance: range 0-6000 (meters).
  • speed: range 50-200 (half of normal speed to double the normal speed).

The default value is 2000,100.

Note: In areas where speed or max_dist parameters are not supported, the route response includes the attributes sup_speed=0 or sup_max_dist=0 in the Connections node.
sec_ctx Integer The response includes a context for use in subsequent requests for the route segment update.

1 (enabled), 0 (disabled)

The default is 0.

See Route Segment Update for details.
maneuvers Integer The response includes turn-by-turn maneuvers information for the relevant transport mode, e.g. wak, taxi, car share, etc.

1 (enabled), 0 (disabled)

The default is 0.

first_last_mile Integer The response includes first/last mile of a long-distance connection. If set to 0, response will only show the long distance sections in between and excludes the initial and final connections.

1 (enabled), 0 (disabled)

The default is 1.

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.