The Mapbox Matrix 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, and C — the Matrix API will return a matrix of all travel times in seconds between all the locations:
|A||A → A||A → B||A → C|
|B||B → A||B → B||B → C|
|C||C → A||C → B||C → C|
The Matrix API works worldwide and is available for the
walking routing profiles.
A sample Matrix API request looks like:
The Matrix API has optional parameters that can be used to refine the results of a request.