**European Economic Area (EEA) developers**

> [!NOTE]
> If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. Functionality varies by region. [Learn more](https://developers.google.com/maps/comms/eea/faq.md.txt).

Route Optimization is a Google Maps Platform API that generates optimized route
plans for single or multiple vehicles and their stops.

## Why use the Route Optimization API

Improve the operational efficiency of your transportation fleet with the help of
route plans. Adjust your routes for cost, time constraints, customer needs, and
any other business objective. For example:

![A screenshot of a map with three routes highlighted in different colors](https://developers.google.com/static/maps/documentation/route-optimization/images/route-optimization.webp "Road Optimization API")

- A **logistics company** can save time and resources by scheduling next-day shipments while optimizing the deliveries for time efficiency, cost saving, on-time delivery, and driver and end customer satisfaction.
- An **on-demand food delivery** company can make their dispatch process quicker and more effective by choosing the best active driver to pick up new orders and inserting them in their existing routes.
- A **field service provider** can improve their efficiency and customer satisfaction by assigning providers to appointments and finding the optimal stop sequence for more than one appointment, all while re-optimizing routes when challenges come up.

## What you can do with the Route Optimization API

Use Route Optimization API to optimize your fleet's routes and tasks
assignments based on your own *objectives* and
*constraints*.

- **Objectives:** Your business goals.
- **Constraints:** The limitations of your physical assets.

| Objectives || Constraints ||
|---|---|---|---|
| **Travel efficiency** | Optimize basic travel routes using parameters like distance and time-to-destination. | **Drivers work hours** | Assign routes to drivers based on their work hours and breaks. |
| **On-time arrival** | Prioritize a pickup, delivery, or service to arrive before a specific time. | **Vehicle capacity** | Assign a vehicle to a task based on the amount of load it can carry. |
| **Vehicle use cost** | Minimize the number of vehicles required to perform a task. | **Time windows** | Have a shipment or task arrive in a specific time slot. |
| **Load balancing** | Fairly distribute tasks across a fleet of vehicles and personnel. | **Dependencies and compatibility** | Optimize your fleet routes based on your types of vehicle, task sequence, or shipment conditions. |

## How the Route Optimization API works

The Route Optimization API can be accessed using [REST](https://developers.google.com/maps/documentation/route-optimization/reference/rest/v1/operations.md.txt), [gRPC](https://developers.google.com/maps/documentation/route-optimization/reference/rpc.md.txt), and [client
libraries](https://developers.google.com/maps/documentation/route-optimization/client-libraries), and it calculates the most efficient routes for your fleet.

Your request can be as simple as routing a single vehicle with a few drop-offs,
or as complex as detailing your entire company's workflow. The request defines
your unique routing model, which can include details such as:

- **Shipments:** The tasks that need to be completed, including pickup and delivery locations, service durations, and load sizes.
- **Vehicles:** The fleet available to complete the tasks, including travel modes, start and end locations, and carrying capacities.
- **Time constraints:** Precise time windows for shipments, as well as driver shift times and required breaks.
- **Cost parameters:** Factors that influence the optimization, such as cost per kilometer, cost per hour, and penalties for missed deliveries.

The service then returns an optimized route plan that respects every
constraint and objective you set. The response contains the calculated routes
and includes details such as:

- **Visit sequences:** The exact order of pickups and deliveries for each vehicle.
- **Assigned shipments:** Which vehicle is responsible for which task.
- **Estimated times:** Arrival and departure times for each visit, factoring in travel time and service duration.
- **Route metrics:** The total cost, total travel distance, and total time for the individual routes and the overall plan.

For more information about constructing a request and interpreting a response,
see [Make your first request](https://developers.google.com/maps/documentation/route-optimization/make-first-request.md.txt) and [Interpret the response](https://developers.google.com/maps/documentation/route-optimization/interpret-response.md.txt).

### Resources

The API offers four endpoints to handle different request sizes and
solve times. To learn how to pick the right one, see [Choose an
endpoint](https://developers.google.com/maps/documentation/route-optimization/endpoints).

| Endpoint | Description and data returned | Return format |
|---|---|---|
| `OptimizeTours` | A blocking endpoint for single requests with short solve times. Returns an optimized route directly in the response. | [JSON](https://developers.google.com/maps/documentation/route-optimization/reference/rest/v1/projects/optimizeTours.md.txt) or [gRPC proto](https://developers.google.com/maps/documentation/route-optimization/reference/rpc/google.maps.routeoptimization.v1.md.txt#google.maps.routeoptimization.v1.RouteOptimization.OptimizeTours) |
| `OptimizeToursLongRunning` | A non-blocking endpoint for single requests with long solve times. Returns a Long-Running Operation (LRO) ID. | [JSON](https://developers.google.com/maps/documentation/route-optimization/reference/rest/v1/projects/optimizeToursLongRunning.md.txt) or [gRPC proto](https://developers.google.com/maps/documentation/route-optimization/reference/rpc/google.maps.routeoptimization.v1.md.txt#google.maps.routeoptimization.v1.RouteOptimization.OptimizeToursLongRunning) |
| `OptimizeToursUri` | A non-blocking endpoint for single, large requests (\> 8MB). Reads from and writes directly to Google Cloud Storage. Returns a Long-Running Operation (LRO) ID. | [JSON](https://developers.google.com/maps/documentation/route-optimization/reference/rest/v1/projects/optimizeToursUri.md.txt) or [gRPC proto](https://developers.google.com/maps/documentation/route-optimization/reference/rpc/google.maps.routeoptimization.v1.md.txt#google.maps.routeoptimization.v1.RouteOptimization.OptimizeToursUri) |
| `BatchOptimizeTours` | A non-blocking endpoint to process multiple independent requests simultaneously using Google Cloud Storage. Returns a Long-Running Operation (LRO) ID. | [JSON](https://developers.google.com/maps/documentation/route-optimization/reference/rest/v1/projects/batchOptimizeTours.md.txt) or [gRPC proto](https://developers.google.com/maps/documentation/route-optimization/reference/rpc/google.maps.routeoptimization.v1.md.txt#google.maps.routeoptimization.v1.RouteOptimization.BatchOptimizeTours) |

## How to use the Route Optimization API

|---|---|---|
| 1 | **Get set up** | Start with [Set up your Google Cloud project](https://developers.google.com/maps/documentation/route-optimization/cloud-setup.md.txt) and complete the setup instructions that follow. |
| 2 | **Run a basic request and receive a response** | After setup, start with sending a basic request and get the response, following [Construct a Request](https://developers.google.com/maps/documentation/route-optimization/construct-request) and [Interpret the Response](https://developers.google.com/maps/documentation/route-optimization/interpret-response.md.txt). |
| 3 | **Try a more advanced scenario and start creating your own request** | Explore example scenarios starting with [Pickup and Delivery Stop Order Optimization](https://developers.google.com/maps/documentation/route-optimization/pickup-delivery-order-optimization.md.txt) and start building requests that match your use cases. |

### Available client libraries

For a list of the available client libraries for Route Optimization API, see
[Client Libraries](https://developers.google.com/maps/documentation/route-optimization/client-libraries.md.txt).

## What's next

- **Start using the Route Optimization API** : Go to [Run a Basic Request](https://developers.google.com/maps/documentation/route-optimization/make-first-request.md.txt).
- **Understand billing** : [Usage and Billing](https://developers.google.com/maps/documentation/route-optimization/usage-and-billing.md.txt)
- **See sample code and libraries** : [Client Libraries](https://developers.google.com/maps/documentation/route-optimization/client-libraries.md.txt) and [Open Source](https://github.com/googleapis/google-cloud-java/tree/main/java-maps-routeoptimization).
- **Follow best practices** : [Best Practices Using Route Optimization API Web
  Services](https://developers.google.com/maps/documentation/route-optimization/web-service-best-practices)