Mapbox Matrix API via MPP — compute travel-time/distance matrices between up to 25 coordinates.
What it does
This endpoint exposes the Mapbox Matrix API through the Locus Micropayment Protocol (MPP). It computes travel-time and distance matrices between sets of coordinates, supporting up to 25 waypoints (10 for traffic profiles). You can choose from four routing profiles — driving, driving-traffic, walking, and cycling — and request asymmetric matrices by specifying separate source and destination indices. Annotations include duration, distance, or both.
The endpoint is part of a broader Mapbox suite available through Locus MPP that also includes forward/reverse geocoding, directions, isochrones, map matching, static images, and tilequery. Payment is settled via Tempo (pathUSD on Tempo L2) with per-element pricing at $0.002 per matrix element as stated in the OpenAPI spec. The endpoint accepts POST requests with a JSON body containing the routing profile, semicolon-separated coordinates, and optional parameters for sources, destinations, annotations, and approach preferences.
Note: The probe did not receive a 402 challenge when hitting this specific endpoint via HEAD/GET (it returned 404), which is consistent with the endpoint requiring POST. The OpenAPI spec from the provider's root describes the endpoint schema and payment terms in detail, so the endpoint is likely live for POST requests but could not be fully confirmed during probing.
Capabilities
Use cases
- —Computing travel times between multiple warehouse locations and delivery addresses for logistics optimization
- —Building a ride-sharing app that needs to find the nearest available driver to a passenger
- —Generating distance matrices for solving vehicle routing or traveling salesman problems
- —Comparing commute times across different transportation modes for real estate analysis
- —Powering store-locator features that rank locations by actual travel time rather than straight-line distance
Fit
Best for
- —Agents needing on-demand many-to-many travel time/distance calculations without managing API keys
- —Logistics and fleet optimization workflows requiring matrix routing
- —Applications comparing driving, walking, and cycling travel times between multiple points
Not for
- —Single origin-to-destination routing (use the Directions endpoint instead)
- —Use cases requiring more than 25 coordinates per request
- —Free or high-volume batch processing where per-element pricing is prohibitive
Quick start
curl -X POST https://mapbox.mpp.paywithlocus.com/mapbox/matrix \
-H "Content-Type: application/json" \
-d '{
"profile": "mapbox/driving",
"coordinates": "-73.99,40.73;-77.03,38.90;-80.19,25.76",
"annotations": "duration,distance"
}'Example
Request
{
"profile": "mapbox/driving",
"sources": "0",
"approaches": "unrestricted;unrestricted;curb",
"annotations": "duration,distance",
"coordinates": "-73.99,40.73;-77.03,38.90;-80.19,25.76",
"destinations": "1;2"
}Endpoint
Quality
The OpenAPI spec provides a complete request schema and pricing description for this endpoint, but the probe returned 404 on HEAD/GET (expected since the endpoint is POST-only). No example response schema is available, and crawled pages returned only generic 404 JSON. The endpoint is likely live but not fully confirmed.
Warnings
- —Probe returned 404 on HEAD and GET — endpoint is POST-only so liveness could not be fully confirmed
- —No response schema documented in the OpenAPI spec; response format must be inferred from Mapbox's own API documentation
- —Matrix pricing is per-element ($0.002/element) with a null fixed amount, so total cost depends on the number of source×destination pairs
- —Currency address 0x20c000000000000000000000b9537d11c60e8b50 is assumed to be pathUSD (6 decimals) on Tempo L2 but could not be independently verified
Citations
- —Matrix endpoint charges $0.002 per element via Tempo settlementhttps://mapbox.mpp.paywithlocus.com
- —Supports up to 25 coordinates (max 10 for traffic profiles)https://mapbox.mpp.paywithlocus.com
- —Available routing profiles: driving, driving-traffic, walking, cyclinghttps://mapbox.mpp.paywithlocus.com
- —Part of broader Mapbox suite including geocoding, directions, isochrones, map matching, static images, and tilequeryhttps://mapbox.mpp.paywithlocus.com
- —Docs reference for Mapbox APIhttps://docs.mapbox.com/api/navigation/matrix/v1/mapbox/driving/matrix