Routing
Four services in OSRM’s format, the format Mapbox’s Directions API derives from. If you have code that works with OSRM or Mapbox, change the host.
GET /v1/{directions|matrix|match|optimize}/{driving|walking}/{lng,lat;lng,lat;…}| Service | For | Max points | Units |
|---|---|---|---|
directions |
A route between two or more points | 25 | 1 |
matrix |
Times and distances between all points | 25 | 3 |
match |
Snap a GPS trace to roads | 100 | 2 |
optimize |
The best order to visit stops | 12 | 3 |
geometries=geojsonreturns shapes ready to draw;polyline(the default) is smaller.alternatives=trueasks for other routes;steps=truefor turn-by-turn instructions.optimizekeeps the trip open when you sendroundtrip=false: addsource=firstto fix the first stop,destination=lastto fix the last one (a trip with a fixed start and end needs both).- A point more than 5 km from any road is refused with
no_segment. - Times don’t account for traffic yet.



