Truck Routing enterprise only
Version 2 of the Optimized Route endpoint supports truck routing to help you create routes that account for truck-specific constraints such as vehicle dimensions, weight restrictions, and road access limitations.
This page contains supplemental information pertaining only to using truck routing with v2 of the Optimized Route endpoint. See the Optimized Route POST documentation for full information on available request parameters and response fields.
Contact us if you would like to use this feature.
Resource URL
POST https://www.mapquestapi.com/directions/v2/optimizedroute
Body Parameters
Please refer to the normal Route documentation for the full list of acceptable body parameters.
Options
The following options are available when using truck routing.
| Parameter | Description | Required |
|---|---|---|
| routeType | Set to "TRUCK" to enable truck routing mode | Yes (when using truck routing) |
| avoids | An array of direction types to avoid. Each value is a type of direction that will be avoided. If it cannot be avoided, a warning will be returned indicating that the said type exists in the maneuvers. Available choices:
| No |
| vehicleAxleWeight | Specifies the weight per axle configuration for the vehicle. If a single weight value is provided, it represents the heaviest weight per axle. If multiple weights are provided, they should be passed using axle type as an integer with their respective weights in the format: "axleType:weight,axleType:weight" (e.g., "2:18000,5:36000"), which is treated as a group of axles with their specific weights.Axle type integer representations:
| No |
| vehicleLength | Vehicle length specified in inches. Values are converted to centimeters (inches × 2.54) for routing calculations. Range: 0 to 30,000 cm (after conversion). | No |
| vehicleWidth | Vehicle width specified in inches. Values are converted to centimeters (inches × 2.54) for routing calculations. Range: 0 to 5,000 cm (after conversion). | No |
| vehicleHeight | Vehicle height specified in inches. Values are converted to centimeters (inches × 2.54) for routing calculations. Range: 0 to 5,000 cm (after conversion). | No |
| vehicleWeightTotal | Gross vehicle weight, including the combined weight of the truck, trailers, payloads, etc., specified in pounds (lbs). Values are converted to kilograms (lbs × 0.453592) for routing calculations. Must be greater than or equal to 0 kg (after conversion). | No |
| vehicleTrailerCount | The number of trailers attached to the vehicle. If included, must be an integer from 1 to 4. Value meanings:
| No |
| hazardousGoods | An array of hazardous material types that the truck is carrying. When specified, roads prohibited for shipment of dangerous materials are excluded from the route. Valid values:
| No |
Please refer to the normal Route documentation for the full list of acceptable Advanced Parameters
Response
Route Response Fields
Refer to the V2 Optimized Route Response Fields for a full list of available fields. The following route response fields are only those available when using truck routing in v2 of this route.
| Response Field | Description |
|---|---|
| routeWarnings | An array of warning strings that indicate when an avoid parameter specified in the request could not be avoided in the calculated route. For example, if "difficult turns" was specified in the avoids array but the route still contains difficult turns, the response will include "warnAvoidDifficultTurns" in the routeWarnings array. Similarly, if "u-turns" was specified but couldn't be avoided, it will include "warnAvoidUTurns". |
See the Status Codes page for more details on our status codes and error messages.
Example Request
Note
The following example requests demonstrate various truck routing scenarios.
POST https://www.mapquestapi.com/directions/v2/optimizedroute?key=KEY
Example Request Body
{
"locations": [
"Seattle, WA",
"Kirkland, WA"
],
"options": {
"routeType": "TRUCK",
"avoids": [
"u-turns",
"difficult turns"
],
"vehicleAxleWeight": "2:18000,5:36000",
"vehicleLength": 480,
"vehicleWidth": 96,
"vehicleHeight": 144,
"vehicleWeightTotal": 80000,
"vehicleTrailerCount": 2,
"hazardousGoods": [
"flammable",
"combustible"
]
}
}Example Response
{
"route": {
"sessionId": "AJoA_v___wsAAQDHAAAAeNpjOM7AVcfGwLC_l4Ehj5GB4QsDA8NhFgYGJh4gg5EJSLBnpBalWiXn3ml-LwXkMhTx_tjLAZTNncWkqfH9ZiKMNgfSKUCaAQuAmZG4NtwQxP___389yIbl3yU0U9Y8T4TRC4H0AiDNgAMsSUx6Ph9IN0x06WDQ4GJo5PAAchgYHRiCDAElXjKqn81fxg:truck",
"realTime": 1815,
"distance": 11.6227,
"time": 1281,
"formattedTime": "00:21:21",
"hasHighway": true,
"hasTollRoad": true,
"hasBridge": true,
"hasSeasonalClosure": false,
"hasTunnel": true,
"hasFerry": false,
"hasUnpaved": false,
"hasTimedRestriction": false,
"hasCountryCross": false,
"hasUTurn": false,
"hasDifficultTurn": false,
"legs": [
{
"index": 0,
"hasTollRoad": true,
"hasHighway": true,
"hasBridge": true,
"hasUnpaved": false,
"hasTunnel": true,
"hasSeasonalClosure": false,
"hasFerry": false,
"hasCountryCross": false,
"hasTimedRestriction": false,
"hasUTurn": false,
"hasDifficultTurn": false,
"distance": 11.6227,
"time": 1815,
"formattedTime": "00:30:15",
"origIndex": 0,
"origNarrative": "",
"destIndex": 0,
"destNarrative": "",
"maneuvers": [
{
"index": 0,
"distance": 0.1361,
"narrative": "Head toward 5th Ave on James St. Go for 0.1 mi.",
"time": 104,
"direction": 3,
"directionName": "Northeast",
"signs": [],
"maneuverNotes": [],
"formattedTime": "00:01:44",
"transportMode": "truck",
"startPoint": {
"lat": 47.603575,
"lng": -122.329455
},
"turnType": 0,
"attributes": 0,
"iconUrl": "",
"streets": [
"James St"
],
"mapUrl": "https://www.mapquestapi.com/staticmap/v5/map?key=undefined&size=225,160&locations=47.603575,-122.329455|marker-1||47.604620000000004,-122.32698999999998|marker-2||¢er=47.6040975,-122.32822249999998&defaultMarker=none&zoom=15&session=AJoA_v___wsAAQDHAAAAeNpjOM7AVcfGwLC_l4Ehj5GB4QsDA8NhFgYGJh4gg5EJSLBnpBalWiXn3ml-LwXkMhTx_tjLAZTNncWkqfH9ZiKMNgfSKUCaAQuAmZG4NtwQxP___389yIbl3yU0U9Y8T4TRC4H0AiDNgAMsSUx6Ph9IN0x06WDQ4GJo5PAAchgYHRiCDAElXjKqn81fxg:truck"
},
{
"index": 1,
"distance": 0.0578,
"narrative": "Turn left onto 7th Ave. Go for 305 ft.",
"time": 28,
"direction": 2,
"directionName": "Northwest",
"signs": [],
"maneuverNotes": [],
"formattedTime": "00:00:28",
"transportMode": "truck",
"startPoint": {
"lat": 47.604620000000004,
"lng": -122.32698999999998
},
"turnType": 6,
"attributes": 0,
"iconUrl": "",
"streets": [
"7th Ave"
],
"mapUrl": "https://www.mapquestapi.com/staticmap/v5/map?key=undefined&size=225,160&locations=47.604620000000004,-122.32698999999998|marker-2||47.605340000000005,-122.32761999999998|marker-3||¢er=47.604980000000005,-122.32730499999998&defaultMarker=none&zoom=16&session=AJoA_v___wsAAQDHAAAAeNpjOM7AVcfGwLC_l4Ehj5GB4QsDA8NhFgYGJh4gg5EJSLBnpBalWiXn3ml-LwXkMhTx_tjLAZTNncWkqfH9ZiKMNgfSKUCaAQuAmZG4NtwQxP___389yIbl3yU0U9Y8T4TRC4H0AiDNgAMsSUx6Ph9IN0x06WDQ4GJo5PAAchgYHRiCDAElXjKqn81fxg:truck"
},
{
"index": 2,
"distance": 2.419,
"narrative": "Turn slightly left and take ramp onto I-5 N toward Vancouver BC. Go for 2.4 mi.",
"time": 463,
"direction": 1,
"directionName": "North",
"signs": [],
"maneuverNotes": [],
"formattedTime": "00:07:43",
"transportMode": "truck",
"startPoint": {
"lat": 47.605340000000005,
"lng": -122.32761999999998
},
"turnType": 13,
"attributes": 0,
"iconUrl": "",
"streets": [
"I-5"
],
"mapUrl": "https://www.mapquestapi.com/staticmap/v5/map?key=undefined&size=225,160&locations=47.605340000000005,-122.32761999999998|marker-3||47.63864000000003,-122.32267999999998|marker-4||¢er=47.62199000000002,-122.32514999999998&defaultMarker=none&zoom=11&session=AJoA_v___wsAAQDHAAAAeNpjOM7AVcfGwLC_l4Ehj5GB4QsDA8NhFgYGJh4gg5EJSLBnpBalWiXn3ml-LwXkMhTx_tjLAZTNncWkqfH9ZiKMNgfSKUCaAQuAmZG4NtwQxP___389yIbl3yU0U9Y8T4TRC4H0AiDNgAMsSUx6Ph9IN0x06WDQ4GJo5PAAchgYHRiCDAElXjKqn81fxg:truck"
},
{
"index": 3,
"distance": 5.8744,
"narrative": "Take exit 168B toward WA-520/Bellevue/Kirkland onto WA-520 E. Go for 5.9 mi.",
"time": 563,
"direction": 8,
"directionName": "East",
"signs": [],
"maneuverNotes": [],
"formattedTime": "00:09:23",
"transportMode": "truck",
"startPoint": {
"lat": 47.63864000000003,
"lng": -122.32267999999998
},
"turnType": 14,
"attributes": 0,
"iconUrl": "",
"streets": [
"WA-520",
"Evergreen Point Floating Brg"
],
"mapUrl": "https://www.mapquestapi.com/staticmap/v5/map?key=undefined&size=225,160&locations=47.63864000000003,-122.32267999999998|marker-4||47.642920000000046,-122.20688000000001|marker-5||¢er=47.640780000000035,-122.26478&defaultMarker=none&zoom=10&session=AJoA_v___wsAAQDHAAAAeNpjOM7AVcfGwLC_l4Ehj5GB4QsDA8NhFgYGJh4gg5EJSLBnpBalWiXn3ml-LwXkMhTx_tjLAZTNncWkqfH9ZiKMNgfSKUCaAQuAmZG4NtwQxP___389yIbl3yU0U9Y8T4TRC4H0AiDNgAMsSUx6Ph9IN0x06WDQ4GJo5PAAchgYHRiCDAElXjKqn81fxg:truck"
},
{
"index": 4,
"distance": 0.2684,
"narrative": "Take the exit toward Lk Washington Blvd NE/Bellevue Way/Lk Washington/Blvd NE. Go for 0.3 mi.",
"time": 81,
"direction": 8,
"directionName": "East",
"signs": [],
"maneuverNotes": [],
"formattedTime": "00:01:21",
"transportMode": "truck",
"startPoint": {
"lat": 47.642920000000046,
"lng": -122.20688000000001
},
"turnType": 14,
"attributes": 0,
"iconUrl": "",
"streets": [],
"mapUrl": "https://www.mapquestapi.com/staticmap/v5/map?key=undefined&size=225,160&locations=47.642920000000046,-122.20688000000001|marker-5||47.64202000000005,-122.20134|marker-6||¢er=47.642470000000046,-122.20411000000001&defaultMarker=none&zoom=14&session=AJoA_v___wsAAQDHAAAAeNpjOM7AVcfGwLC_l4Ehj5GB4QsDA8NhFgYGJh4gg5EJSLBnpBalWiXn3ml-LwXkMhTx_tjLAZTNncWkqfH9ZiKMNgfSKUCaAQuAmZG4NtwQxP___389yIbl3yU0U9Y8T4TRC4H0AiDNgAMsSUx6Ph9IN0x06WDQ4GJo5PAAchgYHRiCDAElXjKqn81fxg:truck"
},
{
"index": 5,
"distance": 0.1305,
"narrative": "Turn left onto Bellevue Way NE. Go for 0.1 mi.",
"time": 18,
"direction": 1,
"directionName": "North",
"signs": [],
"maneuverNotes": [],
"formattedTime": "00:00:18",
"transportMode": "truck",
"startPoint": {
"lat": 47.64202000000005,
"lng": -122.20134
},
"turnType": 6,
"attributes": 0,
"iconUrl": "",
"streets": [
"Bellevue Way NE"
],
"mapUrl": "https://www.mapquestapi.com/staticmap/v5/map?key=undefined&size=225,160&locations=47.64202000000005,-122.20134|marker-6||47.64388000000005,-122.20170999999999|marker-7||¢er=47.642950000000056,-122.201525&defaultMarker=none&zoom=15&session=AJoA_v___wsAAQDHAAAAeNpjOM7AVcfGwLC_l4Ehj5GB4QsDA8NhFgYGJh4gg5EJSLBnpBalWiXn3ml-LwXkMhTx_tjLAZTNncWkqfH9ZiKMNgfSKUCaAQuAmZG4NtwQxP___389yIbl3yU0U9Y8T4TRC4H0AiDNgAMsSUx6Ph9IN0x06WDQ4GJo5PAAchgYHRiCDAElXjKqn81fxg:truck"
},
{
"index": 6,
"distance": 1.6429,
"narrative": "Continue on Lake Washington Blvd NE. Go for 1.6 mi.",
"time": 228,
"direction": 1,
"directionName": "North",
"signs": [],
"maneuverNotes": [],
"formattedTime": "00:03:48",
"transportMode": "truck",
"startPoint": {
"lat": 47.64388000000005,
"lng": -122.20170999999999
},
"turnType": 0,
"attributes": 0,
"iconUrl": "",
"streets": [
"Lake Washington Blvd NE"
],
"mapUrl": "https://www.mapquestapi.com/staticmap/v5/map?key=undefined&size=225,160&locations=47.64388000000005,-122.20170999999999|marker-7||47.66713000000006,-122.20679000000007|marker-8||¢er=47.655505000000055,-122.20425000000003&defaultMarker=none&zoom=12&session=AJoA_v___wsAAQDHAAAAeNpjOM7AVcfGwLC_l4Ehj5GB4QsDA8NhFgYGJh4gg5EJSLBnpBalWiXn3ml-LwXkMhTx_tjLAZTNncWkqfH9ZiKMNgfSKUCaAQuAmZG4NtwQxP___389yIbl3yU0U9Y8T4TRC4H0AiDNgAMsSUx6Ph9IN0x06WDQ4GJo5PAAchgYHRiCDAElXjKqn81fxg:truck"
},
{
"index": 7,
"distance": 0.6754,
"narrative": "Continue on Lake St S. Go for 0.7 mi.",
"time": 147,
"direction": 1,
"directionName": "North",
"signs": [],
"maneuverNotes": [],
"formattedTime": "00:02:27",
"transportMode": "truck",
"startPoint": {
"lat": 47.66713000000006,
"lng": -122.20679000000007
},
"turnType": 0,
"attributes": 0,
"iconUrl": "",
"streets": [
"Lake St S",
"Lake St"
],
"mapUrl": "https://www.mapquestapi.com/staticmap/v5/map?key=undefined&size=225,160&locations=47.66713000000006,-122.20679000000007|marker-8||47.67660000000005,-122.20711000000009|marker-9||¢er=47.671865000000054,-122.20695000000008&defaultMarker=none&zoom=13&session=AJoA_v___wsAAQDHAAAAeNpjOM7AVcfGwLC_l4Ehj5GB4QsDA8NhFgYGJh4gg5EJSLBnpBalWiXn3ml-LwXkMhTx_tjLAZTNncWkqfH9ZiKMNgfSKUCaAQuAmZG4NtwQxP___389yIbl3yU0U9Y8T4TRC4H0AiDNgAMsSUx6Ph9IN0x06WDQ4GJo5PAAchgYHRiCDAElXjKqn81fxg:truck"
},
{
"index": 8,
"distance": 0.1777,
"narrative": "Turn right onto Central Way. Go for 0.2 mi.",
"time": 81,
"direction": 8,
"directionName": "East",
"signs": [],
"maneuverNotes": [],
"formattedTime": "00:01:21",
"transportMode": "truck",
"startPoint": {
"lat": 47.67660000000005,
"lng": -122.20711000000009
},
"turnType": 2,
"attributes": 0,
"iconUrl": "",
"streets": [
"Central Way"
],
"mapUrl": "https://www.mapquestapi.com/staticmap/v5/map?key=undefined&size=225,160&locations=47.67660000000005,-122.20711000000009|marker-9||47.677390000000045,-122.20354000000007|marker-10||¢er=47.67699500000005,-122.20532500000007&defaultMarker=none&zoom=15&session=AJoA_v___wsAAQDHAAAAeNpjOM7AVcfGwLC_l4Ehj5GB4QsDA8NhFgYGJh4gg5EJSLBnpBalWiXn3ml-LwXkMhTx_tjLAZTNncWkqfH9ZiKMNgfSKUCaAQuAmZG4NtwQxP___389yIbl3yU0U9Y8T4TRC4H0AiDNgAMsSUx6Ph9IN0x06WDQ4GJo5PAAchgYHRiCDAElXjKqn81fxg:truck"
},
{
"index": 9,
"distance": 0.1094,
"narrative": "Turn left onto 3rd St. Go for 0.1 mi.",
"time": 74,
"direction": 1,
"directionName": "North",
"signs": [],
"maneuverNotes": [],
"formattedTime": "00:01:14",
"transportMode": "truck",
"startPoint": {
"lat": 47.677390000000045,
"lng": -122.20354000000007
},
"turnType": 6,
"attributes": 0,
"iconUrl": "",
"streets": [
"3rd St"
],
"mapUrl": "https://www.mapquestapi.com/staticmap/v5/map?key=undefined&size=225,160&locations=47.677390000000045,-122.20354000000007|marker-10||47.678930000000044,-122.20381000000008|marker-11||¢er=47.67816000000005,-122.20367500000008&defaultMarker=none&zoom=16&session=AJoA_v___wsAAQDHAAAAeNpjOM7AVcfGwLC_l4Ehj5GB4QsDA8NhFgYGJh4gg5EJSLBnpBalWiXn3ml-LwXkMhTx_tjLAZTNncWkqfH9ZiKMNgfSKUCaAQuAmZG4NtwQxP___389yIbl3yU0U9Y8T4TRC4H0AiDNgAMsSUx6Ph9IN0x06WDQ4GJo5PAAchgYHRiCDAElXjKqn81fxg:truck"
},
{
"index": 10,
"distance": 0.1311,
"narrative": "Turn left onto 5th Ave. Go for 0.1 mi.",
"time": 28,
"direction": 7,
"directionName": "West",
"signs": [],
"maneuverNotes": [],
"formattedTime": "00:00:28",
"transportMode": "truck",
"startPoint": {
"lat": 47.678930000000044,
"lng": -122.20381000000008
},
"turnType": 6,
"attributes": 0,
"iconUrl": "",
"streets": [
"5th Ave"
],
"mapUrl": "https://www.mapquestapi.com/staticmap/v5/map?key=undefined&size=225,160&locations=47.678930000000044,-122.20381000000008|marker-11||47.67887500000004,-122.20660100000008|marker-12||¢er=47.67890250000004,-122.20520550000008&defaultMarker=none&zoom=15&session=AJoA_v___wsAAQDHAAAAeNpjOM7AVcfGwLC_l4Ehj5GB4QsDA8NhFgYGJh4gg5EJSLBnpBalWiXn3ml-LwXkMhTx_tjLAZTNncWkqfH9ZiKMNgfSKUCaAQuAmZG4NtwQxP___389yIbl3yU0U9Y8T4TRC4H0AiDNgAMsSUx6Ph9IN0x06WDQ4GJo5PAAchgYHRiCDAElXjKqn81fxg:truck"
},
{
"index": 11,
"distance": 0,
"narrative": "Arrive at 5th Ave.",
"time": 0,
"direction": 0,
"directionName": "None",
"signs": [],
"maneuverNotes": [],
"formattedTime": "00:00:00",
"transportMode": "truck",
"startPoint": {
"lat": 47.67887500000004,
"lng": -122.20660100000008
},
"turnType": 0,
"attributes": 0,
"iconUrl": "",
"streets": []
}
]
}
],
"options": {
"routeType": "TRUCK",
"avoids": [
"u-turns",
"difficult turns"
],
"vehicleAxleWeight": "2:18000,5:36000",
"vehicleLength": 480,
"vehicleWidth": 96,
"vehicleHeight": 144,
"vehicleWeightTotal": 80000,
"vehicleTrailerCount": 2,
"hazardousGoods": [
"flammable",
"combustible"
],
"narrativeType": "text",
"enhancedNarrative": false,
"walkingSpeed": -1,
"highwayEfficiency": 22,
"generalize": -1,
"shapeFormat": "raw",
"unit": "M",
"locale": "en_US",
"useTraffic": false,
"timeType": 0,
"dateType": 0,
"doReverseGeocode": true,
"manMaps": true,
"tollCost": false,
"sideOfStreetDisplay": true
},
"boundingBox": {
"ul": {
"lat": 47.678930000000044,
"lng": -122.33102
},
"lr": {
"lat": 47.603575,
"lng": -122.20134
}
},
"routeWarnings": [],
"name": "WA-520 and I-5",
"locations": [
{
"street": "",
"adminArea6": "",
"adminArea6Type": "Neighborhood",
"adminArea5": "Seattle",
"adminArea5Type": "City",
"adminArea4": "King",
"adminArea4Type": "County",
"adminArea3": "WA",
"adminArea3Type": "State",
"adminArea1": "US",
"adminArea1Type": "Country",
"postalCode": "",
"geocodeQualityCode": "A5XAX",
"geocodeQuality": "CITY",
"dragPoint": false,
"sideOfStreet": "N",
"linkId": "0",
"unknownInput": "",
"type": "s",
"latLng": {
"lat": 47.60357,
"lng": -122.32945
},
"displayLatLng": {
"lat": 47.60357,
"lng": -122.32945
},
"mapUrl": ""
},
{
"street": "",
"adminArea6": "",
"adminArea6Type": "Neighborhood",
"adminArea5": "Kirkland",
"adminArea5Type": "City",
"adminArea4": "King",
"adminArea4Type": "County",
"adminArea3": "WA",
"adminArea3Type": "State",
"adminArea1": "US",
"adminArea1Type": "Country",
"postalCode": "",
"geocodeQualityCode": "A5XAX",
"geocodeQuality": "CITY",
"dragPoint": false,
"sideOfStreet": "N",
"linkId": "0",
"unknownInput": "",
"type": "s",
"latLng": {
"lat": 47.67887,
"lng": -122.2066
},
"displayLatLng": {
"lat": 47.67887,
"lng": -122.2066
},
"mapUrl": ""
}
],
"locationSequence": [
0,
1
]
},
"info": {
"statuscode": 0,
"copyright": {
"text": "© 2025 MapQuest, Inc.",
"imageUrl": "http://api.mqcdn.com/res/mqlogo.gif",
"imageAltText": "© 2025 MapQuest, Inc."
},
"messages": []
}
}