Migrate to DistanceMatrixAPI

If you are using Google API, migration will take less than 5 minutes, and save up to 9 times your cost.

Migrate from Google Distance Matrix API

This page will explain how to move from Google Distance Matrix API to DistanceMatrixAPI, and compare the request and response parameters of each.

In a Nutshell

All that needs to be done in the project code or API links is to find the existing google API path “https://maps.googleapis.com/maps/api/distancematrix” and replace it with “https://maps.distancematrixapi.com/maps/api/distancematrix“.
That’s it, DistanceMatrixAPI backend algorithms and AI technology will take care of the rest and serve your project requests.

If you are not fully confident yet, continue reading below:

DistanceMatrixAPI.com:

REPLACE

https://maps.distancematrixapi.com 

Google:

FIND

https://maps.googleapis.com 

DistanceMatrixAPI.com:

GET

https://maps.distancematrixapi.com/maps/api/distancematrix/json
?origins=<origin_location_1|origin_location_2|...|origin_location_n>
&destinations=<destination_location_1|destination_location_2|...|destination_location_n>
&key=<your_access_token> 

Google:

GET

https://maps.googleapis.com/maps/api/distancematrix/json
?origins=<origin_location_1|origin_location_2|...|origin_location_n>
&destinations=<destination_location_1|destination_location_2|...|destination_location_n>
&key=<your_access_token> 

Migration from Google to DistanceMatrixAPI is engineered to be simple

Distance Matrix Example Request

DistanceMatrixAPI:

GET

https://maps.distancematrixapi.com/maps/api/distancematrix/json
?units=imperial&origins=big ben london&destinations=48.8584,2.2945
&key=<your_access_token> 

Google:

GET

https://maps.googleapis.com/maps/api/distancematrix/json
?units=imperial&origins=big ben london&destinations=48.8584,2.2945
&key=<your_access_token> 

Required Inputs & Response Parameters

Parameters in the DistanceMatrix API request is similar to Google

  1. Single or Multiple Origin points on the map separated by the pipe character (|) or the encoded pipe character %7C
  2. Single or Multiple Destination points on the map separated by the pipe character (|) or the encoded pipe character %7C
  3. Key: your DistanceMatrixAPI access token authorized to access the service. You can get by filling the demo form here

Matrix API response in JSON or XML format, it's also the same in both cases.

  • The core unit of duration (time estimate) in seconds.
  • The response parameter for distance in either meters (metric) or miles (imperial)
  • Default transport mode is via cars with live traffic conditions. Travel modes can be changed, please check full guide at https://distancematrixapi.com/dev/
  • The elements origin/destination pairs to which fastest route is to be computed. 

Distance Matrix Example Response

DistanceMatrixAPI.com:

{
   "destination_addresses" : [ "5 Avenue Anatole France, 75007 Paris, France" ],
   "origin_addresses" : [ "Westminster, London SW1A 0AA, UK" ],
   "rows" : [
      {
         "elements" : [
            {
               "distance" : {
                  "text" : "284 mi",
                  "value" : 457643
               },
               "duration" : {
                  "text" : "5 hours 35 mins",
                  "value" : 20090
               },
               "status" : "OK"
            }
         ]
      }
   ],
   "status" : "OK"
} 

Google:

{
   "destination_addresses" : [ "5 Avenue Anatole France, 75007 Paris, France" ],
   "origin_addresses" : [ "Westminster, London SW1A 0AA, UK" ],
   "rows" : [
      {
         "elements" : [
            {
               "distance" : {
                  "text" : "284 mi",
                  "value" : 457643
               },
               "duration" : {
                  "text" : "5 hours 34 mins",
                  "value" : 20065
               },
               "status" : "OK"
            }
         ]
      }
   ],
   "status" : "OK"
} 

Are you a developer working for a company or an ongoing project which uses or plans to use Distance Matrix API from Google or other providers?