Google Distance Matrix API - 94keegan/LinkedU GitHub Wiki

API Documentation

https://developers.google.com/maps/documentation/distance-matrix/intro

Example (using Zip Codes)

Query

https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=61701|61761&destinations=55720|60603

Response:

{
"destination_addresses": [
    "Cloquet, MN 55720, USA",
    "Chicago, IL 60603, USA"
],
"origin_addresses": [
    "Bloomington, IL 61701, USA",
    "Normal, IL 61761, USA"
],
"rows": [
    {
        "elements": [
            {
                "distance": {
                    "text": "545 mi",
                    "value": 876732
                },
                "duration": {
                    "text": "8 hours 7 mins",
                    "value": 29230
                },
                "status": "OK"
            },
            {
                "distance": {
                    "text": "135 mi",
                    "value": 217425
                },
                "duration": {
                    "text": "2 hours 18 mins",
                    "value": 8287
                },
                "status": "OK"
            }
        ]
    },
    {
        "elements": [
            {
                "distance": {
                    "text": "543 mi",
                    "value": 873915
                },
                "duration": {
                    "text": "8 hours 3 mins",
                    "value": 28955
                },
                "status": "OK"
            },
            {
                "distance": {
                    "text": "130 mi",
                    "value": 209701
                },
                "duration": {
                    "text": "2 hours 10 mins",
                    "value": 7819
                },
                "status": "OK"
            }
        ]
    }
],
"status": "OK"
}