OpenRouteService Matrix API
Obtain one-to-many, many-to-one and many-to-many matrices for time and distance
Obtain one-to-many, many-to-one and many-to-many matrices for time and distance
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/openrouteservice-matrix-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: OpenRouteService Directions Matrix API
description: OpenRouteService is a free, open-source geospatial API platform built on OpenStreetMap data. It provides routing directions for multiple transport modes, isochrones for reachability analysis, time-distance matrices, geocoding, elevation data, points of interest, and vehicle route optimization for logistics and humanitarian use cases.
version: v2
contact:
name: OpenRouteService Support
url: https://ask.openrouteservice.org
email: support@smartmobility.heigit.org
license:
name: GNU General Public License v3.0
url: https://github.com/GIScience/openrouteservice/blob/main/LICENSE
x-ors-docs: https://giscience.github.io/openrouteservice/
servers:
- url: https://api.openrouteservice.org
description: OpenRouteService Public API
security:
- ApiKeyAuth: []
tags:
- name: Matrix
description: Obtain one-to-many, many-to-one and many-to-many matrices for time and distance
paths:
/v2/matrix/{profile}:
post:
tags:
- Matrix
summary: Matrix Service
description: Computes one-to-many, many-to-one or many-to-many time/distance matrices for all pairs of the supplied coordinates. The maximum number of locations depends on the subscription plan (up to 3,500 for standard).
operationId: getMatrix
parameters:
- $ref: '#/components/parameters/profile'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/MatrixRequest'
responses:
'200':
description: Successfully computed matrix
content:
application/json:
schema:
$ref: '#/components/schemas/JSONMatrixResponse'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/InternalServerError'
components:
schemas:
JSONMatrixResponse:
type: object
properties:
durations:
type: array
description: 2D array of travel durations in seconds
items:
type: array
items:
type: number
format: double
distances:
type: array
description: 2D array of travel distances in meters
items:
type: array
items:
type: number
format: double
sources:
type: array
items:
$ref: '#/components/schemas/MatrixLocation'
destinations:
type: array
items:
$ref: '#/components/schemas/MatrixLocation'
metadata:
$ref: '#/components/schemas/MatrixResponseInfo'
MatrixLocation:
type: object
properties:
location:
type: array
items:
type: number
description: Snapped coordinate [longitude, latitude]
name:
type: string
description: Name of nearest road
snapped_distance:
type: number
format: double
description: Distance from original to snapped location in meters
MatrixResponseInfo:
type: object
properties:
attribution:
type: string
service:
type: string
timestamp:
type: integer
format: int64
id:
type: string
engine:
$ref: '#/components/schemas/EngineInfo'
query:
type: object
osm_file_md5_hash:
type: string
MatrixRequest:
type: object
required:
- locations
properties:
locations:
type: array
description: Array of coordinates as [longitude, latitude] pairs for matrix computation. Used as both sources and destinations unless specified separately.
items:
type: array
items:
type: number
format: double
minItems: 2
maxItems: 2
example:
- - 8.681495
- 49.41461
- - 8.686507
- 49.41943
- - 8.687872
- 49.420318
sources:
type: array
description: Indices into locations array to use as sources (origins)
items:
type: integer
destinations:
type: array
description: Indices into locations array to use as destinations
items:
type: integer
metrics:
type: array
description: Metrics to compute for the matrix
items:
type: string
enum:
- duration
- distance
default:
- duration
resolve_locations:
type: boolean
description: Return nearest road network location for each coordinate
default: false
units:
type: string
description: Distance units (only applicable when distance metric requested)
enum:
- m
- km
- mi
default: m
id:
type: string
description: Arbitrary identifier for tracking requests
ErrorResponse:
type: object
properties:
error:
type: object
properties:
code:
type: integer
description: Error code
message:
type: string
description: Human-readable error message
info:
type: object
properties:
engine:
$ref: '#/components/schemas/EngineInfo'
attribution:
type: string
timestamp:
type: integer
format: int64
EngineInfo:
type: object
properties:
version:
type: string
description: ORS engine version
build_date:
type: string
format: date-time
description: Build date of the ORS engine
parameters:
profile:
name: profile
in: path
description: Specifies the transport mode profile for routing
required: true
schema:
type: string
enum:
- driving-car
- driving-hgv
- cycling-regular
- cycling-road
- cycling-mountain
- cycling-electric
- foot-walking
- foot-hiking
- wheelchair
example: driving-car
responses:
NotFound:
description: Not found - route or resource could not be found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
Forbidden:
description: Forbidden - API key does not have permission for this operation
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
InternalServerError:
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
Unauthorized:
description: Unauthorized - missing or invalid API key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
BadRequest:
description: Bad request - invalid parameters or request body
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
securitySchemes:
ApiKeyAuth:
type: apiKey
in: header
name: Authorization
description: API key obtained from https://openrouteservice.org