关于HERE TCE tollcost.json与Fleet calculateroute.json路费计算不一致的问询
Great question—let’s break down why these two APIs are giving you such disparate outcomes, even with the same underlying route coordinates:
1. Incomplete route input for the TCE API
Your TCE tollcost.json request only passes two link IDs (-1201736915;-1126692456) in the route parameter, but this API requires a full sequence of link IDs that make up the entire route to accurately calculate tolls. Unlike the Fleet API, which generates a complete path from your start/end waypoints automatically, the TCE API doesn’t infer middle route segments—it needs explicit data for every link in the journey. Without that full chain, it can’t identify toll roads along the way, hence the empty costsByCountry array.
2. Core functionality differences between the APIs
- The Fleet API’s
calculateroute.jsonis routing-first: it calculates the optimal path between your waypoints first, then layers on toll cost calculations using that complete path data. - The TCE API’s
tollcost.jsonis toll-estimation-first, built to work with pre-defined, fully specified routes (via link IDs or polylines). It doesn’t handle route generation itself—so if you don’t feed it the full route, it can’t compute tolls.
3. Gaps in parameter context
While both requests use tollVehicleType=3, the Fleet API includes critical extra context with mode=fastest;truck;traffic:disabled—this explicitly defines the vehicle as a truck and sets routing preferences that influence which toll roads are considered. The TCE request lacks this explicit vehicle mode context, which might lead it to default to a vehicle profile that doesn’t trigger the same toll calculations (even with tollVehicleType set, routing context can change how tolls are computed).
Fixes to try
- Pass a full link ID sequence to TCE: First, retrieve the complete list of link IDs for your route using the Fleet API (check the response for link-related data), then input that full sequence into the TCE
routeparameter. - Add vehicle mode context to TCE: Include parameters that mirror the Fleet API’s vehicle settings (like truck-specific attributes, if supported by TCE) to ensure consistent toll calculation logic.
- Verify regional support: Confirm that your route’s region is fully supported by the TCE API—some toll data may be more comprehensively covered in the Fleet API’s routing pipeline.
内容的提问来源于stack exchange,提问作者Andreas S

