Compare travel times
goplaces_route_matrixRank multiple destinations by travel time and distance from one or more origins in a single request, so you can compare options without separate directions calls.
Instructions
Rank destinations by travel time and distance from one or more origins in a single request. Use for 'which of these is closest to home' or 'how long to each of these three offices' instead of one directions call per candidate. Results are sorted fastest first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Travel mode. | drive |
| units | No | Localized distance units. | metric |
| region | No | Optional CLDR region code, for example 'US' or 'DE'. | |
| origins | Yes | Starting points as addresses, place names, or 'places/PLACE_ID' values. | |
| language | No | Optional BCP-47 language code, for example 'en' or 'en-US'. | |
| destinations | Yes | Destinations as addresses, place names, or 'places/PLACE_ID' values. | |
| departure_time | No | Optional RFC3339 departure time. Enables traffic-aware drive times. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | ||
| error | No | Present only on failure; the result is also flagged isError. | |
| results | No | One entry per origin/destination pair, fastest first. |