Documentation menu

Guides

Migrating from the Google Distance Matrix API

Switch from the Google Maps Distance Matrix API to Wayline using the compatible endpoint — field-by-field mapping, differences and a safe rollout plan.

Updated Dec 1, 2026 View Markdown

Wayline offers a Google Distance Matrix compatible endpoint at /maps/api/distancematrix/json that returns the same JSON structure. If your integration already sends coordinates, migrating is usually a base-URL and key change.

The one-line change

diff
- https://maps.googleapis.com/maps/api/distancematrix/json?origins=…&destinations=…&key=GOOGLE_KEY
+ https://api.wayline.cloud/maps/api/distancematrix/json?origins=…&destinations=…&key=WAYLINE_KEY

Prefer sending the key in the Authorization: Bearer header instead of key= once you're migrated.

curl "https://api.wayline.cloud/maps/api/distancematrix/json?origins=37.788,-122.4075&destinations=37.8044,-122.2712%7C37.8313,-122.2852&units=imperial" \
  -H "Authorization: Bearer $WAYLINE_API_KEY"

Field mapping

Google request parameterWayline compatible endpointNotes
origins, destinationsSameCoordinates only (lat,lng, pipe-separated). Addresses and place_id: are not supported.
keySame, or Authorization: Bearer
unitsSame (metric, imperial)Affects text only; value is always meters/seconds.
modedriving only
departure_time, traffic_modelAccepted, ignoredNo live traffic; duration_in_traffic is not returned.
avoid, language, region, transit_*Not supported
Google response fieldWaylineNotes
statusSame valuesOK, INVALID_REQUEST, MAX_ELEMENTS_EXCEEDED, OVER_QUERY_LIMIT, REQUEST_DENIED, UNKNOWN_ERROR
origin_addresses, destination_addressesEcho of the coordinates you sentNo reverse geocoding.
rows[].elements[].statusOK, ZERO_RESULTS, NOT_FOUND
elements[].distance.value/textSameMeters + localized text.
elements[].duration.value/textSameFree-flow seconds.

Rollout plan

  1. Shadow: send a sample of production requests to both providers and log the difference (don't show Wayline results yet).
  2. Compare: review the distribution of distance/duration differences for your routes.
  3. Canary: switch 5% of traffic, watch error rates and support tickets.
  4. Cut over and remove the old key.

Moving to the native API later

The native Matrix endpoint returns extra data (snapped locations, region, map version, units_charged) and accepts JSON bodies. Migrate when convenient — the compatible endpoint is a supported part of v1.

Related: Wayline vs Google Distance Matrix · Compatible endpoint reference