Calculate consumption per section
This request returns the energy consumption by an electric vehicle for the section in the summary.
curl -gX GET 'https://router.hereapi.com/v8/routes?'\
'origin=52.533864,13.357444&'\
'transportMode=car&'\
'destination=52.512139,13.438468&'\
'return=summary&'\
'ev[freeFlowSpeedTable]=10,0.130,20,0.132,30,0.136,40,0.142,50,0.151,60,0.161,70,0.176,80,0.194,90,0.214,100,0.237,110,0.264,120,0.290,130,0.321,140,0.354,150,0.389,160,0.426,170,0.466,180,0.509,190,0.554,200,0.601&'\
'ev[trafficSpeedTable]=0,0.349,27,0.319,45,0.329,60,0.266,75,0.287,90,0.318,100,0.33,110,0.335,120,0.35,130,0.36,250,0.36&'\
'ev[auxiliaryConsumption]=1.8&'\
'ev[ascent]=9&'\
'ev[descent]=4.3&'\
'apiKey=YOUR_API_KEY'The response specifies the energy consumption in kilowatt-hours (kWh).
{
"routes": [
{
"id": "441cb1bb-02c0-4d56-a579-f199506fc781",
"sections": [
{
...,
"summary": {
"duration": 1284,
"length": 8191,
"consumption": 3.856,
"baseDuration": 993
},
"transport": {
"mode": "car"
}
}
]
}
]
}Updated 9 days ago