Skip to main content

Overview

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.
Want to try it first? Open the Live Demo and drag the A/B markers on the map.

Endpoint

Quickstart

Request Parameters

Service options

General options

These options apply to all routing services. Options that take one value per coordinate use the array-like encoding {option}={element};{element}[;...] — the number of elements must match the number of coordinates (except generate_hints and exclude). Pass an empty element to use the default for that coordinate, e.g. bearings=;90,20;.

Examples

Response

response-example.json

Response fields

Precision-5 polyline — decodable with any polyline library:
Note the decoded pairs are [lat, lng] — the opposite order of the lng,lat request input.
When annotations is requested, each leg gets an annotation object with arrays aligned to the route geometry coordinates:
Coordinates use lng,lat order, and all coordinates in one request must be in the same country. See Coverage.

Errors

Recipes

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