WayMatrixWayMatrix
WayMatrix
  • Getting started
  • API reference
  • Your API keys
  • Your usage
  • Billing
  • Back to waymatrix.io
Information
Matrix
    Travel-time and distance matrixpostTravel-time and distance matrix (explicit JSON form)post
Directions
    Route between two pointsgetRoute with full optionspostRoute, JSON formpostRoute, GeoJSON formpostRoute, GPX formpost
Isochrones
    Reachability polygonspostReachability polygons (explicit GeoJSON form)post
Service
    LivenessgetLiveness, headers onlyheadEngine and graph provenancegetEngine and graph provenance, headers onlyhead
Schemas
powered by Zuplo
WayMatrix Routing API
WayMatrix Routing API

Directions

Point-to-point routes with geometry and turn instructions.


Route between two points

GET
https://api.waymatrix.io
/v2/directions/{profile}

The simplest form: a start and an end, each as lon,lat, and a GeoJSON route back.

You can send the key as api_key in the query string. Every endpoint that needs a key accepts it.

The Authorization header is safer, though: a key in a URL ends up in logs.

Route between two points › path Parameters

profile
​string · required

The routing profile. Only driving-car is served. Any other value returns an "incorrect value" error.

Example: driving-car

Route between two points › query Parameters

start
​string · required

Start coordinate as lon,lat.

Example: -87.6298,41.8781
end
​string · required

End coordinate as lon,lat.

Example: -87.6244,41.8796

Route between two points › Headers

Authorization
​string · required

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Route between two points › Responses

A route, as GeoJSON.

GET/v2/directions/{profile}
curl 'https://api.waymatrix.io/v2/directions/:profile?start=<string>&end=<string>' \ --header 'Authorization: Bearer <token>'
Example Responses
{ "type": "FeatureCollection", "bbox": [ -87.629773, 41.8781, -87.624445, 41.880835 ], "features": [ { "type": "Feature", "bbox": [ -87.629773, 41.8781, -87.624445, 41.880835 ], "geometry": { "type": "LineString", "coordinates": [ { "0": -87.629771, "1": 41.8781 }, { "0": -87.629773, "1": 41.878174 }, { "0": -87.627695, "1": 41.878211 }, { "0": -87.62776, "1": 41.880755 }, { "0": -87.624445, "1": 41.879599 } ] }, "properties": { "summary": { "distance": 873.2, "duration": 105.4 }, "way_points": [ 0, 18 ] } } ], "metadata": { "attribution": "© openrouteservice by HeiGIT | Data from OpenStreetMap", "service": "routing", "element_count": 10 } }
json
application/geo+json

Route with full options

POST
https://api.waymatrix.io
/v2/directions/{profile}

Returns a route as JSON, with the route's shape as an encoded polyline: the points along the route compressed into a single line of text. If you need the points themselves, the /geojson form of this endpoint returns them already decoded.

What it costs

10 elements per request, however many waypoints it has.

Limits

A waypoint is a point the route must pass through, in order, including its start and its end. A route can have up to 50 waypoints.

The longest route depends on the options you send:

RequestLongest route
An ordinary route6,000 km
With options.avoid_polygons100 km
With dynamic weights100 km

Requests that avoid areas with options.avoid_polygons, or that use dynamic weights, are much slower to compute, which is why their limit is lower.

Errors

Going over a limit returns 400 (code 2004), and the message says which limit.

Route with full options › path Parameters

profile
​string · required

The routing profile. Only driving-car is served. Any other value returns an "incorrect value" error.

Example: driving-car

Route with full options › Headers

Authorization
​string · required

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Route with full options › Request Body

DirectionsRequest
coordinates
​Coordinate[] · required

The waypoints, in order, starting at the origin.

preference
​string · enum
Enum values:
fastest
shortest
recommended
units
​string · enum
Enum values:
m
km
mi
language
​string

Language for turn instructions.

instructions
​boolean

Include turn-by-turn instructions. Default true.

instructions_format
​string · enum
Enum values:
text
html
geometry
​boolean

Include the route geometry. Default true.

geometry_simplify
​boolean
elevation
​boolean
extra_info
​string[]
attributes
​string[]
continue_straight
​boolean
alternative_routes
​object

Request alternative routes.

options
​object

Advanced routing options such as avoid_features or avoid_polygons.

Note: requests with options are much slower to compute, and have a much lower limit on route distance.

