Mapbox Matrix API

The Mapbox Matrix API (formerly the Distance API) calculates travel times between many points in one API request.

The Matrix API returns travel times between many locations and is designed specifically for building a timetable or matrix. The number of sources and destinations are multiplied to create the matrix, or timetable, and calculate the number of elements needed to make the request. For example, given 3 locations A, B, C, the Matrix API will return a matrix of all travel times in seconds between all locations:

image of 3 elements used for matrix request

AA → AA → BA → C
BB → AB → BB → C
CC → AC → BC → C

The Matrix API works worldwide and is available for the driving, cycling, and walking routing profiles. Learn more about how the Mapbox Matrix API works on our comprehensive How Directions Works tutorial.

The Mapbox Matrix API is available for all plan levels.