{"uid":"cap_8ghTz1wL7q8JHsnyZL1NZ","slug":"mapbox-matrix-c6702c7e","name":"Mapbox Matrix","description":"Calculate travel time and distance between many origins and destinations. Billed per element (sources × destinations).","url":"https://mapbox.mpp.paywithlocus.com/mapbox/matrix?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","required":["profile","coordinates"],"properties":{"profile":{"type":"string","description":"Routing profile: mapbox/driving, mapbox/driving-traffic, mapbox/walking, mapbox/cycling"},"sources":{"type":"string","description":"Semicolon-separated indices for source coordinates (for asymmetric matrices)"},"approaches":{"type":"string","description":"Semicolon-separated approach per coordinate: unrestricted or curb"},"annotations":{"type":"string","description":"Comma-separated: duration, distance (or both)"},"coordinates":{"type":"string","description":"Semicolon-separated lon,lat pairs (2-25, max 10 for traffic)"},"destinations":{"type":"string","description":"Semicolon-separated indices for destination coordinates"}},"additionalProperties":true},"responseSchema":null,"example":{"request":{"profile":"mapbox/driving","annotations":"duration,distance","coordinates":"-87.6298,41.8781;-87.6234,41.8827;-87.6412,41.8690"},"response":{"data":{"code":"Ok","sources":[{"name":"South Federal Street","distance":2.40743484,"location":[-87.629771,41.8781]},{"name":"","distance":57.7300495,"location":[-87.624095,41.882718]},{"name":"West DeKoven Street","distance":0.555346471,"location":[-87.6412,41.869005]}],"distances":[[0,985.1,2931.8],[1243,0,3918.7],[1985.2,3337,0]],"durations":[[0,244,379],[317.1,0,564.3],[388.3,585.3,0]],"destinations":[{"name":"South Federal Street","distance":2.40743484,"location":[-87.629771,41.8781]},{"name":"","distance":57.7300495,"location":[-87.624095,41.882718]},{"name":"West DeKoven Street","distance":0.555346471,"location":[-87.6412,41.869005]}]},"success":true}},"exampleRequest":{"profile":"mapbox/driving","annotations":"duration,distance","coordinates":"-87.6298,41.8781;-87.6234,41.8827;-87.6412,41.8690"},"tags":["maps","geocoding","directions","routing","geospatial","data"],"displayCostAmount":"0.035","displayCostAsset":"USDC","priceDynamic":true,"priceHint":"$0.002/element","priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"dynamic","summary":"$0.002/element (dynamic)","primary":{"kind":"dynamic","protocol":"mpp","network":"tempo","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"dynamic","protocol":"mpp","network":"tempo","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_KM7ud8VMWGb-QDVhJocuL","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":"Mapbox","brandSlug":"mapbox","brandBaseUrl":"https://www.mapbox.com","brandDocsUrl":"https://docs.mapbox.com/api/","whatItDoes":"Computes travel durations and/or distances between multiple origin and destination coordinate pairs using a specified routing profile","exampleAgentPrompt":"Using the Mapbox Matrix API, calculate the driving travel times and distances from my warehouse at -87.6298,41.8781 to each of these three delivery stops: -87.6234,41.8827; -87.6412,41.8690; -87.6501,41.8756 — use the mapbox/driving profile and return both duration and distance.","exampleUseCases":null,"resultDescription":"Returns a matrix of travel durations (in seconds) and/or distances (in meters) between all requested source and destination coordinate pairs, along with the routing profile used and the snapped waypoint locations.","failureModes":["Invalid coordinate format returns 400 Bad Request","More than 25 coordinates (or 10 for traffic profile) returns an error","Invalid routing profile string returns 422","Out-of-range coordinates (not on a routable road) may return null durations for affected pairs","Malformed sources/destinations indices return an error","Network timeout on large matrices"],"whenToPreferThis":"Use this endpoint when you need to compute travel times or distances between multiple origin-destination pairs simultaneously, especially for logistics, fleet routing, nearest-facility problems, or any scenario requiring an O(m×n) travel cost matrix. It is far more efficient than calling the Directions endpoint repeatedly for each pair.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-10T12:33:03.809Z","isFirstParty":false,"canonicalSlug":"mapbox-matrix-c6702c7e"}