Route summary
Section summary provides information such as length, duration, consumption, tolls, etc. for a specific route section. For details related to all the available information in a section summary, see the Routes API Response Schema in API Reference.
A section summary could be requested using return=summary, return=travelSummary, or both return=summary,travelSummary.
summaryprovides summary information for the entire section including any pre-actions and post-actions.travelSummaryprovides summary information for only the travel portion of the section; pre-actions and post-actions are excluded.
This example returns the section summary information in the route response. Additionally, it shows the differences in summary and travelSummary due to the wait post-action at the end of the first section.
curl -gX GET 'https://router.hereapi.com/v8/routes?'\
'origin=52.51375,13.42462&'\
'destination=52.52332,13.42800&'\
'via=52.52426,13.43000!stopDuration=120&'\
'return=polyline,summary,travelSummary&'\
'transportMode=car&'\
'apiKey=YOUR_API_KEY'{
"routes": [
{
"id": "ceab8139-1857-48d3-9f04-40e1c993c8e1",
"sections": [
{
"id": "3542b673-a1ae-4363-81cf-8326e6b10307",
...,
"postActions": [
{
"action": "wait",
"duration": 120
}
],
...,
"summary": {
"duration": 294,
"length": 1281,
"baseDuration": 256
},
"travelSummary": {
"duration": 174,
"length": 1281,
"baseDuration": 136
},
"polyline": "...",
"transport": {
"mode": "car"
}
},
{
"id": "43d61f69-5591-4dd6-81e1-ca4c76c91c27",
...
}
]
}
]
}Next steps
- See Duration, baseDuration, typicalDuration, mlDuration to learn about the different types of duration information you can get for route sections.
- See Get total toll cost excluding vignette price to learn about calculating the cost of a route.
- See Calculate fuel consumption and CO2 emissions per section to learn how to get more details for ICE (internal combustion engine) vehicles.
Updated 9 days ago