radiuses
​number[]
bearings
​array[]
maximum_speed
​number
suppress_warnings
​boolean
id
​string

Route with full options › Responses

The computed route.

DirectionsJsonResponse
​object[]
bbox
​number[]
​Metadata

Details about the request and the data behind the answer, plus element_count.

POST/v2/directions/{profile}
curl https://api.waymatrix.io/v2/directions/:profile \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "coordinates": [ { "0": -87.6298, "1": 41.8781 }, { "0": -87.6244, "1": 41.8796 } ], "preference": "recommended", "units": "km", "instructions": true }'
Example Request Body
{ "coordinates": [ { "0": -87.6298, "1": 41.8781 }, { "0": -87.6244, "1": 41.8796 } ], "preference": "recommended", "units": "km", "instructions": true }
json
application/json
Example Responses
{ "bbox": [ -87.6298, 41.8781, -87.6244, 41.8796 ], "routes": [ { "summary": { "distance": 2.61, "duration": 421.3 }, "segments": [ { "distance": 2.61, "duration": 421.3, "steps": [ { "distance": 1.14, "duration": 182.6, "instruction": "Head east on West Adams Street", "name": "West Adams Street", "way_points": [ 0, 2 ] }, { "distance": 1.47, "duration": 238.7, "instruction": "Arrive at your destination, on the left", "name": "-", "way_points": [ 2, 3 ] } ] } ], "geometry": "cir~FfezuOkC{OoA_IoA{E", "bbox": [ -87.6298, 41.8781, -87.6244, 41.8796 ], "way_points": [ 0, 3 ] } ], "metadata": { "attribution": "© openrouteservice by HeiGIT | Data from OpenStreetMap", "service": "routing", "timestamp": 1788412800000, "query": { "coordinates": [ { "0": -87.6298, "1": 41.8781 }, { "0": -87.6244, "1": 41.8796 } ], "profile": "driving-car", "preference": "recommended", "units": "km" }, "engine": { "version": "9.10.0", "build_date": "2026-07-28T00:00:00Z", "graph_date": "2026-07-31T00:00:00Z", "osm_date": "2026-07-30T00:00:00Z" }, "element_count": 10 } }
json
application/json

Route, JSON form

POST
https://api.waymatrix.io
/v2/directions/{profile}/json

Identical to POST /v2/directions/{profile}, with the format in the path.

Route, JSON form › path Parameters

profile
​string · required

The routing profile. Only driving-car is served. Any other value returns an "incorrect value" error.

Example: driving-car

Route, JSON form › Headers

Authorization
​string · required

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Route, JSON form › Request Body

DirectionsRequest
coordinates
​Coordinate[] · required

The waypoints, in order, starting at the origin.

preference
​string · enum
Enum values:
fastest
shortest
recommended
units
​string · enum
Enum values:
m
km
mi
language
​string

Language for turn instructions.

instructions
​boolean

Include turn-by-turn instructions. Default true.

instructions_format
​string · enum
Enum values:
text
html
geometry
​boolean

Include the route geometry. Default true.

geometry_simplify
​boolean
elevation
​boolean
extra_info
​string[]
attributes
​string[]
continue_straight
​boolean
alternative_routes
​object

Request alternative routes.

options
​object

Advanced routing options such as avoid_features or avoid_polygons.

Note: requests with options are much slower to compute, and have a much lower limit on route distance.

radiuses
​number[]
bearings
​array[]
maximum_speed
​number
suppress_warnings
​boolean
id
​string

Route, JSON form › Responses

The computed route.

DirectionsJsonResponse
​object[]
bbox
​number[]
​Metadata

Details about the request and the data behind the answer, plus element_count.

POST/v2/directions/{profile}/json
curl https://api.waymatrix.io/v2/directions/:profile/json \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "coordinates": [ { "0": -87.6298, "1": 41.8781 }, { "0": -87.6244, "1": 41.8796 } ], "preference": "recommended", "units": "km", "instructions": true }'
Example Request Body
{ "coordinates": [ { "0": -87.6298, "1": 41.8781 }, { "0": -87.6244, "1": 41.8796 } ], "preference": "recommended", "units": "km", "instructions": true }
json
application/json
Example Responses
{ "routes": [ { "summary": { "distance": 0, "duration": 0 }, "segments": [ {} ], "geometry": "geometry", "bbox": [ 0 ], "way_points": [ 0 ] } ], "bbox": [ 0 ], "metadata": { "attribution": "© openrouteservice by HeiGIT | Data from OpenStreetMap", "service": "service", "timestamp": 0, "query": {}, "engine": { "version": "version", "build_date": "build_date", "graph_date": "graph_date", "osm_date": "osm_date" }, "element_count": 0 } }
json
application/json

