Announcing Routes API: the new enhanced version of the Directions and Distance Matrix APIs
Product Manager, Google Maps Platform
Try Google Maps Platform
Unlock access to real world data and insights with a monthly $200 Google Maps Platform credit.Get started
For over a decade, our Directions and Distance Matrix APIs have helped you quickly and efficiently route people and goods from A to B. And in the last few years, we’ve worked closely with the largest operators in the transportation and logistics industries to help them improve customer experiences and delivery operations at scale via our Mobility services. By popular demand, we’re opening many of these advanced routing capabilities to all Google Maps Platform developers in the countries where they’re available.
Today, we’re announcing the Preview release of the new Routes API, an enhanced version of the Directions and Distance Matrix APIs that combines both of these into a single service, and enables you to provide more informative and flexible routes for your users.
The new Routes API builds on the foundational features of the Directions and Distance Matrix APIs that your business relies on, like comprehensive, up-to-date directions with real-time traffic, and calculating distances and ETAs for matrices of origin and destination combinations. But it also offers new advanced features so you can provide more informative, flexible routes and improved ETA accuracy, including:
2-wheel routes for motorized vehicles (coverage)
Tolls data for more accurate pricing on how much a route costs (coverage)
Real-time traffic information along each segment of a route
Specifying whether a waypoint is a pass through location or a stopping point
Fine-tuned controls for reducing latency
Eco-friendly routing (coming later this year)
Starting today, you can access the new Routes API. You can also still access the existing Directions API and Distance Matrix API, but you’ll get additional capabilities and enhanced performance with the Routes API. Let’s take a closer look at what you can do with this new API.
Deliver more informative, flexible routes
Two-wheel motorized vehicle support
In many parts of the world, two-wheel motorized vehicles are the most common form of transportation for everything from delivery to ridesharing to everyday travel. The new Routes API gives you the ability to request directions and distance matrix calculations for this mode of transportation, and takes a variety of factors into account, such as whether toll roads, highways, and ferries can be avoided, and routing along paths that are not accessible to cars.
A representative mock up showing a 2-wheel motorized vehicle route with toll data
With the new Routes API, you now also have access to a new critical piece of data that can have a significant financial impact on you and your users: toll calculations. For both directions and distance matrix requests, you can now request toll calculations to help make informed decisions about tradeoffs between time and cost. Tolls data provides more accurate pricing on how much your route would cost, taking into consideration vehicle type (e.g. EV/hybrid) and type of electronic toll pass.
A representative mock up showing routes using tolls data
A representative mock up showing routes using tolls data
Improved traffic and polyline capabilities
Traffic is one of the largest factors affecting routing decisions, whether you’re a consumer or a business. The new Routes API allows you to specify whether live or historical traffic should be taken into account in route calculations. It also gives you control over tradeoffs between traffic and polyline quality and latency.
In addition, you can request traffic information along each leg of a route, which enables you to create richer experiences for your users like representing traffic with color-coded polylines. Routes can also be styled on a map using advanced polyline styling, which supports custom coloring, strokes and patterns along polyline stretches.
A representative mock up showing real-time traffic along each leg of a route
Fine-tuned controls to reduce latency
The new Routes API introduces additional options for improving the performance of your app. It is even more performant than the existing Directions and Distance Matrix APIs, and provides features that allow you to make tradeoffs between comprehensive accuracy and reduced latency. With field masking, you can choose which fields are returned in the API response, such as ETA, distance in meters, traffic conditions, and more. This allows you to decrease response payload sizes and simplify the response, making it easier to process.
Improve ETA accuracy with smarter, more flexible waypoints
The new Routes API also improves ETA accuracy with smarter waypoints. Intermediate waypoints allow you to specify whether the user will pass through or stop at a waypoint, to improve travel time calculations. This is also particularly useful for pick-up and drop-off use cases, as it ensures the user won’t be directed to a location where stopping is unsafe, such as a tunnel or highway. In addition, you can specify the appropriate side of the road for a waypoint, or the vehicle’s current or desired direction of travel on each waypoint, which can help ensure that events like pick-ups and drop-offs are routed to the right location.
A representative mock up of a route that stops the driver in a tunnel, where stopping is unsafe
A representative mock up of an intermediate waypoint which stops the driver on a nearby side street away from the tunnel
We’ve also increased the number of origin and destination points for distance matrix requests–with the Routes API, we have removed the limitation of 25 origin and 25 destination points, and you can now set up to 625 total returned elements, allowing more flexibility.
Coming soon: Make more sustainable choices with eco-friendly routing
In the coming months, we will be bringing eco-friendly routing to developers – helping you find routes that are optimized for lower fuel consumption, using insights from the US Department of Energy’s National Renewable Energy Laboratory and data from the European Environment Agency. The most fuel-efficient route will vary based on real-time traffic and what type of engine you have. Drivers using eco-friendly routing can select their engine type — petrol or gas, diesel, hybrid or electric vehicle (EV) — in order to get the best route and most accurate fuel or energy efficiency estimates.
For example, delivery companies or ridesharing services can measure fuel consumption and savings for a single trip, multiple trips, or even across their entire fleet to improve their business performance. Eco-friendly routing will be available in Preview in the coming months, wherever it’s available on Google Maps. Sign up to receive updates.
A representative mock up that shows an eco-friendly route, along with estimated fuel savings
The Routes API is currently in Preview, and customers will not be billed for usage during this time. More information on pricing will be shared when Routes API is generally available. The pricing for the existing Directions and Distance Matrix APIs is unchanged, and can be found on our pricing page.
Whether your goal is to build better experiences for your users, or make more informed, accurate decisions for your business based on Google’s knowledge of the real world, we built these APIs to give you the features and performance you need to solve a wide variety of use cases.