OSRM Alternative Routes API
Get several distinct route options in a single request so users can pick their preferred path.
/api/1/directionsCurrent plan limits
Free includes Routing, Route Optimization, Geocoding (including reverse lookup and autocomplete) and Matrix APIs within plan limits. Map Matching, Isochrone, Truck Routing, Fuel Estimate and other separate APIs require a paid plan, including PAYG. API access follows the account’s effective plan; a positive balance alone does not override Free restrictions. Road Data and AI retain their separate Business requirements.
Replace YOUR_KEY with your own API key. Paid API requests consume credits; copying this example does not send a request.
Current plans and pricingOverview
The Alternative Routes API computes up to three genuinely different routes between your points in a single request. Ideal for giving drivers a choice, avoiding a blocked road, or comparing a fast vs. shorter path — each option includes full geometry, distance and duration.
API reference
/api/1/directions| Parameter | Type | Status |
|---|---|---|
| point | string | Required |
| alternatives | integer | Optional |
| profile | string | Optional |
Example request
Credit cost: 1 credit per started block of 10 input points, including origin and destination.curl "https://osrmroute.com/api/1/directions?point=40.3777,49.8516&point=40.40,49.86&alternatives=2" -H "Authorization: Bearer YOUR_KEY"