Guidance Instructions
Purpose
This document describes route planning parameters that are related to the guidance. They can be used, among others, in the Calculate Route service.
Please be aware that this document does not specify the complete request or response format. To maintain forward compatibility you must be able to process responses with additional non-documented data fields. Our deprecation policy only covers the documented subset of these formats.
Types
Request data
HTTPS method: GET
POST
Constants and parameters enclosed in curly brackets { } must be replaced with their values.
Generic request format
The following request URL contains all of this endpoint's respective parameters. For their details, please see the Common Routing Parameters page.
1https://{baseURL}/routing/{versionNumber}/calculateRoute/{routePlanningLocations}/{contentType}?key={Your_API_Key}2&instructionsType={instructionsType}3&language={language}4§ionType={sectionType}5&instructionAnnouncementPoints={string}6&instructionPhonetics={string}7&instructionRoadShieldReferences={string}
GET URL example
Note: Linebreaks are designated by "\".
1https://api.tomtom.com/routing/1/calculateRoute/\252.50931,13.42936:52.50274,13.43872/json?\3&instructionsType=text&language=en-GB\4§ionType=lanes&instructionAnnouncementPoints=all\5&instructionPhonetics=LHP&instructionRoadShieldReferences=all\6&key={Your_API_Key}
GET curl command example
Note: Linebreaks are designated by "\".
1curl -X GET "https://api.tomtom.com/routing/1/calculateRoute/\252.50931,13.42936:52.50274,13.43872/json?\3&instructionsType=text&language=en-GB\4§ionType=lanes&instructionAnnouncementPoints=all\5&instructionPhonetics=LHP&instructionRoadShieldReferences=all\6&key={Your_API_Key}" -H "accept:*/*"
Extensions of existing features
sectionType parameter
Parameter | Description |
---|---|
| The following section types can additionally be requested:
|
Request parameters
Optional parameters | Description | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| If specified, guidance instructions will be returned (if available). Possible values are:
| ||||||||||||||||||||||||||||||||||||||||||
| The
en-GB | ||||||||||||||||||||||||||||||||||||||||||
| Specifies whether to include announcement points in instructions. If specified, the instruction will include up to three additional fine-grained announcement points, each with their own location, maneuver type, and distance to the instruction point. Possible values are:
Default value: | ||||||||||||||||||||||||||||||||||||||||||
| Specifies whether to include the phonetic transcription of street names, signpost text, and road numbers in the instructions of the response. Possible values are:
Default value: When using any value other than
Note: In areas where phonetic information is not available, these
fields will not be returned in the Response. The
| ||||||||||||||||||||||||||||||||||||||||||
| Specifies whether to include road shield references into the external
road shields atlas.
Possible values are:
Default value: The road shields are available in these supported countries. |
Response data
Example of a successful response
A response could look like this: (Note: Comments are contained within ... ...
.)
Response body - JSON
1{2 "formatVersion": "0.0.12",3 "roadShieldAtlasReference": "https://api.tomtom.com/map/1/roadshield/1.0.0/",4 "routes": [5 {6 "summary": [...]7 "legs": [...]8 "sections": [9 {10 "lanes": [11 {12 "directions": ["STRAIGHT"]13 },14 {15 "directions": ["SLIGHT_RIGHT"],16 "follow": "SLIGHT_RIGHT"17 }18 ],19 "laneSeparators": ["SINGLE_SOLID", "DOUBLE_SOLID", "SINGLE_SOLID"],20 "startPointIndex": 48,21 "endPointIndex": 49,22 "sectionType": "LANES"23 },24 {25 "lanes": [26 {27 "directions": ["STRAIGHT"],28 "follow": "STRAIGHT"29 },30 {31 "directions": ["STRAIGHT"],32 "follow": "STRAIGHT"33 },34 {35 "directions": ["RIGHT"]36 }37 ],38 "laneSeparators": ["SINGLE_SOLID", "SINGLE_SOLID", "SHORT_DASHED", "SINGLE_SOLID"],39 "startPointIndex": 52,40 "endPointIndex": 53,41 "sectionType": "LANES"42 },43 {44 "maxSpeedLimitInKmh": 120,45 "startPointIndex": 53,46 "endPointIndex": 54,47 "sectionType": "SPEED_LIMIT"48 },49 {50 "maxSpeedLimitInKmh": 50,51 "startPointIndex": 60,52 "endPointIndex": 64,53 "sectionType": "SPEED_LIMIT"54 },55 {56 "roadShieldReferences": [57 {58 "reference": "nld-highway",59 "shieldContent": "2"60 },61 {62 "reference": "european-road",63 "shieldContent": "E1",64 "affixes": [65 "N"66 ]67 },68 ...further road shield references...69 ],70 "startPointIndex": 42,71 "endPointIndex": 68,72 "sectionType": "ROAD_SHIELDS"73 }74 ...further sections...75 ]76 "guidance": {77 "instructions": [78 ...prior instructions...79 {80 "routeOffsetInMeters" : 1141,81 "travelTimeInSeconds" : 236,82 "point" : {83 "latitude" : 52.37236,84 "longitude" : 4.9086185 },86 "pointIndex" : 64,87 "instructionType" : "TURN",88 "roadNumbers" : ["s116"],89 "phoneticRoadNumbers" : ["'2Es.hOn.d$rt.sEs.'tin"],90 "phoneticRoadNumberLanguageCodes" : ["DUN"],91 "street" : "Prins Hendrikkade",92 "phoneticStreet" : "'prIns_'hEn.drIk.'2ka.d$",93 "phoneticStreetLanguageCode" : "DUN",94 "countryCode" : "NLD",95 "signpostText" : "Scheepvaartmuseum",96 "phoneticSignPostText" : "'sxep.fart.my.'2ze.^m",97 "phoneticSignPostTextLanguageCode" : "DUN",98 "junctionType" : "BIFURCATION",99 "turnAngleInDecimalDegrees" : 45,100 "possibleCombineWithNext" : true,101 "drivingSide" : "RIGHT",102 "maneuver" : "KEEP_RIGHT",103 "message" : "Keep right at Prins Hendrikkade toward Scheepvaartmuseum",104 "combinedMessage" : "Keep right at Prins Hendrikkade toward Scheepvaartmuseum then keep left at Prins Hendrikkade/s116",105 "roadShieldReferences": [106 {107 "reference": "european-road",108 "shieldContent": "E1",109 "affixes": [110 "E"111 ]112 }113 ],114 "signpostRoadShieldReferences": [115 {116 "reference": "nld-connector",117 "shieldContent": "s100"118 }119 ],120 "earlyWarningAnnouncement" : {121 "point" : {122 "latitude" : 52.3747,123 "longitude" : 4.90426124 },125 "pointIndex" : 43,126 "maneuver" : "AHEAD_KEEP_RIGHT",127 "distanceInMeters" : 400128 },129 "mainAnnouncement" : {130 "point" : {131 "latitude" : 52.37353,132 "longitude" : 4.90645133 },134 "pointIndex" : 50,135 "maneuver" : "KEEP_RIGHT",136 "distanceInMeters" : 200137 },138 "confirmationAnnouncement" : {139 "point" : {140 "latitude" : 52.37263,141 "longitude" : 4.90785142 },143 "pointIndex" : 58,144 "maneuver" : "KEEP_RIGHT",145 "distanceInMeters" : 60146 }147 },148 ...further instructions...149 ],150 "instructionGroups": [151 {152 "firstInstructionIndex": 0,153 "lastInstructionIndex": 5,154 "groupLengthInMeters": 4567,155 "groupMessage": "Leave from An der Schillingbrücke and continue to A1/E35"156 },157 ...further instruction groups...158 ]159 }160 }161 ...further routes...162 ]163}
Structure of a successful response
JSON field | Description |
---|---|
| This contains guidance related fields. This field is present only when guidance was requested and is available. |
| A set of attributes describing a maneuver, e.g., "Turn right", "Keep left", "Take the ferry", "Take the motorway", "Arrive". |
| This groups a sequence of instruction elements which are related to each other.
|
| A |
Maneuver codes
The following table describes the possible values of the maneuver
instruction field.
Maneuver value | Example translation |
---|---|
ARRIVE | You have arrived. |
ARRIVE_LEFT | You have arrived. Your destination is on the left. |
ARRIVE_RIGHT | You have arrived. Your destination is on the right. |
DEPART | Leave. |
STRAIGHT | Keep straight on. |
KEEP_RIGHT | Keep right. |
BEAR_RIGHT | Bear right. |
TURN_RIGHT | Turn right. |
SHARP_RIGHT | Turn sharp right. |
KEEP_LEFT | Keep left. |
BEAR_LEFT | Bear left. |
TURN_LEFT | Turn left. |
SHARP_LEFT | Turn sharp left. |
MAKE_UTURN | Make a U-turn. |
ENTER_MOTORWAY | Take the motorway. |
ENTER_FREEWAY | Take the freeway. |
ENTER_HIGHWAY | Take the highway. |
TAKE_EXIT | Take the exit. |
MOTORWAY_EXIT_LEFT | Take the left exit. |
MOTORWAY_EXIT_RIGHT | Take the right exit. |
TAKE_FERRY | Take the ferry. |
ROUNDABOUT_CROSS | Cross the roundabout. |
ROUNDABOUT_RIGHT | At the roundabout take the exit on the right. |
ROUNDABOUT_LEFT | At the roundabout take the exit on the left. |
ROUNDABOUT_BACK | Go around the roundabout. |
TRY_MAKE_UTURN | Try to make a U-turn. |
FOLLOW | Follow. |
SWITCH_PARALLEL_ROAD | Switch to the parallel road. |
SWITCH_MAIN_ROAD | Switch to the main road. |
ENTRANCE_RAMP | Take the ramp. |
WAYPOINT_LEFT | You have reached the waypoint. It is on the left. |
WAYPOINT_RIGHT | You have reached the waypoint. It is on the right. |
WAYPOINT_REACHED | You have reached the waypoint. |
Structure of the instruction
object
Guidance instruction deprecation policy
As part of the continuous improvement of the Routing API, we also extend our guidance instructions with new features.
In many cases, this requires the introduction of new maneuver codes for new types of instructions. Hence we cannot guarantee the same deprecation policy for guidance instructions as compared to the rest of the Routing API.
In particular, clients are expected to be forward compatible, and we reserve the right to extend all enums defined below with new values. This includes completely new maneuver codes for new types of instructions.
At the same time we reserve the right to retire enum values for instructions that are superseded by their improved counterparts no longer generated by the internal Guidance component. The same rules for forward-/backward-compatibility apply to fields for guidance instructions.
For the retirement of instructions that are no longer relevant, we give a deprecation period of 4 months. After this period we reserve the right to remove deprecated values at our convenience.
JSON field | Description |
---|---|
| The distance from the start of the route to the point of the instruction. |
| The estimated travel time up to the point corresponding to routeOffsetInMeters . |
| Location of the maneuver. Example: A location of the maneuver
|
| The index of the
|
| The type of instruction, e.g., a turn or a change of road form.
|
| This lists the road number of the next significant road segment after
the maneuver, or of the road that has to be followed. Aggregate
|
| A string telling the number(s) of a highway exit taken by the current maneuver. If an exit has multiple exit numbers, numbers will be separated by "," and possibly aggregated by "-", e.g., "10, 13-15". |
| The street name of the next significant road segment after the maneuver, or of the street that should be followed. |
| The text on a signpost which is most relevant to the maneuver, or to the direction that should be followed. |
| The 3-character ISO 3166-1 alpha-3 country code. |
| A subdivision (e.g., state) of the country, represented by the second part of an ISO 3166-2 code. This is only available for some countries like the US, Canada, and Mexico. |
| The type of the junction where the maneuver takes place. For larger
roundabouts, two separate instructions are generated for entering and
leaving the roundabout.
|
| Indicates the direction of an instruction. If
If
|
| This indicates which exit to take at a roundabout. |
| It is possible to optionally combine the instruction with the next one.
This can be used to build messages like "Turn left and then turn right".
|
| Indicates left-hand vs. right-hand side driving at the point of the
maneuver.
|
| A code identifying the maneuver (e.g., "Turn right"). See the following Maneuver codes section. |
| A human-readable message for the maneuver. |
| A human-readable message for the maneuver combined with the message from the next instruction. See the following example of a combined message section. |
Example of a combined message
Sometimes it is possible to combine two successive instructions into a single instruction making it easier to follow. When this is the case the possibleCombineWithNext
flag will be true
. For example:
10. Turn left onto Einsteinweg/A10/E22 towards Ring Amsterdam11. Follow Einsteinweg/A10/E22 towards Ring Amsterdam
The possibleCombineWithNext
flag on instruction 10 is true
. This indicates to the clients of coded guidance that it can be combined with instruction 11. The instructions will be combined automatically for clients requesting human-readable guidance. The combinedMessage
field contains the combined message:
Turn left onto Einsteinweg/A10/E22 towards Ring Amsterdam then follow Einsteinweg/A10/E22 towards Ring Amsterdam.
Tagged messages
A human-readable message is built up from repeatable identified elements. These are tagged to allow client applications to format them correctly. The following message components are tagged when instructionsType=tagged
:
Message component | Tag |
---|---|
Street or road name | street |
Road number | roadNumber |
Signpost text | signpostText |
Exit number - motorway | exitNumber |
Exit number - roundabout | roundaboutExitNumber |
Examples of tagged messages
Turn left message
Turn left onto <roadNumber>A4</roadNumber>/<roadNumber>E19</roadNumber> towards <signpostText>Den Haag</signpostText>
Take exit message
Take exit no. <exitNumber>1</exitNumber> onto <street>Anderlechtlaan</street> towards <signpostText>Amsterdam-Sloten</signpostText>
Follow message
Follow <street>Rijksweg A9</street>/<roadNumber>A9</roadNumber> towards <signpostText>Amstelveen</signpostText>
Supported languages
Language name | Language tag |
---|---|
Afrikaans (South Africa) | af-ZA |
Arabic | ar |
Bulgarian | bg-BG |
Chinese (Taiwan) | zh-TW |
Czech | cs-CZ |
Danish | da-DK |
Dutch | nl-NL |
English (Great Britain) | en-GB |
English (USA) | en-US |
Finnish | fi-FI |
French | fr-FR |
German | de-DE |
Greek | el-GR |
Hungarian | hu-HU |
Indonesian | id-ID |
Italian | it-IT |
Korean | ko-KR |
Lithuanian | lt-LT |
Malay | ms-MY |
Norwegian | nb-NO |
Polish | pl-PL |
Portuguese (Brazil) | pt-BR |
Portuguese (Portugal) | pt-PT |
Russian | ru-RU |
Slovak | sk-SK |
Slovenian | sl-SI |
Spanish (Castilian) | es-ES |
Spanish (Mexico) | es-MX |
Swedish | sv-SE |
Thai | th-TH |
Turkish | tr-TR |
The following language code abbreviations are also supported:
Language name | Language tag | Inferred language tag |
---|---|---|
English | en | en-GB |
French | fr | fr-FR |
German | de | de-DE |
Italian | it | it-IT |
Dutch | nl | nl-NL |
Portuguese | pt | pt-PT |
Spanish | es | es-ES |
Lane section information
The following table describes the possible values of the directions
and follow
fields in the lanes
section.
Directions value |
---|
STRAIGHT |
SLIGHT_RIGHT |
RIGHT |
SHARP_RIGHT |
RIGHT_U_TURN |
SLIGHT_LEFT |
LEFT |
SHARP_LEFT |
LEFT_U_TURN |
The following table describes the possible values of the laneSeparators
field in the lanes
section.
Lane separators value | Description |
---|---|
UNKNOWN | No information. |
NO_MARKING | No marking. |
LONG_DASHED | Long dashed line. |
DOUBLE_SOLID | Double solid line. |
SINGLE_SOLID | Single solid line. |
SOLID_DASHED | Solid line and dashed line in parallel as seen from left to right. |
DASHED_SOLID | Dashed line and solid line in parallel as seen from left to right. |
SHORT_DASHED | Short dashed line. |
SHADED_AREA_MARKING | Shaded area marking. |
DASHED_BLOCKS | Dashed blocks. |
DOUBLE_DASHED | Double dashed line. |
CROSSING_ALERT | Marking for crossing which looks like a zigzag line. |
PHYSICAL_DIVIDER | Physical divider. |
Extra maneuver codes for instruction announcement points
The following table describes the additional possible values of the maneuver
instruction announcement point field. Please note that the Guidance instruction deprecation policy still applies.
Maneuver value | Example translation |
---|---|
AHEAD_KEEP_RIGHT | Ahead, keep right. |
AHEAD_RIGHT_TURN | Right-turn ahead. |
AHEAD_KEEP_LEFT | Ahead, keep left. |
AHEAD_LEFT_TURN | Left-turn ahead. |
AHEAD_UTURN | U-turn ahead. |
AHEAD_EXIT | Exit ahead. |
AHEAD_EXIT_RIGHT | Exit right ahead. |
AHEAD_EXIT_LEFT | Exit left ahead. |
AHEAD_TAKE_FERRY | Ahead, take the ferry. |
WAYPOINT_APPROACH | Approaching waypoint. |