Routing API

Driving, walking, and cycling routes through up to 20 stops, with the distance, the travel time, and a line to draw for every leg. Here's downtown Portland to Multnomah Falls, three ways:

  • 34 min
  • 2 h 58 min
  • 11 h 29 min

Try a route

Routes start at Pioneer Courthouse Square. Click the map to pick a destination, then switch the travel mode. Each route comes from the live API.

  1. Pioneer Courthouse Square
  2. OMSI

Click the map to change the destination.

Travel times by mode

Six trips from downtown Portland, from a bookstore around the corner to the Oregon coast, each routed three ways. Every mode follows its own network: bike lanes and paths, footpaths and stairs, or roads.

Times use a log scale, so each gridline is 10 times longer than the one before. Hover a dot for the details.

Travel time from Pioneer Courthouse Square Drive Bike Walk
Powell's City of Books
0.7 mi by road
OMSI
1.3 mi by road
Portland Airport
13 mi by road
Multnomah Falls
30 mi by road
Timberline Lodge
63 mi by road
Cannon Beach
79 mi by road
Show the data as a table
ToDriveBikeWalk
Powell's City of Books3 min, 0.7 mi4 min, 0.6 mi9 min, 0.4 mi
OMSI4 min, 1.3 mi8 min, 1.3 mi23 min, 1.2 mi
Portland Airport17 min, 13 mi54 min, 9.5 mi2 h 44 min, 8.6 mi
Multnomah Falls34 min, 30 mi2 h 58 min, 32 mi11 h 29 min, 36 mi
Timberline Lodge1 h 19 min, 63 mi6 h 17 min, 63 mi17 h 35 min, 56 mi
Cannon Beach1 h 30 min, 79 mi10 h 6 min, 95 mi26 h 56 min, 85 mi

Request and response

POST the stops and a travel mode. The route comes back with whole meters and seconds, one entry in legs per pair of stops, and an encoded polyline with six decimal places.

  • 2 to 20 waypoints, visited in the order you give
  • drive, walk, or bicycle
  • No route between the stops? It isn't billed.

Routes don't include live traffic, public transit, turn-by-turn instructions, tolls, or route matrices, and stops aren't reordered for you.

Routing docs
Request
curl "https://api.mapricot.com/v1/route" \
  -H "Authorization: Bearer $MAPRICOT_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "waypoints": [
      { "lat": 43.7396, "lon": 7.4275 },
      { "lat": 43.734, "lon": 7.4222 }
    ],
    "mode": "walk"
  }'
Response
{  "routes": [    {      "distanceMeters": 1044,      "durationSeconds": 739,      "polyline": "{{slrAmyidMzImEvQwGlE}ATJXDTC@Ab@Qb@[`Au…",      "legs": [        {          "distanceMeters": 1044,          "durationSeconds": 739        }      ]    }  ],  "attribution": [    {      "source": "openstreetmap",      "text": "© OpenStreetMap contributors",      "url": "https://www.openstreetmap.org/copyright"    }  ]}

Valhalla and OpenStreetMap

Routing runs on Valhalla, the open-source routing engine, with a road network built from OpenStreetMap for every country. Show the credit in each response's attribution.

Other APIs

One account and one API key cover every Mapricot API, and the free allowance is shared between them.

Start with 250,000 free requests

Sign in with your email, create an API key, and make your first request in a few minutes. No credit card required.