The Distance Matrix API for courier services

Optimize routes and cut delays — our APIs handle multiple deliveries, dynamic traffic, and high-volume demands

The challenge for courier services

Managing a fleet of couriers is complex: ever-changing traffic, tight delivery windows, incomplete addresses, and sudden order spikes can easily derail efficiency. Without precise routing and accurate location data, costs rise, ETAs become unreliable, and customer confidence wanes.

Our integrated solution

Distancematrix.ai offers a unified platform that merges the power of Distance Matrix and Geocoding APIs. This one-stop solution streamlines your operations — no juggling multiple services. With real-time traffic data, accurate geocoding, and bulk route calculations in a single toolkit, you’ll turn routing chaos into a well-orchestrated delivery system.
  • 10000+

    happy clients

  • up to 30%

    in cost savings

  • up to 20%

    reduction in travel time

How it works

How Distance Matrix API works

The Matrix API provides trip duration in seconds and distance in meters for the fastest route between selected coordinates. The Geocoding API converts addresses to coordinates and vice versa, enabling accurate location mapping.
distance between places
The task
For example, let's say you need to find the distance and travel time between the following address points on the map:
1677 Easton Rd, Willow Grove, PA 19090, USA
119 S Easton Rd, Glenside, PA 19038, USA
geocoding API
The result
The Distance Matrix API then returns distance and travel time data on the queries with point coordinates. The API response contains a distance matrix in JSON format.
For example, 310 meters and 2600 seconds
Example request with addresses:
GET:
https://api.distancematrix.ai/maps/api/distancematrix/json?origins=Westminster Abbey, 20 Deans Yd, Westminster, London SW1P 3PA, United Kingdom&destinations=St John's Church, North End Rd, Fulham, London SW6 1PB, United Kingdom&key=<your_access_token>
Copied!
Response
body
{
    "destination_addresses": [
        "St John's Church, North End Rd, London SW6 1PB, United Kingdom"
    ],
    "origin_addresses": [
        "Westminster Abbey, 20 Deans Yd, London SW1P 3PA, United Kingdom"
    ],
    "rows": [
        {
            "elements": [
                {
                    "distance": {
                        "text": "7.3 km",
                        "value": 7346
                    },
                    "duration": {
                        "text": "23 mins",
                        "value": 1401
                    },
                    "origin": "Westminster Abbey, 20 Deans Yd, Westminster, London SW1P 3PA, United Kingdom",
                    "destination": "St John's Church, North End Rd, Fulham, London SW6 1PB, United Kingdom",
                    "status": "OK"
                }
            ]
        }
    ],
    "status": "OK"
}
Copied!
Example request with addresses:
GET:
https://api.distancematrix.ai/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&key=<your_access_token>
Copied!
The sample JSON response:
body
{
    "result": [
        {
            "address_components": [
                {
                    "long_name": "1600",
                    "short_name": "1600",
                    "types": [
                        "street_number"
                    ]
                },
                {
                    "long_name": "amphitheatre parkway",
                    "short_name": "amphitheatre parkway",
                    "types": [
                        "route"
                    ]
                },
                {
                    "long_name": "mountain view",
                    "short_name": "mountain view",
                    "types": [
                        "locality"
                    ]
                },
                {
                    "long_name": "ca",
                    "short_name": "ca",
                    "types": [
                        "state"
                    ]
                }
            ],
            "formatted_address": "1600 Amphitheatre Parkway, Mountain View, CA",
            "geometry": {
                "location": {
                    "lat": 37.422387799999996,
                    "lng": -122.08418770000002
                },
                "location_type": "APPROXIMATE",
                "viewport": {
                    "northeast": {
                        "lat": 37.422387799999996,
                        "lng": -122.08418770000002
                    },
                    "southwest": {
                        "lat": 37.422387799999996,
                        "lng": -122.08418770000002
                    }
                }
            },
            "place_id": "",
            "plus_code": {
                "compound_code": "CWC8+R9 Mountain View, California, United States",
                "global_code": "849VCWC8+R9"
            },
            "types": [
                "locality",
                "political"
            ]
        }
    ],
    "status": "OK"
}
Copied!
Find out how easy it is to migrate to the Distance Matrix API
You don't need to rewrite any code – just change the API Key
Easy migrate
Learn more

Why Distancematrix.ai?

driving distance calculator
Travel modes
Available for driving, walking, and bicycling modes. Easily calculate distances and travel times for any route
drive time forecasting
Predictive capabilities
Calculate times for future deliveries. Forecast travel times, taking into account departure and arrival times
driving distance calculator
All-in-one platform
No need to patch together multiple providers — both Distance Matrix and Geocoding are integrated in one place.
drive time forecasting
Transparent pricing & scaling
We take pride in our pricing policy, offering market-leading quality at a significantly more efficient price. Don't be fooled by bonuses — in the long run, we're the more affordable choice.
geocoding
Global coverage
Unlike many services operating only in Europe or America, we provide consistent quality worldwide. Verified by our customers from 100+ different countries.
real-time traffic
Dedicated support
Responsive live time help whenever you need it and comprehensive documentation.
Client's review
"We used Google API, but in 2018 the price became too expensive. We started looking for a cheaper solution that would have the same effectiveness for our business. The Distance Matrix API coped with all the tasks we set for them. Thanks to their work, we improved our delivery system and managed to reduce the distance-cost calculations by 5 times. We've been working with this new API for about five months and are satisfied with its possibilities."
Mateusz Sowa
CTO at Lunch24.com
No prepayment is needed.
Start for free and get instant
access to all Distancematrix.ai
products and features