GET /maps/api/distancematrix/json

Google Distance Matrix compatible API — switch in one line

Keep your existing Distance Matrix parsing code. Our /maps/api/distancematrix/json endpoint returns the same JSON structure, so migrating is mostly a base-URL and API-key change.

Request and response

Copy, paste and run with your test key. The response below is an illustrative example.
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"
Response (example)
{
  "status": "OK",
  "origin_addresses": [
    "37.788,-122.4075"
  ],
  "destination_addresses": [
    "37.8044,-122.2712",
    "37.8313,-122.2852"
  ],
  "rows": [
    {
      "elements": [
        {
          "status": "OK",
          "distance": {
            "value": 19870,
            "text": "12.3 mi"
          },
          "duration": {
            "value": 1260,
            "text": "21 mins"
          }
        },
        {
          "status": "OK",
          "distance": {
            "value": 6120,
            "text": "3.8 mi"
          },
          "duration": {
            "value": 840,
            "text": "14 mins"
          }
        }
      ]
    }
  ]
}

What the Google-compatible Distance Matrix API gives you

  • Same response shape

    status, origin_addresses, destination_addresses and rows[].elements[] with distance/duration value + text.

  • Familiar parameters

    origins, destinations, units, mode=driving and key — pipe-separated lat,lng lists.

  • Google-style errors

    INVALID_REQUEST, OVER_QUERY_LIMIT and REQUEST_DENIED statuses your code already handles.

  • Billed per element

    origins × destinations units on successful responses only.

What’s different

We accept coordinates, not addresses or place IDs, and origin_addresses echo the coordinates you sent. Only driving is supported, and drive times do not include live traffic yet. The migration guide has a full field-by-field table.

Frequently asked questions

Is the distance a straight line or a real road distance?

Always real road distance. Every result is computed along the OpenStreetMap road network with a driving profile, never as a straight-line (haversine) estimate.

Which areas do you cover?

Coverage is region-based. The Coverage page lists every enabled region with its map data date. Points outside an enabled region return an OUT_OF_COVERAGE error and are never billed.

Is Wayline affiliated with Google?

No. Wayline is an independent service. Google Maps is a trademark of Google LLC; we reference it only to describe compatibility. We do not use or store any Google data.

Do I need to change my parsing code?

Usually not, if you already send coordinates. If you send addresses or place IDs today, geocode them first and send lat,lng values.

Start building in minutes

Create an account, grab a test key and make your first request in under five minutes.