Matrix API
The Matrix API calculates travel times and distances between multiple origins and multiple destinations in a single request. This is useful for finding the fastest destination from a set of options, or for building a full distance matrix between locations.
The Matrix API is currently available in the German state of NRW. Contact us for other regions.
Base URL
https://routing.maptoolkit.net/matrixAuthentication
Add your API key as ?api_key=YOUR_API_KEY to every request. See Authentication for details.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
from | lat,lng | Yes | Origin coordinate. Repeat for multiple origins. |
to | lat,lng | Yes | Destination coordinate. Repeat for multiple destinations. |
routeType | string | Yes | Vehicle type: car, bike, foot, or transit. |
departure | string | No | Departure time in ISO 8601 format (e.g., 2025-04-05T23:16:00Z). Only affects transit routing. |
Notes
- For
transitrouting, thedepartureparameter affects results - without it, a default departure time is used.
Response
Calculate travel times and distances from two origins to two destinations by car:
GET https://routing.maptoolkit.net/matrix?routeType=car&from=51.2194,6.7941&from=50.7323,7.0960&to=50.9420,6.9581&to=50.7681,6.0926&api_key=YOUR_API_KEYThis is a response to the HTTP GET request shown above:
{
"distances": [
[
39500,
80656
],
[
28732,
91729
]
],
"times": [
[
1684,
2874
],
[
1464,
3165
]
],
"info": {
"copyrights": "gtfs.de, OpenStreetMap contributors"
}
}The result is ordered as [from1→to1, from1→to2, …], [from2→to1, from2→to2, …]. Times are in seconds, distances in meters.
If a connection cannot be found, the value is null. The distances matrix is not available for the transit profile.
Errors
Errors return the HTTP status code with a plain-text message in the body.
| Status | Meaning |
|---|---|
403 | The API key is missing (Access denied!) or not recognized (Api-key not found!). See First Steps. |
400 | A parameter failed validation, or the routing engine rejected the request. |
500 | Internal server error. |
Common 400 messages
| Message | Cause |
|---|---|
Cannot parse departure time! | departure is not a valid date string. |
Only car,bike,foot,transit profile is allowed | routeType is not one of the supported values. |
Errors from the upstream routing engine are forwarded as-is.
Rate limits
Limits are monthly request quotas tied to your plan rather than a per-second rate: the
service returns no RateLimit-* or Retry-After headers. Current allowances are on the
pricing page.
The free Basic plan has a hard limit, so requests are refused once it is reached. On Pro and Ultra, requests past the allowance are billed rather than refused. Enterprise plans use a flexible limit.
Calls to this API count toward your plan’s API request allowance, which is the smaller of the two allowances.
Pricing
Self-service plans (Basic, Pro, and Ultra) are billed through RapidAPI; see RapidAPI for how to subscribe and authenticate. Plan limits and prices are listed on the Maptoolkit pricing page. Enterprise customers call the native hosts directly with a Maptoolkit API key.