L'API Distance Matrix pour le transport, la logistique et le fret

Utilisez une taille de matrice illimitée pour votre application logistique et rationalisez le transport interurbain à l'aide d'informations sur le trafic en temps réel

The Logistics Challenge

High volumes, tight schedules, multiple stops — modern logistics involves juggling countless pickups and drop-offs, all while dealing with unpredictable traffic, road closures, and tight delivery windows. Without robust routing, fleets waste fuel and time, causing delays and ballooning costs.

Our Solution

Distancematrix.ai unifies Distance Matrix and Geocoding capabilities in one platform. Convert addresses into precise coordinates, factor in real-time traffic, and instantly compute distances and travel times between any number of locations. By centralizing these tools, we eliminate the need for multiple providers — saving you time, money, and complexity.

Key Benefits

  • Multi-stop optimization

    Plan complex routes with minimal mileage, reducing costs and travel time.

  • Precise address mapping

    Turn incomplete addresses into exact coordinates, avoiding delivery errors.

  • Real-time traffic

    Adapt to changing road conditions for accurate, up-to-date arrival estimates.

  • High-volume scalability

    Handle thousands of addresses at once with no performance slowdowns.

  • Developer-friendly integration

    Straightforward REST APIs, robust docs, and quick support for seamless setup.

  • Transparent pricing & flexible plans

    No hidden fees or complex tiers — just simple per-request costs, volume discounts, and a free   start.

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!
Découvrez à quel point il est facile de migrer vers l'API Distance Matrix
Vous n'avez pas besoin de réécrire le code, il vous suffit de changer la clé API
Migrez en toute simplicité
En savoir plus

Why Distancematrix.ai?

quick response
Easy as 1-2-3 integration
Our clear, well-structured documentation and code snippets in popular programming languages make integration fast and straightforward, enabling you to swiftly enhance your operational capabilities and service efficiency.
global coverage
Worldwide coverage - we work wherever you work
Unlike many services operating only in Europe or America, we provide consistent quality worldwide. Verified by our customers from 100+ different countries.
global coverage
Developer support & documentation
Quickstarts, code samples, and a responsive support team ready to help you integrate, troubleshoot, and optimize.
Aucun prépaiement n'est nécessaire.
Démarrez gratuitement et passez à l'action
accès à tous les fichiers Distancematrix.ai
produits et fonctionnalités