Documentation menu

Guides

Migrating from the Mapbox Matrix API

Move from the Mapbox Matrix API to Wayline's matrix endpoint โ€” coordinate order, parameter and response mapping, and differences to plan for.

Updated Dec 1, 2026 View Markdown

Mapbox's Matrix API and Wayline's Matrix endpoint solve the same problem with different request shapes.

Coordinate order

Mapbox uses lng,lat in a semicolon-separated path. Wayline uses lat,lng in a JSON body. Swap the order when you migrate โ€” the most common migration bug.

Request mapping

MapboxWayline
GET /directions-matrix/v1/mapbox/driving/{coords}POST /v1/matrix
{lng,lat;lng,lat;โ€ฆ} pathpoints, or origins + destinations ({lat, lng})
sources=0;1origins
destinations=2;3destinations
annotations=duration,distancemetrics=both (default), duration or distance
access_tokenAuthorization: Bearer
driving-traffic profileNot available (no live traffic yet)

Response mapping

MapboxWayline
durations[i][j]rows[i].elements[j].duration_seconds
distances[i][j]rows[i].elements[j].distance_meters
null cellstatus: "NO_ROUTE"
sources[], destinations[]origins[], destinations[] with snapped and distance_to_road_meters

Example

curl -X POST "https://api.wayline.cloud/v1/matrix" \
  -H "Authorization: Bearer $WAYLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"origins":[{"lat":37.788,"lng":-122.4075},{"lat":37.8313,"lng":-122.2852}],"destinations":[{"lat":37.8044,"lng":-122.2712},{"lat":37.8716,"lng":-122.2727},{"lat":37.9358,"lng":-122.3478}],"units":"imperial"}'

Related: Wayline vs Mapbox Matrix ยท Distance Matrix API