Route optimization reorders a set of stops into the best sequence for a single vehicle. You supply a start, a set of places to visit, and an end, and the API returns the order that gets the vehicle through all of them as quickly and cheaply as possible. The Stadia Maps Optimized Routing API describes this as the Traveling Salesman Problem: the endpoint reorders the intermediate destinations between the start and end into an optimal order for a single vehicle. It handles one vehicle. Fleet routing goes to the Time/Distance Matrix API instead, covered below.

Key Takeaways

  • Standard routing takes the locations in the order you send them. Optimized routing reorders the intermediate destinations between a fixed start and end.
  • It solves for a single vehicle. Fleet problems feed a time/distance matrix into a solver such as VROOM or OptaPlanner.
  • The endpoint is https://api.stadiamaps.com/optimized_route/v1, billed at 40 credits per request and available on Standard and Professional plans.
  • Limits are 50 locations per route, with a straight-line cap of 400km between all locations for auto, bus, truck, and taxi, and 200km for other modes.
  • It carries over the standard routing costing model, so truck restrictions, vehicle attributes, hill avoidance, and traffic-influenced profiles all apply.

What Problem Does Route Optimization Solve?

The Turn-by-Turn Directions product page describes optimized routing as building on standard routing, determining the most efficient sequence for multiple stops and calculating the optimal order to minimize travel time or distance. It names live delivery routes and multi-destination trips as the scenarios it suits.

The start and end are fixed, and only the stops between them are reordered. In the documented code sample the route begins and ends at the same location. Per the same page, the purpose is making deliveries and sales calls as quickly and cheaply as possible.

Route Optimization vs. Fleet Routing

Route optimization, the Traveling Salesman Problem. One vehicle, one sequence. The Optimized Routing API returns an ordered route directly, with geometry and instructions, in a single request.

Fleet routing, the Vehicle Routing Problem. Optimization across a fleet of vehicles rather than one. There is no single endpoint that answers this, and Stadia Maps does not claim one. Build a travel-time matrix first and hand it to a solver. The Time/Distance Matrix API works as input to solvers including VROOM and OptaPlanner.

The two reference pages point at each other on exactly this split. The optimized routing page sends fleet routing problems to the matrix API, and the matrix page sends single-vehicle optimization back the other way. What Is a Distance Matrix API? covers the matrix side, including element counts and how the cost scales.

Route Optimization vs. Standard Routing

Standard routing takes your locations in the order you give them. Optimized routing decides the order.

Standard routing is billed at 20 credits per request, optimized routing at 40.

Optimized routing has the same versatility as standard routing, and lists the same features: truck and bus access restrictions, vehicle attributes, highway and toll preferences, HOV passenger counts, hill avoidance, traffic-influenced profiles, and guidance in over 25 languages.

How Does a Route Optimization Request Work?

You send a list of locations and a costing model. The first and last entries are the start and end, and the intermediate destinations are the ones that get reordered.

  • locations: the stops, each with a latitude and longitude. The documented example lists a start, two intermediate stops, and the start again as the end point.
  • costing: the travel mode, such as auto, truck, bicycle, or pedestrian.
  • costing_options: vehicle-specific preferences, keyed by costing model. The same example sets useHighways to 0.3 under auto.
  • date_time: optional, with type 0 for depart now, 1 for depart at a given time, and 2 for arrive by a given time. The value is YYYY-MM-DDTHH:MM in local time at the location.
  • format: set to "osrm" if you are feeding a turn-by-turn navigation experience.

The endpoint is https://api.stadiamaps.com/optimized_route/v1. Official SDKs cover TypeScript, Python, Kotlin, Swift, and PHP, and EU-only requests go to api-eu.stadiamaps.com.

Optimized routing carries over the standard routing feature set: access restrictions for trucks, buses, golf carts, and other specialized vehicle types, vehicle attributes such as weight, height, width, and top speed, preferring or avoiding highways, toll roads, and ferries, passenger counts for HOV lane usage, hill avoidance for bicycles, motor scooters, and pedestrians, traffic-influenced routing, and support for guidance in over 25 languages.

What Does Route Optimization Cost?

Stadia Maps bills optimized routing at 40 credits per request, against 20 credits per request for standard routing. It is available on the Standard and Professional plans.

Traffic-influenced profiles add to that base cost rather than replacing it. A traffic-influenced profile adds 60 credits per request and a premium traffic-influenced profile adds 120, so an optimized route with a premium traffic profile costs 160 credits.

The Time/Distance Matrix is billed on a different basis, at 10 credits per element, where an element is one source-and-target pair. The service limits docs define matrix elements as the dimensions of the input multiplied together, so a request with three sources and five targets has 15 elements.

