google-maps/compute-route
Compute Routes is a method in the Routes API service that accepts an HTTPS request and returns the ideal route between two locations. Provide directions with real-time traffic for transit, biking, driving, 2-wheel motorized vehicles, or walking between multiple locations.
With the Routes API Compute Routes method, you can do the following things:
Get directions for different ways to travel, and for a single or multiple destinations:
Modes of transportation: transit, driving, two-wheel vehicles, walking, or bicycling.
A series of waypoints that you can optimize for the most efficient order in which to travel to them.
Use multiple ways to specify origins, destinations, and waypoints:
Text strings. For example: "Chicago, IL", "Darwin, NT, Australia", "1800 Amphitheatre Parkway, Mountain View, CA 94043", or "CWF6+FWX Mountain View, California"
Place IDs
Latitude and longitude coordinates, optionally with vehicle heading
Fine-tune your route options based on your needs and goals:
Select fuel or energy-efficient routes for your vehicle's engine type: Diesel, Electric, Hybrid, Gas. For more information, see Get an eco-friendly route.
Set fine-grained options for traffic calculation, letting you make quality versus latency trade off decisions. For details, see Specify how and if to include traffic data.
Set vehicle heading (direction of travel) and side-of-road information for waypoints to increase ETA accuracy. For details, see Specify vehicle heading and side of road.
Specify pass-through versus terminal locations and safe stopover locations. For details, see Set a stop along a route and Set a point for a route to pass through.
Request toll information, along with route distance and ETA. For details, see Calculate toll fees for a route.
Control your latency and quality by requesting only the data you need using a field mask, which helps you avoid unnecessary processing time and higher request billing rates. For details, see Choose what information to return.
reference: https://developers.google.com/maps/documentation/routes/compute-route-over provided by Google ©2025