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

Schemas


EngineError

The error body for a problem with the request.
​object
​object

GatewayError

A refusal about your key, rate limit or quota, sent before the request is processed. `error` is a plain string, not an object.
error
​string
code
​integer

A four-digit number starting with 50 that says exactly why the request was refused. It is an addition, so a client that reads only error is unaffected.

Retry on the status; read the code to explain. Several refusals share a status. The status tells your code whether to retry; the code tells you what to tell your user. New codes starting with 50 may be added.

Example: 5003

Coordinate

​number[] · minItems: 2 · maxItems: 2

A [longitude, latitude] pair, in that order.

Example: {"0":-87.6298,"1":41.8781}

MatrixRequest

locations
​Coordinate[] · required

The points the matrix is computed over. At least two.

sources
​(integer | string)[]

Indices into locations to use as sources. Leave it out, or send ["all"], to use every location. Cost is |sources| × |destinations|.

destinations
​(integer | string)[]

Indices into locations to use as destinations. Leave it out, or send ["all"], to use every location. Cost is |sources| × |destinations|.

metrics
​string[]

Which matrices to return. Defaults to durations only.

Enum values:
duration
distance
resolve_locations
​boolean

Return the name of the nearest road for each snapped point.

units
​string · enum

Units for the distance matrix. Durations are always seconds.

Enum values:
m
km
mi
id
​string

An arbitrary identifier echoed back in the response metadata.

MatrixResponse

durations
​array[]

Travel times in seconds, as rows of sources by columns of destinations. A null entry means no route was found between that pair.

distances
​array[]

Distances, present only when requested via metrics.

​SnappedPoint[]
​SnappedPoint[]
​Metadata

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

SnappedPoint

location
​number[] · minItems: 2 · maxItems: 2

A [longitude, latitude] pair, in that order.

Example: {"0":-87.6298,"1":41.8781}
snapped_distance
​number

Meters from the requested point to the road it was snapped to.

name
​string

Road name, present only when resolve_locations was set.

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

DirectionsJsonResponse

​object[]
bbox
​number[]
​Metadata

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

IsochronesRequest

locations
​Coordinate[] · required

The centers of the isochrones.

range
​number[] · required

The ranges to compute, in seconds or meters depending on range_type. There's a maximum; going over it returns 400 (code 3004), and the message names the limit.

range_type
​string · enum

Whether range is seconds or meters. Default time.

Enum values:
time
distance
interval
​number

Produce intermediate bands at this step within each range.

units
​string · enum
Enum values:
m
km
mi
area_units
​string · enum
Enum values:
m
km
mi
location_type
​string · enum

Whether the locations are origins (start, the default) or destinations — the difference matters on one-way roads.

Enum values:
start
destination
attributes
​string[]
Enum values:
area
reachfactor
total_pop
intersections
​boolean
smoothing
​number
id
​string

IsochronesResponse

A GeoJSON FeatureCollection of reachability polygons.
type
​string
bbox
​number[]
​object[]
​Metadata

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

Metadata

Details about the request and the data behind the answer, plus `element_count`.
attribution
​string

Required by license. The Open Database License requires this credit to stay with the data.

Example: © openrouteservice by HeiGIT | Data from OpenStreetMap
service
​string
timestamp
​integer

Milliseconds since the Unix epoch.

query
​object

The request, echoed back.

​object
element_count
​integer

Added by this service. How many elements this call was charged. Free calls and failed calls are never charged.

On this page
  • EngineError
  • GatewayError
  • Coordinate
  • MatrixRequest
  • MatrixResponse
  • SnappedPoint
  • DirectionsRequest
  • DirectionsJsonResponse
  • IsochronesRequest
  • IsochronesResponse
  • Metadata