What Are the Limits?

Travel modeMax locations per routeMax straight-line distance between all locations
Automobile, bus, truck, taxi50400km
All other modes50200km

The distance limit is a b-line distance between all locations, measured straight-line across the set rather than along the route.

Standard routing shares the 50-location cap but carries much larger distance limits: 5000km for automobile, bus, truck, taxi, and motorcycle, 500km for bicycle, bikeshare, and motor scooter, and 250km for low speed vehicle and pedestrian.

Does Route Optimization Account for Traffic?

It can. Traffic-influenced profiles are available for auto, bus, taxi, and truck through the _traffic and _traffic_premium suffixes, so auto_traffic and truck_traffic_premium are both valid costing models. _traffic uses adaptive, heuristically-selected sources that balance accuracy against credit cost. _traffic_premium combines current conditions with predictive data for maximum accuracy.

Per the same page, optimal routes and ETAs vary by time of day and day of the week, and traffic-influenced profiles benefit most from an explicit date_time.

Traffic-influenced profiles require a Standard plan or higher. Premium traffic-influenced profiles are available on Professional only.

Where Route Optimization Falls Short

  • It handles one vehicle only. Fleet routing problems go to the Time/Distance Matrix API as solver input.
  • 50 locations is a hard ceiling, the same cap standard routing carries.
  • The start and end are fixed. You choose them, and the endpoint reorders only what sits between. Comparing options across a set of locations is a job for the Time/Distance Matrix API.
  • The distance caps apply across all locations at once. The 400km and 200km limits are measured between all locations, not per leg.
  • Coordinates in, not addresses. The API takes latitude and longitude, so an address list needs forward or structured geocoding first.

Common Route Optimization Use Cases

  • Live delivery routes. Named on the Turn-by-Turn Directions product page as a scenario optimized routing suits.
  • Multi-destination trips. The other scenario named on that page.
  • Sales calls. The Optimized Routing docs give deliveries and sales calls as the purpose the endpoint serves.
  • Specialized vehicles. Trucks, e-bikes, and low-speed vehicles each carry their own legal and physical constraints. That post covers the costing profiles behind this, including the golf cart and LSV work with Peachtree City, GA and The Villages, FL.

Frequently Asked Questions

What is route optimization?

Route optimization is the problem of finding the best order to visit a set of stops with a single vehicle, between a fixed start and end point. It is also known as the Traveling Salesman Problem. The Stadia Maps Optimized Routing API re-orders intermediate destinations into an optimal order for a single vehicle, returning a complete route with geometry and instructions in one request.

What is the difference between route optimization and fleet routing?

Route optimization solves for one vehicle: given a set of stops, what order should they be visited in? Fleet routing, or the vehicle routing problem, optimizes across a fleet of vehicles rather than one. Stadia Maps provides a dedicated optimized routing endpoint for the single-vehicle case. For fleet problems, the documented approach is the time/distance matrix API as input to a solver such as VROOM or OptaPlanner.

What is the difference between route optimization and standard routing?

Standard routing visits your locations in the order you supply them. Optimized routing decides the order for you, reordering the intermediate stops between a fixed start and end. Standard routing is billed at 20 credits per request and optimized routing at 40.

How many stops can a route optimization request handle?

The Stadia Maps optimized routing endpoint accepts up to 50 locations per route. There is also a straight-line distance limit measured across all locations: 400km for automobile, bus, truck, and taxi, and 200km for other travel modes.

How much does route optimization cost on Stadia Maps?

Optimized routing is billed at 40 credits per request on the unified credit pool, against 20 credits per request for standard routing. Traffic-influenced profiles add to that base cost: 60 credits per request for a traffic-influenced profile and 120 for a premium one, so an optimized route with a premium traffic profile costs 160 credits. Optimized routing is available on the Standard and Professional plans.

Does route optimization account for traffic?

Yes, through traffic-influenced profiles. The _traffic and _traffic_premium suffixes are available for auto, bus, taxi, and truck, so auto_traffic and truck_traffic_premium are valid costing models. Optimal routes and ETAs often vary by the time of day and day of the week, and traffic-influenced profiles benefit most from an explicit date_time. Traffic-influenced profiles require a Standard plan or higher, and premium traffic-influenced profiles are available on Professional only.

Can route optimization handle trucks and other specialized vehicles?

Yes. Optimized routing inherits the same costing model as standard routing, which includes access restrictions for trucks, buses, golf carts, and other specialized vehicle types, vehicle attributes such as weight, height, width, and top speed, highway, toll, and ferry preferences, passenger counts for HOV lanes, and hill avoidance for bicycles, motor scooters, and pedestrians.

Where to Go Next

From the Blog

Routing & Navigation