---
title: "Matrix Service"
method: GET
path: "/matrix/{profile}/{coordinates}"
tags: ["Routing"]
---

# Matrix Service

`GET /matrix/{profile}/{coordinates}`

Computes duration of the fastest route between all pairs of supplied coordinates. Returns the durations or distances or both between the coordinate pairs. Note that the distances are not the shortest distance between two coordinates, but rather the distances of the fastest routes.

## Query parameters

- `bearings` string
- `radiuses` string
- `hints` string
- `sources` integer
- `destinations` integer
- `annotations` string
- `fallback_speed` number
- `fallback_coordinate` string

## Response `200`

OK

- DirectionsMatrix
  - `code` string — If the request was successful `Ok` otherwise see the service dependent and general status codes.
  - `distances` array[] — array of arrays that stores the matrix in row-major order. `distances[i][j]` gives the travel distance from the i-th waypoint to the j-th waypoint. Values are given in meters. Can be `null` if no route between `i` and `j` can be found.
    - number[]
  - `durations` array[] — array of arrays that stores the matrix in row-major order. `durations[i][j]` gives the travel time from the i-th waypoint to the j-th waypoint. Values are given in seconds. Can be `null` if no route between `i` and `j` can be found.
    - number[]
  - `fallback_speed_cells` number[]
  - `sources` object[] — array of `Waypoint` objects describing all sources in order.
    - `distance` number
    - `location` number[]
    - `name` string
  - `destinations` object[] — array of `Waypoint` objects describing all destinations in order.
    - `distance` number
    - `location` number[]
    - `name` string

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — The request has been made from an unauthorized domain.
- `404` — No location or places were found for the given input
- `429` — Request exceeded the rate-limits set on your account
- `500` — Internal Server Error

---

[API](https://skmtc.dev/locationiq/apis/locationiq-api-reference.md) · [All operations](https://skmtc.dev/locationiq/apis/locationiq-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/locationiq/locationiq-api-reference/revisions/62f2eab3d1ff/schema)
