Directions API
What is the Directions API?
Create custom routes with the MapQuest Directions API -- whether it’s going from point A to point B, or adding points C and D in between, Directions API will get you there.
Get StartedWhat it can do for you
Route Options
Let your users customize fastest and shortest routes whether they’re driving, walking, or biking.
Traveling Salesman
Add up to 25 stops to find an optimized route to save drivers time and money.
Mileage Reimbursement
Drivers can create accurate routes to submit for reimbursement -- routes will even include toll road information.
Flexibility
Avoid unexpected roadwork or add a new location by dragging and finding alternate routes on the fly.
Key Features
Routing
Receive turn-by-turn directions from an origin point to a destination. Directions narrative includes road shields, turn direction, street names, and static maneuver maps.
Route Types
Calculate the fastest or shortest driving, pedestrian, bicycle or multimodal routes.
Route Options
Customize routes by avoiding ferries, highways, and toll roads. You can also add a boundary in which to contain routing options, and account for fuel efficiency.
Optimized Routing
Find the most efficient (fastest or shortest) route between up to 25 locations.
Route Matrix
Calculate time and distance from one location to a group of locations, or all locations in a group. A one-to-many route matrix can handle up to 100 locations, while an all-to-all request can handle up to 25.
Date and Time Routing
Take days and times into consideration when plotting a route, including HOV-specific lanes, timed turn restrictions and specific day-of-week closures.
Alternate Routes
Request multiple potential routes between an origin and destination -- you can even specify "acceptable time overages."
Drag Route
Drag a route to avoid unexpected traffic or road work, or add an additional location on the fly.
Estimated Fuel Usage
Calculate estimated fuel usage associated with a route.
How it Looks
{
"route": {
"hasTollRoad": false,
"computedWaypoints": [],
"fuelUsed": 0.23,
"hasUnpaved": false,
"hasHighway": false,
"realTime": 653,
"boundingBox": {
"ul": {
"lng": -77.089424,
"lat": 38.893276
},
"lr": {
"lng": -77.077087,
"lat": 38.848926
}
},
"distance": 3.693,
"time": 501,
"locationSequence": [
0,
1
],
"hasSeasonalClosure": false,
"sessionId": "55e60cd9-00b6-001a-02b7-20ac-00163e7dd551",
"locations": [
{
"latLng": {
"lng": -77.077959,
"lat": 38.893165
},
"adminArea4": "Arlington",
"adminArea5Type": "City",
"adminArea4Type": "County",
"adminArea5": "Arlington",
"street": "[1700 - 1720] Clarendon Blvd",
"adminArea1": "US",
"adminArea3": "VA",
"type": "s",
"displayLatLng": {
"lng": -77.077957,
"lat": 38.893165
},
"linkId": 13257655,
"postalCode": "22209-2713",
"sideOfStreet": "L",
"dragPoint": false,
"adminArea1Type": "Country",
"geocodeQuality": "STREET",
"geocodeQualityCode": "B1AAA",
"adminArea3Type": "State"
},
{
"latLng": {
"lng": -77.081229,
"lat": 38.848932
},
"adminArea4": "Arlington",
"adminArea5Type": "City",
"adminArea4Type": "County",
"adminArea5": "Arlington",
"street": "2400 S Glebe Rd",
"adminArea1": "US",
"adminArea3": "VA",
"type": "s",
"displayLatLng": {
"lng": -77.08123,
"lat": 38.84893
},
"linkId": 14874674,
"postalCode": "22206-2500",
"sideOfStreet": "R",
"dragPoint": false,
"adminArea1Type": "Country",
"geocodeQuality": "POINT",
"geocodeQualityCode": "P1AAA",
"adminArea3Type": "State"
}
],
"hasCountryCross": false,
"legs": [
{
"hasTollRoad": false,
"index": 0,
"roadGradeStrategy": [
[]
],
"hasHighway": false,
"hasUnpaved": false,
"distance": 3.693,
"time": 501,
"origIndex": 3,
"hasSeasonalClosure": false,
"origNarrative": "Go south on Arlington Blvd/US-50 W.",
"hasCountryCross": false,
"formattedTime": "00:08:21",
"destNarrative": "Proceed to 2400 S GLEBE RD.",
"destIndex": 5,
"maneuvers": [
{
"signs": [],
"index": 0,
"maneuverNotes": [],
"direction": 8,
"narrative": "Start out going east on Clarendon Blvd toward N Queen St.",
"iconUrl": "http://content.mapquest.com/mqsite/turnsigns/icon-dirs-start_sm.gif",
"distance": 0.031,
"time": 6,
"linkIds": [],
"streets": [
"Clarendon Blvd"
],
"attributes": 0,
"transportMode": "AUTO",
"formattedTime": "00:00:06",
"directionName": "East",
"mapUrl": "http://www.mapquestapi.com/staticmap/v4/getmap?key=KEY&type=map&size=225,160&pois=purple-1,38.893164999999996,-77.077957,0,0|purple-2,38.893276,-77.077407,0,0|¢er=38.8932205,-77.077682&zoom=15&rand=-1645843521&session=55e60cd9-00b6-001a-02b7-20ac-00163e7dd551",
"startPoint": {
"lng": -77.077957,
"lat": 38.893165
},
"turnType": 2
},
{
"signs": [],
"index": 1,
"maneuverNotes": [],
"direction": 4,
"narrative": "Turn right onto N Queen St.",
"iconUrl": "http://content.mapquest.com/mqsite/turnsigns/rs_right_sm.gif",
"distance": 0.168,
"time": 32,
"linkIds": [],
"streets": [
"N Queen St"
],
"attributes": 0,
"transportMode": "AUTO",
"formattedTime": "00:00:32",
"directionName": "South",
"mapUrl": "http://www.mapquestapi.com/staticmap/v4/getmap?key=KEY&type=map&size=225,160&pois=purple-2,38.893276,-77.077407,0,0|purple-3,38.890857,-77.07708699999999,0,0|¢er=38.8920665,-77.077247&zoom=12&rand=-1645843521&session=55e60cd9-00b6-001a-02b7-20ac-00163e7dd551",
"startPoint": {
"lng": -77.077407,
"lat": 38.893276
},
"turnType": 2
},
{
"signs": [],
"index": 2,
"maneuverNotes": [],
"direction": 7,
"narrative": "Turn right onto 14th St N.",
"iconUrl": "http://content.mapquest.com/mqsite/turnsigns/rs_right_sm.gif",
"distance": 0.003,
"time": 5,
"linkIds": [],
"streets": [
"14th St N"
],
"attributes": 0,
"transportMode": "AUTO",
"formattedTime": "00:00:05",
"directionName": "West",
"mapUrl": "http://www.mapquestapi.com/staticmap/v4/getmap?key=KEY&type=map&size=225,160&pois=purple-3,38.890857,-77.07708699999999,0,0|purple-4,38.890842,-77.077148,0,0|¢er=38.8908495,-77.07711749999999&zoom=15&rand=-1646228270&session=55e60cd9-00b6-001a-02b7-20ac-00163e7dd551",
"startPoint": {
"lng": -77.077087,
"lat": 38.890857
},
"turnType": 2
},
{
"signs": [
{
"text": "50",
"extraText": "",
"direction": 7,
"type": 2,
"url": "http://icons.mqcdn.com/icons/rs2.png?n=50&d=WEST"
}
],
"index": 3,
"maneuverNotes": [],
"direction": 4,
"narrative": "Merge onto Arlington Blvd/US-50 W via the ramp on the left.",
"iconUrl": "http://content.mapquest.com/mqsite/turnsigns/rs_merge_left_sm.gif",
"distance": 1.606,
"time": 151,
"linkIds": [],
"streets": [
"Arlington Blvd",
"US-50 W"
],
"attributes": 0,
"transportMode": "AUTO",
"formattedTime": "00:02:31",
"directionName": "South",
"mapUrl": "http://www.mapquestapi.com/staticmap/v4/getmap?key=KEY&type=map&size=225,160&pois=purple-4,38.890842,-77.077148,0,0|purple-5,38.87355,-77.089424,0,0|¢er=38.882196,-77.08328599999999&zoom=9&rand=-1646228270&session=55e60cd9-00b6-001a-02b7-20ac-00163e7dd551",
"startPoint": {
"lng": -77.077148,
"lat": 38.890842
},
"turnType": 11
},
{
"signs": [],
"index": 4,
"maneuverNotes": [],
"direction": 4,
"narrative": "Turn left onto N Fillmore St.",
"iconUrl": "http://content.mapquest.com/mqsite/turnsigns/rs_left_sm.gif",
"distance": 0.408,
"time": 74,
"linkIds": [],
"streets": [
"N Fillmore St"
],
"attributes": 0,
"transportMode": "AUTO",
"formattedTime": "00:01:14",
"directionName": "South",
"mapUrl": "http://www.mapquestapi.com/staticmap/v4/getmap?key=KEY&type=map&size=225,160&pois=purple-5,38.87355,-77.089424,0,0|purple-6,38.867782,-77.08811899999999,0,0|¢er=38.870666,-77.0887715&zoom=10&rand=-1646228270&session=55e60cd9-00b6-001a-02b7-20ac-00163e7dd551",
"startPoint": {
"lng": -77.089424,
"lat": 38.87355
},
"turnType": 6
},
{
"signs": [],
"index": 5,
"maneuverNotes": [],
"direction": 4,
"narrative": "Stay straight to go onto S Walter Reed Dr.",
"iconUrl": "http://content.mapquest.com/mqsite/turnsigns/rs_straight_sm.gif",
"distance": 0.884,
"time": 149,
"linkIds": [],
"streets": [
"S Walter Reed Dr"
],
"attributes": 0,
"transportMode": "AUTO",
"formattedTime": "00:02:29",
"directionName": "South",
"mapUrl": "http://www.mapquestapi.com/staticmap/v4/getmap?key=KEY&type=map&size=225,160&pois=purple-6,38.867782,-77.08811899999999,0,0|purple-7,38.855185999999996,-77.088584,0,0|¢er=38.861484,-77.08835149999999&zoom=9&rand=-1646228270&session=55e60cd9-00b6-001a-02b7-20ac-00163e7dd551",
"startPoint": {
"lng": -77.088119,
"lat": 38.867782
},
"turnType": 0
},
{
"signs": [
{
"text": "120",
"extraText": "",
"direction": 0,
"type": 545,
"url": "http://icons.mqcdn.com/icons/rs545.png?n=120"
}
],
"index": 6,
"maneuverNotes": [],
"direction": 5,
"narrative": "Turn slight left onto S Glebe Rd/VA-120.",
"iconUrl": "http://content.mapquest.com/mqsite/turnsigns/rs_slight_left_sm.gif",
"distance": 0.593,
"time": 84,
"linkIds": [],
"streets": [
"S Glebe Rd",
"VA-120"
],
"attributes": 0,
"transportMode": "AUTO",
"formattedTime": "00:01:24",
"directionName": "Southeast",
"mapUrl": "http://www.mapquestapi.com/staticmap/v4/getmap?key=KEY&type=map&size=225,160&pois=purple-7,38.855185999999996,-77.088584,0,0|purple-8,38.848926,-77.08122999999999,0,0|¢er=38.852056,-77.08490699999999&zoom=10&rand=-1646228270&session=55e60cd9-00b6-001a-02b7-20ac-00163e7dd551",
"startPoint": {
"lng": -77.088584,
"lat": 38.855186
},
"turnType": 7
},
{
"signs": [],
"index": 7,
"maneuverNotes": [],
"direction": 0,
"narrative": "2400 S GLEBE RD is on the right.",
"iconUrl": "http://content.mapquest.com/mqsite/turnsigns/icon-dirs-end_sm.gif",
"distance": 0,
"time": 0,
"linkIds": [],
"streets": [],
"attributes": 0,
"transportMode": "AUTO",
"formattedTime": "00:00:00",
"directionName": "",
"startPoint": {
"lng": -77.08123,
"lat": 38.848926
},
"turnType": -1
}
],
"hasFerry": false
}
],
"formattedTime": "00:08:21",
"routeError": {
"message": "",
"errorCode": -400
},
"options": {
"mustAvoidLinkIds": [],
"drivingStyle": 2,
"countryBoundaryDisplay": true,
"generalize": -1,
"narrativeType": "text",
"locale": "en_US",
"avoidTimedConditions": false,
"destinationManeuverDisplay": true,
"enhancedNarrative": false,
"filterZoneFactor": -1,
"timeType": 0,
"maxWalkingDistance": -1,
"routeType": "FASTEST",
"transferPenalty": -1,
"stateBoundaryDisplay": true,
"walkingSpeed": -1,
"maxLinkId": 0,
"arteryWeights": [],
"tryAvoidLinkIds": [],
"unit": "M",
"routeNumber": 0,
"shapeFormat": "raw",
"maneuverPenalty": -1,
"useTraffic": false,
"returnLinkDirections": false,
"avoidTripIds": [],
"manmaps": "true",
"highwayEfficiency": 22,
"sideOfStreetDisplay": true,
"cyclingRoadFactor": 1,
"urbanAvoidFactor": -1
},
"hasFerry": false
},
"info": {
"copyright": {
"text": "© 2017 MapQuest, Inc.",
"imageUrl": "http://api.mqcdn.com/res/mqlogo.gif",
"imageAltText": "© 2017 MapQuest, Inc."
},
"statuscode": 0,
"messages": []
}
}