Directions API
Returns the real road route between two points (or ordered waypoints): distance (meters), estimated duration (seconds), route geometry (polyline or GeoJSON), and optional turn-by-turn steps.Endpoint
Quickstart
Request Parameters
General options
Snapping control
Examples
- Waypoints (multi-stop)
- Avoid motorways
- GeoJSON geometry
Response
response-example.json
Response fields
Decoding geometry
Decoding geometry
Precision-5 polyline — decodable with any Note the decoded pairs are
polyline library:[lat, lng] — the opposite order of the lng,lat request input.Coordinates use
lng,lat order, and all coordinates in one request must be in the same country. See Coverage.Errors
Recipes
- Draw a line:
geometries=geojson+ Draw a Route on a Map - Navigation:
steps=true+ Turn-by-Turn Navigation - Multi-stop ordering: route 3+ waypoints in order, or let Fleet Optimization solve the optimal sequence
Related
Distance Matrix
Travel time and distance between many points in one call
Fleet Optimization
VROOM vehicle routing with time windows and capacity
Map Matching
Snap GPS traces to real roads