Route, GeoJSON form

POST
https://api.waymatrix.io
/v2/directions/{profile}/geojson

The same route as a GeoJSON FeatureCollection, with the geometry already decoded, ready for a map library.

Route, GeoJSON form › path Parameters

profile
​string · required

The routing profile. Only driving-car is served. Any other value returns an "incorrect value" error.

Example: driving-car

Route, GeoJSON form › Headers

Authorization
​string · required

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Route, GeoJSON form › Request Body

DirectionsRequest
coordinates
​Coordinate[] · required

The waypoints, in order, starting at the origin.

preference
​string · enum
Enum values:
fastest
shortest
recommended
units
​string · enum
Enum values:
m
km
mi
language
​string

Language for turn instructions.

instructions
​boolean

Include turn-by-turn instructions. Default true.

instructions_format
​string · enum
Enum values:
text
html
geometry
​boolean

Include the route geometry. Default true.

geometry_simplify
​boolean
elevation
​boolean
extra_info
​string[]
attributes
​string[]
continue_straight
​boolean
alternative_routes
​object

Request alternative routes.

options
​object

Advanced routing options such as avoid_features or avoid_polygons.

Note: requests with options are much slower to compute, and have a much lower limit on route distance.

radiuses
​number[]
bearings
​array[]
maximum_speed
​number
suppress_warnings
​boolean
id
​string

Route, GeoJSON form › Responses

The computed route, as GeoJSON.

POST/v2/directions/{profile}/geojson
curl https://api.waymatrix.io/v2/directions/:profile/geojson \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "coordinates": [ { "0": -87.6298, "1": 41.8781 }, { "0": -87.6244, "1": 41.8796 } ], "preference": "recommended", "units": "km", "instructions": true }'
Example Request Body
{ "coordinates": [ { "0": -87.6298, "1": 41.8781 }, { "0": -87.6244, "1": 41.8796 } ], "preference": "recommended", "units": "km", "instructions": true }
json
application/json
Example Responses
{}
json
application/geo+json

Route, GPX form

POST
https://api.waymatrix.io
/v2/directions/{profile}/gpx

The same route as GPX XML.

This response isn't JSON, so it doesn't include the element_count field the JSON forms add. The attribution is in the GPX metadata.

Route, GPX form › path Parameters

profile
​string · required

The routing profile. Only driving-car is served. Any other value returns an "incorrect value" error.

Example: driving-car

Route, GPX form › Headers

Authorization
​string · required

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Route, GPX form › Request Body

DirectionsRequest
coordinates
​Coordinate[] · required

The waypoints, in order, starting at the origin.

preference
​string · enum
Enum values:
fastest
shortest
recommended
units
​string · enum
Enum values:
m
km
mi
language
​string

Language for turn instructions.

instructions
​boolean

Include turn-by-turn instructions. Default true.

instructions_format
​string · enum
Enum values:
text
html
geometry
​boolean

Include the route geometry. Default true.

geometry_simplify
​boolean
elevation
​boolean
extra_info
​string[]
attributes
​string[]
continue_straight
​boolean
alternative_routes
​object

Request alternative routes.

options
​object

Advanced routing options such as avoid_features or avoid_polygons.

Note: requests with options are much slower to compute, and have a much lower limit on route distance.

radiuses
​number[]
bearings
​array[]
maximum_speed
​number
suppress_warnings
​boolean
id
​string

Route, GPX form › Responses

The computed route, as GPX.

string
POST/v2/directions/{profile}/gpx
curl https://api.waymatrix.io/v2/directions/:profile/gpx \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "coordinates": [ { "0": -87.6298, "1": 41.8781 }, { "0": -87.6244, "1": 41.8796 } ], "preference": "recommended", "units": "km", "instructions": true }'
Example Request Body
{ "coordinates": [ { "0": -87.6298, "1": 41.8781 }, { "0": -87.6244, "1": 41.8796 } ], "preference": "recommended", "units": "km", "instructions": true }
json
application/json
Example Responses
string
xml
application/gpx+xml

MatrixIsochrones