The Travel Matrix API computes distances and ETAs between a set of origins and destinations—could be for one-to-many or many-to-many scenarios. The API call returns a matrix of ETAs and distances for each origin and destination pair.
For example, if a set has Origins {A,B} and Destinations {C,D,E} we can get the following matrix of results with distance (meters) and time (seconds) for each.
| C | D | E | |
|---|---|---|---|
| A | A -> C | A -> D | A -> E |
| B | B -> C | B -> D | B -> E |
This API offers the following features for customizing computations:
- Scalable Computations: Compute ETAs and distances for up to 10 x 10 origins and destinations for high-volume use cases.
- Real-time and Historical Traffic: Generate distance and ETA matrices based on both real-time and historical traffic conditions.
- Customizable Route Preferences: Choose from preferences for avoiding or excluding routes with tolls, highways, left turns, right turns, service roads. Alternatively, always calculate routes with curbside stops, or prefer routes for specific truck types.
- Support for multiple travel modes: Compute routes suitable for various travel modes: walk, bicycle, motorbike, car, and truck.
- Truck-Specific Features: Incorporate truck-specific parameters such as weight, size, axle load distribution, hazardous cargo, and emission classification.
- Optimal Route Selection: Choose between "fastest" and "shortest" route types to obtain corresponding ETAs and distances.
This API offers ETAs and distances that account for real-time traffic conditions. It also supports truck-specific features such as truck weight, size, hazardous cargo, and emission classification. You can set a specific departure time to simulate typical traffic conditions and choose between the 'fastest' or 'shortest' route type, or routes that always arrive curbside. These features prove highly beneficial in addressing business challenges requiring accuracy, customizations and support for advanced constraints across diverse industries, including NEMT, ride-hailing, logistics, and waste management.
This API supports both HTTPS GET and POST methods. The parameters, request URL and response schema are exactly the same for both methods. However, an important difference between these methods is the size of the origins and destinations sets that can be shared in the input.