Basic Distance Matrix

Below is the simplest possible example:

  1. No sources.
  2. No destinations.
  3. The weekend parameter is set to true, meaning the Optimization API returns a single traffic window.

Sample Request

{
    "weekend": true,
    "vehicle": {
        "type": "car"
    },
    "locations": [
        {
            "location_id": "a",
            "latitude": 33.937244,
            "longitude": -84.36947
        },
        {
            "location_id": "b",
            "latitude": 33.8875767,
            "longitude": -84.2613857
        },
        {
            "location_id": "c",
            "latitude": 33.8968108,
            "longitude": -84.3276536
        },
        {
            "location_id": "d",
            "latitude": 33.8730743,
            "longitude": -84.3951042
        }
    ]
}

Sample Response

{
    "locations": [
        {
            "location_id": "a",
            "time_zone": "America/New_York"
        },
        {
            "location_id": "b",
            "time_zone": "America/New_York"
        },
        {
            "location_id": "c",
            "time_zone": "America/New_York"
        },
        {
            "location_id": "d",
            "time_zone": "America/New_York"
        }
    ],
    "status": "Ok",
    "traffic_windows": [
        {
            "traffic_window_end_times": [
                "23:59:59"
            ],
            "traffic_window_index": 0,
            "traffic_window_start_times": [
                "00:00:00"
            ]
        }
    ],
    "travel_costs": {
        "a": {
            "a": [
                0,
                0
            ],
            "b": [
                16876.7,
                1526.7
            ],
            "c": [
                9138.8,
                887.8
            ],
            "d": [
                9302.7,
                988.7
            ]
        },
        "b": {
            "a": [
                16409.7,
                1057.4
            ],
            "b": [
                0,
                0
            ],
            "c": [
                8447.2,
                860.5
            ],
            "d": [
                20463,
                1443.5
            ]
        },
        "c": {
            "a": [
                8524.2,
                800.7
            ],
            "b": [
                8447.2,
                930.9
            ],
            "c": [
                0,
                0
            ],
            "d": [
                8417.9,
                952.9
            ]
        },
        "d": {
            "a": [
                9405.1,
                1024.4
            ],
            "b": [
                19974.8,
                1558
            ],
            "c": [
                8340.7,
                955
            ],
            "d": [
                0,
                0
            ]
        }
    }
}