Routing API Developer's Guide

Requesting Multiple Routes With Labels

In order to differentiate the routes when requesting for alternatives, Routing API provides labels. Enable the route attribute labels to obtain a response with a set of labels for the requested routes.

The following example shows a request with labels, where 2 alternatives are requested.
https://route.ls.hereapi.com/routing/7.2/calculateroute.json
?apiKey={YOUR_API_KEY}
&waypoint0=geo!52.513343,13.356054
&waypoint1=geo!50.088478,14.432714
&mode=fastest;car;traffic:disabled
&alternatives=2
&routeattributes=labels
Note: This example uses a HERE API Key to authenticate your request. For information on other possible options, see Authentication Guide. For examples of how to use the other authentication options with the Routing API, see Authentication Examples.
Figure 1. The route response for the request with labels in the example above
The labels can be displayed in an Overview panel. An example of such panel is shown below.
Figure 2. Example of response with alternatives, where label information is shown in the Overview panel
In the JSON response, the label information is serialized for each route, as follows:
route:[
  {
    waypoint: [...],
    mode: {...},
    shape: [...],
    leg: [...],
    summary: {...},
    maneuverGroup: [...],
    label: [
      "A2",
      "A1"
    ]
  }
]