---
title: "Calculate an optimized route between a known start and end point."
method: POST
path: "/optimized_route/v1"
tags: ["Routing"]
---

# Calculate an optimized route between a known start and end point.

`POST /optimized_route/v1`

The optimized route API is a mix of the matrix and normal route API. For an optimized route, the start and end point are fixed, but the intermediate points will be re-ordered to form an optimal route visiting all nodes once.

## Request body

- OptimizedRouteRequest
  - `id` string — An identifier to disambiguate requests (echoed by the server).
  - `locations` Coordinate[], required — The list of locations. The first and last are assumed to be the start and end points, and all intermediate points are locations that you want to visit along the way.
    - `lat` number, double, required — The latitude of a point in the shape.
    - `lon` number, double, required — The longitude of a point in the shape.
  - `costing` 'auto' | 'auto_traffic' | 'auto_traffic_premium' | 'bus' | 'bus_traffic' | 'bus_traffic_premium' | 'taxi' | 'taxi_traffic' | 'taxi_traffic_premium' | 'truck' | 'truck_traffic' | 'truck_traffic_premium' | 'bicycle' | 'bikeshare' | 'motor_scooter' | 'motorcycle' | 'pedestrian' | 'low_speed_vehicle', required
  - `costing_options` CostingOptions
    - `auto` AutoCostingOptions
      - `maneuver_penalty` integer — A penalty (in seconds) applied when transitioning between roads (determined by name).
      - `gate_cost` integer — The estimated cost (in seconds) when a gate is encountered.
      - `gate_penalty` integer — A penalty (in seconds) applied to the route cost when a gate is encountered. This penalty can be used to reduce the likelihood of suggesting a route with gates unless absolutely necessary.
      - `country_crossing_cost` integer — The estimated cost (in seconds) when encountering an international border.
      - `country_crossing_penalty` integer — A penalty applied to transitions to international border crossings. This penalty can be used to reduce the likelihood of suggesting a route with border crossings unless absolutely necessary.
      - `service_penalty` integer — A penalty applied to transitions to service roads. This penalty can be used to reduce the likelihood of suggesting a route with service roads unless absolutely necessary. The default penalty is 15 for cars, busses, motor scooters, and motorcycles; and zero for others.
      - `service_factor` number, double — A factor that multiplies the cost when service roads are encountered. The default is 1.2 for cars and busses, and 1 for trucks, motor scooters, and motorcycles.
      - `use_living_streets` number, double — A measure of willingness to take living streets. Values near 0 attempt to avoid them, and values near 1 will favour them. Note that as some routes may be impossible without living streets, 0 does not guarantee avoidance of them. The default value is 0 for trucks; 0.1 for other motor vehicles; 0.5 for bicycles; and 0.6 for pedestrians.
      - `use_ferry` number, double — A measure of willingness to take ferries. Values near 0 attempt to avoid ferries, and values near 1 will favour them. Note that as some routes may be impossible without ferries, 0 does not guarantee avoidance of them.
      - `ignore_restrictions` boolean — If set to true, ignores any restrictions (eg: turn and conditional restrictions). Useful for matching GPS traces to the road network regardless of restrictions.
      - `ignore_non_vehicular_restrictions` boolean — If set to true, ignores most restrictions (eg: turn and conditional restrictions), but still respects restrictions that impact vehicle safety such as weight and size.
      - `ignore_oneways` boolean — If set to true, ignores directional restrictions on roads. Useful for matching GPS traces to the road network regardless of restrictions.
      - `private_access_penalty` number, double — A penalty (in seconds) for accessing private roads.
      - `alley_penalty` number, double — A penalty (in seconds) for using alleys.
      - `rail_ferry_cost` integer — The estimated cost (in seconds) when a rail ferry is encountered. Only applies to costing models that support rail ferries (auto, truck, motorcycle).
      - `use_rail_ferry` number, double — A measure of willingness to take rail ferries. Values near 0 attempt to avoid rail ferries, and values near 1 will favor them. Note that as some routes may be impossible without rail ferries, 0 does not guarantee avoidance of them. Only applies to auto, truck, and motorcycle costing.
      - `ignore_access` boolean — If set to true, ignores access restrictions for the route.
      - `ferry_cost` integer — The estimated cost (in seconds) when a ferry is encountered.
      - `height` number, double — The height of the automobile (in meters).
      - `width` number, double — The width of the automobile (in meters).
      - `toll_booth_cost` integer — The estimated cost (in seconds) when a toll booth is encountered.
      - `toll_booth_penalty` integer — A penalty (in seconds) applied to the route cost when a toll booth is encountered. This penalty can be used to reduce the likelihood of suggesting a route with toll booths unless absolutely necessary.
      - `exclude_cash_only_tolls` boolean — If true, avoids routes with cash-only tolls.
      - `exclude_unpaved` boolean — Indicates whether or not the path may include unpaved roads. If true, the route is allowed to start and end with unpaved roads, but is not allowed to have them in the middle of the route path. Otherwise they are allowed.
      - `use_highways` number, double — A measure of willingness to take highways. Values near 0 attempt to avoid highways, and values near 1 will favour them. Note that as some routes may be impossible without highways, 0 does not guarantee avoidance of them.
      - `use_tolls` number, double — A measure of willingness to take toll roads. Values near 0 attempt to avoid tolls, and values near 1 will favour them. Note that as some routes may be impossible without tolls, 0 does not guarantee avoidance of them.
      - `use_tracks` number, double — A measure of willingness to take track roads. Values near 0 attempt to avoid them, and values near 1 will favour them. Note that as some routes may be impossible without track roads, 0 does not guarantee avoidance of them. The default value is 0 for automobiles, busses, and trucks; and 0.5 for all other costing modes.
      - `top_speed` integer — The top speed (in kph) that the vehicle is capable of travelling.
      - `shortest` boolean — If true changes the cost metric to be quasi-shortest (pure distance-based) costing. This will disable ALL other costing factors.
      - `ignore_closures` boolean — If true, ignores all known closures. This option cannot be set if `location.search_filter.exclude_closures` is also specified.
      - `include_hov2` boolean — If true, indicates the desire to include HOV roads with a 2-occupant requirement in the route when advantageous.
      - `include_hov3` boolean — If true, indicates the desire to include HOV roads with a 3-occupant requirement in the route when advantageous.
      - `include_hot` boolean — If true, indicates the desire to include toll roads which require the driver to pay a toll if the occupant requirement isn't met
      - `alley_factor` number, double — A factor that multiplies the cost when alleys are encountered.
      - `use_distance` number, double — A measure of preference for time vs. distance. Values near 0 (default) optimize for time, while values near 1 optimize for shortest distance.
      - `closure_factor` number, double — A factor that penalizes the cost of traversing closed edges. The value is a multiplier on the cost of a closed edge; higher values make closed edges less likely to be used.
    - `bus` AutoCostingOptions
      - `maneuver_penalty` integer — A penalty (in seconds) applied when transitioning between roads (determined by name).
      - `gate_cost` integer — The estimated cost (in seconds) when a gate is encountered.
      - `gate_penalty` integer — A penalty (in seconds) applied to the route cost when a gate is encountered. This penalty can be used to reduce the likelihood of suggesting a route with gates unless absolutely necessary.
      - `country_crossing_cost` integer — The estimated cost (in seconds) when encountering an international border.
      - `country_crossing_penalty` integer — A penalty applied to transitions to international border crossings. This penalty can be used to reduce the likelihood of suggesting a route with border crossings unless absolutely necessary.
      - `service_penalty` integer — A penalty applied to transitions to service roads. This penalty can be used to reduce the likelihood of suggesting a route with service roads unless absolutely necessary. The default penalty is 15 for cars, busses, motor scooters, and motorcycles; and zero for others.
      - `service_factor` number, double — A factor that multiplies the cost when service roads are encountered. The default is 1.2 for cars and busses, and 1 for trucks, motor scooters, and motorcycles.
      - `use_living_streets` number, double — A measure of willingness to take living streets. Values near 0 attempt to avoid them, and values near 1 will favour them. Note that as some routes may be impossible without living streets, 0 does not guarantee avoidance of them. The default value is 0 for trucks; 0.1 for other motor vehicles; 0.5 for bicycles; and 0.6 for pedestrians.
      - `use_ferry` number, double — A measure of willingness to take ferries. Values near 0 attempt to avoid ferries, and values near 1 will favour them. Note that as some routes may be impossible without ferries, 0 does not guarantee avoidance of them.
      - `ignore_restrictions` boolean — If set to true, ignores any restrictions (eg: turn and conditional restrictions). Useful for matching GPS traces to the road network regardless of restrictions.
      - `ignore_non_vehicular_restrictions` boolean — If set to true, ignores most restrictions (eg: turn and conditional restrictions), but still respects restrictions that impact vehicle safety such as weight and size.
      - `ignore_oneways` boolean — If set to true, ignores directional restrictions on roads. Useful for matching GPS traces to the road network regardless of restrictions.
      - `private_access_penalty` number, double — A penalty (in seconds) for accessing private roads.
      - `alley_penalty` number, double — A penalty (in seconds) for using alleys.
      - `rail_ferry_cost` integer — The estimated cost (in seconds) when a rail ferry is encountered. Only applies to costing models that support rail ferries (auto, truck, motorcycle).
      - `use_rail_ferry` number, double — A measure of willingness to take rail ferries. Values near 0 attempt to avoid rail ferries, and values near 1 will favor them. Note that as some routes may be impossible without rail ferries, 0 does not guarantee avoidance of them. Only applies to auto, truck, and motorcycle costing.
      - `ignore_access` boolean — If set to true, ignores access restrictions for the route.
      - `ferry_cost` integer — The estimated cost (in seconds) when a ferry is encountered.
      - `height` number, double — The height of the automobile (in meters).
      - `width` number, double — The width of the automobile (in meters).
      - `toll_booth_cost` integer — The estimated cost (in seconds) when a toll booth is encountered.
      - `toll_booth_penalty` integer — A penalty (in seconds) applied to the route cost when a toll booth is encountered. This penalty can be used to reduce the likelihood of suggesting a route with toll booths unless absolutely necessary.
      - `exclude_cash_only_tolls` boolean — If true, avoids routes with cash-only tolls.
      - `exclude_unpaved` boolean — Indicates whether or not the path may include unpaved roads. If true, the route is allowed to start and end with unpaved roads, but is not allowed to have them in the middle of the route path. Otherwise they are allowed.
      - `use_highways` number, double — A measure of willingness to take highways. Values near 0 attempt to avoid highways, and values near 1 will favour them. Note that as some routes may be impossible without highways, 0 does not guarantee avoidance of them.
      - `use_tolls` number, double — A measure of willingness to take toll roads. Values near 0 attempt to avoid tolls, and values near 1 will favour them. Note that as some routes may be impossible without tolls, 0 does not guarantee avoidance of them.
      - `use_tracks` number, double — A measure of willingness to take track roads. Values near 0 attempt to avoid them, and values near 1 will favour them. Note that as some routes may be impossible without track roads, 0 does not guarantee avoidance of them. The default value is 0 for automobiles, busses, and trucks; and 0.5 for all other costing modes.
      - `top_speed` integer — The top speed (in kph) that the vehicle is capable of travelling.
      - `shortest` boolean — If true changes the cost metric to be quasi-shortest (pure distance-based) costing. This will disable ALL other costing factors.
      - `ignore_closures` boolean — If true, ignores all known closures. This option cannot be set if `location.search_filter.exclude_closures` is also specified.
      - `include_hov2` boolean — If true, indicates the desire to include HOV roads with a 2-occupant requirement in the route when advantageous.
      - `include_hov3` boolean — If true, indicates the desire to include HOV roads with a 3-occupant requirement in the route when advantageous.
      - `include_hot` boolean — If true, indicates the desire to include toll roads which require the driver to pay a toll if the occupant requirement isn't met
      - `alley_factor` number, double — A factor that multiplies the cost when alleys are encountered.
      - `use_distance` number, double — A measure of preference for time vs. distance. Values near 0 (default) optimize for time, while values near 1 optimize for shortest distance.
      - `closure_factor` number, double — A factor that penalizes the cost of traversing closed edges. The value is a multiplier on the cost of a closed edge; higher values make closed edges less likely to be used.
    - `taxi` AutoCostingOptions
      - `maneuver_penalty` integer — A penalty (in seconds) applied when transitioning between roads (determined by name).
      - `gate_cost` integer — The estimated cost (in seconds) when a gate is encountered.
      - `gate_penalty` integer — A penalty (in seconds) applied to the route cost when a gate is encountered. This penalty can be used to reduce the likelihood of suggesting a route with gates unless absolutely necessary.
      - `country_crossing_cost` integer — The estimated cost (in seconds) when encountering an international border.
      - `country_crossing_penalty` integer — A penalty applied to transitions to international border crossings. This penalty can be used to reduce the likelihood of suggesting a route with border crossings unless absolutely necessary.
      - `service_penalty` integer — A penalty applied to transitions to service roads. This penalty can be used to reduce the likelihood of suggesting a route with service roads unless absolutely necessary. The default penalty is 15 for cars, busses, motor scooters, and motorcycles; and zero for others.
      - `service_factor` number, double — A factor that multiplies the cost when service roads are encountered. The default is 1.2 for cars and busses, and 1 for trucks, motor scooters, and motorcycles.
      - `use_living_streets` number, double — A measure of willingness to take living streets. Values near 0 attempt to avoid them, and values near 1 will favour them. Note that as some routes may be impossible without living streets, 0 does not guarantee avoidance of them. The default value is 0 for trucks; 0.1 for other motor vehicles; 0.5 for bicycles; and 0.6 for pedestrians.
      - `use_ferry` number, double — A measure of willingness to take ferries. Values near 0 attempt to avoid ferries, and values near 1 will favour them. Note that as some routes may be impossible without ferries, 0 does not guarantee avoidance of them.
      - `ignore_restrictions` boolean — If set to true, ignores any restrictions (eg: turn and conditional restrictions). Useful for matching GPS traces to the road network regardless of restrictions.
      - `ignore_non_vehicular_restrictions` boolean — If set to true, ignores most restrictions (eg: turn and conditional restrictions), but still respects restrictions that impact vehicle safety such as weight and size.
      - `ignore_oneways` boolean — If set to true, ignores directional restrictions on roads. Useful for matching GPS traces to the road network regardless of restrictions.
      - `private_access_penalty` number, double — A penalty (in seconds) for accessing private roads.
      - `alley_penalty` number, double — A penalty (in seconds) for using alleys.
      - `rail_ferry_cost` integer — The estimated cost (in seconds) when a rail ferry is encountered. Only applies to costing models that support rail ferries (auto, truck, motorcycle).
      - `use_rail_ferry` number, double — A measure of willingness to take rail ferries. Values near 0 attempt to avoid rail ferries, and values near 1 will favor them. Note that as some routes may be impossible without rail ferries, 0 does not guarantee avoidance of them. Only applies to auto, truck, and motorcycle costing.
      - `ignore_access` boolean — If set to true, ignores access restrictions for the route.
      - `ferry_cost` integer — The estimated cost (in seconds) when a ferry is encountered.
      - `height` number, double — The height of the automobile (in meters).
      - `width` number, double — The width of the automobile (in meters).
      - `toll_booth_cost` integer — The estimated cost (in seconds) when a toll booth is encountered.
      - `toll_booth_penalty` integer — A penalty (in seconds) applied to the route cost when a toll booth is encountered. This penalty can be used to reduce the likelihood of suggesting a route with toll booths unless absolutely necessary.
      - `exclude_cash_only_tolls` boolean — If true, avoids routes with cash-only tolls.
      - `exclude_unpaved` boolean — Indicates whether or not the path may include unpaved roads. If true, the route is allowed to start and end with unpaved roads, but is not allowed to have them in the middle of the route path. Otherwise they are allowed.
      - `use_highways` number, double — A measure of willingness to take highways. Values near 0 attempt to avoid highways, and values near 1 will favour them. Note that as some routes may be impossible without highways, 0 does not guarantee avoidance of them.
      - `use_tolls` number, double — A measure of willingness to take toll roads. Values near 0 attempt to avoid tolls, and values near 1 will favour them. Note that as some routes may be impossible without tolls, 0 does not guarantee avoidance of them.
      - `use_tracks` number, double — A measure of willingness to take track roads. Values near 0 attempt to avoid them, and values near 1 will favour them. Note that as some routes may be impossible without track roads, 0 does not guarantee avoidance of them. The default value is 0 for automobiles, busses, and trucks; and 0.5 for all other costing modes.
      - `top_speed` integer — The top speed (in kph) that the vehicle is capable of travelling.
      - `shortest` boolean — If true changes the cost metric to be quasi-shortest (pure distance-based) costing. This will disable ALL other costing factors.
      - `ignore_closures` boolean — If true, ignores all known closures. This option cannot be set if `location.search_filter.exclude_closures` is also specified.
      - `include_hov2` boolean — If true, indicates the desire to include HOV roads with a 2-occupant requirement in the route when advantageous.
      - `include_hov3` boolean — If true, indicates the desire to include HOV roads with a 3-occupant requirement in the route when advantageous.
      - `include_hot` boolean — If true, indicates the desire to include toll roads which require the driver to pay a toll if the occupant requirement isn't met
      - `alley_factor` number, double — A factor that multiplies the cost when alleys are encountered.
      - `use_distance` number, double — A measure of preference for time vs. distance. Values near 0 (default) optimize for time, while values near 1 optimize for shortest distance.
      - `closure_factor` number, double — A factor that penalizes the cost of traversing closed edges. The value is a multiplier on the cost of a closed edge; higher values make closed edges less likely to be used.
    - `truck` TruckCostingOptions
      - `maneuver_penalty` integer — A penalty (in seconds) applied when transitioning between roads (determined by name).
      - `gate_cost` integer — The estimated cost (in seconds) when a gate is encountered.
      - `gate_penalty` integer — A penalty (in seconds) applied to the route cost when a gate is encountered. This penalty can be used to reduce the likelihood of suggesting a route with gates unless absolutely necessary.
      - `country_crossing_cost` integer — The estimated cost (in seconds) when encountering an international border.
      - `country_crossing_penalty` integer — A penalty applied to transitions to international border crossings. This penalty can be used to reduce the likelihood of suggesting a route with border crossings unless absolutely necessary.
      - `service_penalty` integer — A penalty applied to transitions to service roads. This penalty can be used to reduce the likelihood of suggesting a route with service roads unless absolutely necessary. The default penalty is 15 for cars, busses, motor scooters, and motorcycles; and zero for others.
      - `service_factor` number, double — A factor that multiplies the cost when service roads are encountered. The default is 1.2 for cars and busses, and 1 for trucks, motor scooters, and motorcycles.
      - `use_living_streets` number, double — A measure of willingness to take living streets. Values near 0 attempt to avoid them, and values near 1 will favour them. Note that as some routes may be impossible without living streets, 0 does not guarantee avoidance of them. The default value is 0 for trucks; 0.1 for other motor vehicles; 0.5 for bicycles; and 0.6 for pedestrians.
      - `use_ferry` number, double — A measure of willingness to take ferries. Values near 0 attempt to avoid ferries, and values near 1 will favour them. Note that as some routes may be impossible without ferries, 0 does not guarantee avoidance of them.
      - `ignore_restrictions` boolean — If set to true, ignores any restrictions (eg: turn and conditional restrictions). Useful for matching GPS traces to the road network regardless of restrictions.
      - `ignore_non_vehicular_restrictions` boolean — If set to true, ignores most restrictions (eg: turn and conditional restrictions), but still respects restrictions that impact vehicle safety such as weight and size.
      - `ignore_oneways` boolean — If set to true, ignores directional restrictions on roads. Useful for matching GPS traces to the road network regardless of restrictions.
      - `private_access_penalty` number, double — A penalty (in seconds) for accessing private roads.
      - `alley_penalty` number, double — A penalty (in seconds) for using alleys.
      - `rail_ferry_cost` integer — The estimated cost (in seconds) when a rail ferry is encountered. Only applies to costing models that support rail ferries (auto, truck, motorcycle).
      - `use_rail_ferry` number, double — A measure of willingness to take rail ferries. Values near 0 attempt to avoid rail ferries, and values near 1 will favor them. Note that as some routes may be impossible without rail ferries, 0 does not guarantee avoidance of them. Only applies to auto, truck, and motorcycle costing.
      - `ignore_access` boolean — If set to true, ignores access restrictions for the route.
      - `ferry_cost` integer — The estimated cost (in seconds) when a ferry is encountered.
      - `height` number, double — The height of the truck (in meters).
      - `width` number, double — The width of the truck (in meters).
      - `toll_booth_cost` integer — The estimated cost (in seconds) when a toll booth is encountered.
      - `toll_booth_penalty` integer — A penalty (in seconds) applied to the route cost when a toll booth is encountered. This penalty can be used to reduce the likelihood of suggesting a route with toll booths unless absolutely necessary.
      - `exclude_cash_only_tolls` boolean — If true, avoids routes with cash-only tolls.
      - `exclude_unpaved` boolean — Indicates whether or not the path may include unpaved roads. If true, the route is allowed to start and end with unpaved roads, but is not allowed to have them in the middle of the route path. Otherwise they are allowed.
      - `use_highways` number, double — A measure of willingness to take highways. Values near 0 attempt to avoid highways, and values near 1 will favour them. Note that as some routes may be impossible without highways, 0 does not guarantee avoidance of them.
      - `use_tolls` number, double — A measure of willingness to take toll roads. Values near 0 attempt to avoid tolls, and values near 1 will favour them. Note that as some routes may be impossible without tolls, 0 does not guarantee avoidance of them.
      - `use_tracks` number, double — A measure of willingness to take track roads. Values near 0 attempt to avoid them, and values near 1 will favour them. Note that as some routes may be impossible without track roads, 0 does not guarantee avoidance of them. The default value is 0 for automobiles, busses, and trucks; and 0.5 for all other costing modes.
      - `top_speed` integer — The top speed (in kph) that the vehicle is capable of travelling.
      - `shortest` boolean — If true changes the cost metric to be quasi-shortest (pure distance-based) costing. This will disable ALL other costing factors.
      - `ignore_closures` boolean — If true, ignores all known closures. This option cannot be set if `location.search_filter.exclude_closures` is also specified.
      - `include_hov2` boolean — If true, indicates the desire to include HOV roads with a 2-occupant requirement in the route when advantageous.
      - `include_hov3` boolean — If true, indicates the desire to include HOV roads with a 3-occupant requirement in the route when advantageous.
      - `include_hot` boolean — If true, indicates the desire to include toll roads which require the driver to pay a toll if the occupant requirement isn't met
      - `alley_factor` number, double — A factor that multiplies the cost when alleys are encountered.
      - `use_distance` number, double — A measure of preference for time vs. distance. Values near 0 (default) optimize for time, while values near 1 optimize for shortest distance.
      - `closure_factor` number, double — A factor that penalizes the cost of traversing closed edges. The value is a multiplier on the cost of a closed edge; higher values make closed edges less likely to be used.
      - `length` number, double — The length of the truck (in meters).
      - `weight` number, double — The weight of the truck (in tonnes).
      - `axle_load` number, double — The axle load of the truck (in tonnes).
      - `hazmat` boolean — Whether or not the truck is carrying hazardous materials.
      - `axle_count` integer — The number of axles on the truck.
      - `low_class_penalty` number, double — A penalty (in seconds) for using residential or service roads.
      - `use_truck_route` number, double — A measure of preference for using designated truck routes. Values near 0 (default) have no preference, while values near 1 strongly prefer truck routes.
      - `hgv_no_access_penalty` number, double — A penalty (in seconds) applied to roads which do not allow HGVs. This adds a penalty rather than outright blocking, allowing the router to still use these roads if no better alternative exists. The default penalty is sufficiently high.
    - `bicycle` BicycleCostingOptions
      - `maneuver_penalty` integer — A penalty (in seconds) applied when transitioning between roads (determined by name).
      - `gate_cost` integer — The estimated cost (in seconds) when a gate is encountered.
      - `gate_penalty` integer — A penalty (in seconds) applied to the route cost when a gate is encountered. This penalty can be used to reduce the likelihood of suggesting a route with gates unless absolutely necessary.
      - `country_crossing_cost` integer — The estimated cost (in seconds) when encountering an international border.
      - `country_crossing_penalty` integer — A penalty applied to transitions to international border crossings. This penalty can be used to reduce the likelihood of suggesting a route with border crossings unless absolutely necessary.
      - `service_penalty` integer — A penalty applied to transitions to service roads. This penalty can be used to reduce the likelihood of suggesting a route with service roads unless absolutely necessary. The default penalty is 15 for cars, busses, motor scooters, and motorcycles; and zero for others.
      - `service_factor` number, double — A factor that multiplies the cost when service roads are encountered. The default is 1.2 for cars and busses, and 1 for trucks, motor scooters, and motorcycles.
      - `use_living_streets` number, double — A measure of willingness to take living streets. Values near 0 attempt to avoid them, and values near 1 will favour them. Note that as some routes may be impossible without living streets, 0 does not guarantee avoidance of them. The default value is 0 for trucks; 0.1 for other motor vehicles; 0.5 for bicycles; and 0.6 for pedestrians.
      - `use_ferry` number, double — A measure of willingness to take ferries. Values near 0 attempt to avoid ferries, and values near 1 will favour them. Note that as some routes may be impossible without ferries, 0 does not guarantee avoidance of them.
      - `ignore_restrictions` boolean — If set to true, ignores any restrictions (eg: turn and conditional restrictions). Useful for matching GPS traces to the road network regardless of restrictions.
      - `ignore_non_vehicular_restrictions` boolean — If set to true, ignores most restrictions (eg: turn and conditional restrictions), but still respects restrictions that impact vehicle safety such as weight and size.
      - `ignore_oneways` boolean — If set to true, ignores directional restrictions on roads. Useful for matching GPS traces to the road network regardless of restrictions.
      - `private_access_penalty` number, double — A penalty (in seconds) for accessing private roads.
      - `alley_penalty` number, double — A penalty (in seconds) for using alleys.
      - `rail_ferry_cost` integer — The estimated cost (in seconds) when a rail ferry is encountered. Only applies to costing models that support rail ferries (auto, truck, motorcycle).
      - `use_rail_ferry` number, double — A measure of willingness to take rail ferries. Values near 0 attempt to avoid rail ferries, and values near 1 will favor them. Note that as some routes may be impossible without rail ferries, 0 does not guarantee avoidance of them. Only applies to auto, truck, and motorcycle costing.
      - `ignore_access` boolean — If set to true, ignores access restrictions for the route.
      - `ferry_cost` integer — The estimated cost (in seconds) when a ferry is encountered.
      - `bicycle_type` 'Road' | 'Hybrid' | 'Cross' | 'Mountain' — The type of bicycle: * Road: has narrow tires and is generally lightweight and designed for speed on paved surfaces * Hybrid or City: designed for city riding or casual riding on roads and paths with good surfaces * Cross: similar to a road bike, but has wider tires so it can handle rougher surfaces * Mountain: able to handle most surfaces, but generally heavier and slower on paved surfaces
      - `cycling_speed` integer — The average comfortable travel speed (in kph) along smooth, flat roads. The costing will vary the speed based on the surface, bicycle type, elevation change, etc. This value should be the average sustainable cruising speed the cyclist can maintain over the entire route. The default speeds are as follows based on bicycle type: * Road - 25kph * Cross - 20kph * Hybrid - 18kph * Mountain - 16kph
      - `use_roads` number, double — A measure of willingness to use roads alongside other vehicles. Values near 0 attempt to avoid roads and stay on cycleways, and values near 1 indicate the cyclist is more comfortable on roads.
      - `use_hills` number, double — A measure of willingness to take tackle hills. Values near 0 attempt to avoid hills and steeper grades even if it means a longer route, and values near 1 indicates that the user does not fear them. Note that as some routes may be impossible without hills, 0 does not guarantee avoidance of them.
      - `avoid_bad_surfaces` number, double — A measure of how much the cyclist wants to avoid roads with poor surfaces relative to the type of bicycle being ridden. When 0, there is no penalization of roads with poorer surfaces, and only bicycle speed is taken into account. As the value approaches 1, roads with poor surfaces relative to the bicycle type receive a heaver penalty, so they will only be taken if they significantly reduce travel time. When the value is 1, all bad surfaces are completely avoided from the route, including the start and end points.
      - `bss_return_cost` integer — The estimated cost (in seconds) to return a bicycle in `bikeshare` mode.
      - `bss_return_penalty` integer — A penalty (in seconds) to return a bicycle in `bikeshare` mode.
    - `motor_scooter` MotorScooterCostingOptions
      - `maneuver_penalty` integer — A penalty (in seconds) applied when transitioning between roads (determined by name).
      - `gate_cost` integer — The estimated cost (in seconds) when a gate is encountered.
      - `gate_penalty` integer — A penalty (in seconds) applied to the route cost when a gate is encountered. This penalty can be used to reduce the likelihood of suggesting a route with gates unless absolutely necessary.
      - `country_crossing_cost` integer — The estimated cost (in seconds) when encountering an international border.
      - `country_crossing_penalty` integer — A penalty applied to transitions to international border crossings. This penalty can be used to reduce the likelihood of suggesting a route with border crossings unless absolutely necessary.
      - `service_penalty` integer — A penalty applied to transitions to service roads. This penalty can be used to reduce the likelihood of suggesting a route with service roads unless absolutely necessary. The default penalty is 15 for cars, busses, motor scooters, and motorcycles; and zero for others.
      - `service_factor` number, double — A factor that multiplies the cost when service roads are encountered. The default is 1.2 for cars and busses, and 1 for trucks, motor scooters, and motorcycles.
      - `use_living_streets` number, double — A measure of willingness to take living streets. Values near 0 attempt to avoid them, and values near 1 will favour them. Note that as some routes may be impossible without living streets, 0 does not guarantee avoidance of them. The default value is 0 for trucks; 0.1 for other motor vehicles; 0.5 for bicycles; and 0.6 for pedestrians.
      - `use_ferry` number, double — A measure of willingness to take ferries. Values near 0 attempt to avoid ferries, and values near 1 will favour them. Note that as some routes may be impossible without ferries, 0 does not guarantee avoidance of them.
      - `ignore_restrictions` boolean — If set to true, ignores any restrictions (eg: turn and conditional restrictions). Useful for matching GPS traces to the road network regardless of restrictions.
      - `ignore_non_vehicular_restrictions` boolean — If set to true, ignores most restrictions (eg: turn and conditional restrictions), but still respects restrictions that impact vehicle safety such as weight and size.
      - `ignore_oneways` boolean — If set to true, ignores directional restrictions on roads. Useful for matching GPS traces to the road network regardless of restrictions.
      - `private_access_penalty` number, double — A penalty (in seconds) for accessing private roads.
      - `alley_penalty` number, double — A penalty (in seconds) for using alleys.
      - `rail_ferry_cost` integer — The estimated cost (in seconds) when a rail ferry is encountered. Only applies to costing models that support rail ferries (auto, truck, motorcycle).
      - `use_rail_ferry` number, double — A measure of willingness to take rail ferries. Values near 0 attempt to avoid rail ferries, and values near 1 will favor them. Note that as some routes may be impossible without rail ferries, 0 does not guarantee avoidance of them. Only applies to auto, truck, and motorcycle costing.
      - `ignore_access` boolean — If set to true, ignores access restrictions for the route.
      - `ferry_cost` integer — The estimated cost (in seconds) when a ferry is encountered.
      - `height` number, double — The height of the automobile (in meters).
      - `width` number, double — The width of the automobile (in meters).
      - `toll_booth_cost` integer — The estimated cost (in seconds) when a toll booth is encountered.
      - `toll_booth_penalty` integer — A penalty (in seconds) applied to the route cost when a toll booth is encountered. This penalty can be used to reduce the likelihood of suggesting a route with toll booths unless absolutely necessary.
      - `exclude_cash_only_tolls` boolean — If true, avoids routes with cash-only tolls.
      - `exclude_unpaved` boolean — Indicates whether or not the path may include unpaved roads. If true, the route is allowed to start and end with unpaved roads, but is not allowed to have them in the middle of the route path. Otherwise they are allowed.
      - `use_highways` number, double — A measure of willingness to take highways. Values near 0 attempt to avoid highways, and values near 1 will favour them. Note that as some routes may be impossible without highways, 0 does not guarantee avoidance of them.
      - `use_tolls` number, double — A measure of willingness to take toll roads. Values near 0 attempt to avoid tolls, and values near 1 will favour them. Note that as some routes may be impossible without tolls, 0 does not guarantee avoidance of them.
      - `use_tracks` number, double — A measure of willingness to take track roads. Values near 0 attempt to avoid them, and values near 1 will favour them. Note that as some routes may be impossible without track roads, 0 does not guarantee avoidance of them. The default value is 0 for automobiles, busses, and trucks; and 0.5 for all other costing modes.
      - `top_speed` integer — The top speed (in kph) that the vehicle is capable of travelling.
      - `shortest` boolean — If true changes the cost metric to be quasi-shortest (pure distance-based) costing. This will disable ALL other costing factors.
      - `ignore_closures` boolean — If true, ignores all known closures. This option cannot be set if `location.search_filter.exclude_closures` is also specified.
      - `include_hov2` boolean — If true, indicates the desire to include HOV roads with a 2-occupant requirement in the route when advantageous.
      - `include_hov3` boolean — If true, indicates the desire to include HOV roads with a 3-occupant requirement in the route when advantageous.
      - `include_hot` boolean — If true, indicates the desire to include toll roads which require the driver to pay a toll if the occupant requirement isn't met
      - `alley_factor` number, double — A factor that multiplies the cost when alleys are encountered.
      - `use_distance` number, double — A measure of preference for time vs. distance. Values near 0 (default) optimize for time, while values near 1 optimize for shortest distance.
      - `closure_factor` number, double — A factor that penalizes the cost of traversing closed edges. The value is a multiplier on the cost of a closed edge; higher values make closed edges less likely to be used.
      - `use_primary` number, double — A measure of willingness to use primary roads. Values near 0 attempt to avoid primary roads and stay on roads with lower speeds, and values near 1 indicate the rider is more comfortable on these roads.
      - `use_hills` number, double — A measure of willingness to take tackle hills. Values near 0 attempt to avoid hills and steeper grades even if it means a longer route, and values near 1 indicates that the rider does not fear them. Note that as some routes may be impossible without hills, 0 does not guarantee avoidance of them.
    - `motorcycle` MotorcycleCostingOptions
      - `maneuver_penalty` integer — A penalty (in seconds) applied when transitioning between roads (determined by name).
      - `gate_cost` integer — The estimated cost (in seconds) when a gate is encountered.
      - `gate_penalty` integer — A penalty (in seconds) applied to the route cost when a gate is encountered. This penalty can be used to reduce the likelihood of suggesting a route with gates unless absolutely necessary.
      - `country_crossing_cost` integer — The estimated cost (in seconds) when encountering an international border.
      - `country_crossing_penalty` integer — A penalty applied to transitions to international border crossings. This penalty can be used to reduce the likelihood of suggesting a route with border crossings unless absolutely necessary.
      - `service_penalty` integer — A penalty applied to transitions to service roads. This penalty can be used to reduce the likelihood of suggesting a route with service roads unless absolutely necessary. The default penalty is 15 for cars, busses, motor scooters, and motorcycles; and zero for others.
      - `service_factor` number, double — A factor that multiplies the cost when service roads are encountered. The default is 1.2 for cars and busses, and 1 for trucks, motor scooters, and motorcycles.
      - `use_living_streets` number, double — A measure of willingness to take living streets. Values near 0 attempt to avoid them, and values near 1 will favour them. Note that as some routes may be impossible without living streets, 0 does not guarantee avoidance of them. The default value is 0 for trucks; 0.1 for other motor vehicles; 0.5 for bicycles; and 0.6 for pedestrians.
      - `use_ferry` number, double — A measure of willingness to take ferries. Values near 0 attempt to avoid ferries, and values near 1 will favour them. Note that as some routes may be impossible without ferries, 0 does not guarantee avoidance of them.
      - `ignore_restrictions` boolean — If set to true, ignores any restrictions (eg: turn and conditional restrictions). Useful for matching GPS traces to the road network regardless of restrictions.
      - `ignore_non_vehicular_restrictions` boolean — If set to true, ignores most restrictions (eg: turn and conditional restrictions), but still respects restrictions that impact vehicle safety such as weight and size.
      - `ignore_oneways` boolean — If set to true, ignores directional restrictions on roads. Useful for matching GPS traces to the road network regardless of restrictions.
      - `private_access_penalty` number, double — A penalty (in seconds) for accessing private roads.
      - `alley_penalty` number, double — A penalty (in seconds) for using alleys.
      - `rail_ferry_cost` integer — The estimated cost (in seconds) when a rail ferry is encountered. Only applies to costing models that support rail ferries (auto, truck, motorcycle).
      - `use_rail_ferry` number, double — A measure of willingness to take rail ferries. Values near 0 attempt to avoid rail ferries, and values near 1 will favor them. Note that as some routes may be impossible without rail ferries, 0 does not guarantee avoidance of them. Only applies to auto, truck, and motorcycle costing.
      - `ignore_access` boolean — If set to true, ignores access restrictions for the route.
      - `ferry_cost` integer — The estimated cost (in seconds) when a ferry is encountered.
      - `height` number, double — The height of the automobile (in meters).
      - `width` number, double — The width of the automobile (in meters).
      - `toll_booth_cost` integer — The estimated cost (in seconds) when a toll booth is encountered.
      - `toll_booth_penalty` integer — A penalty (in seconds) applied to the route cost when a toll booth is encountered. This penalty can be used to reduce the likelihood of suggesting a route with toll booths unless absolutely necessary.
      - `exclude_cash_only_tolls` boolean — If true, avoids routes with cash-only tolls.
      - `exclude_unpaved` boolean — Indicates whether or not the path may include unpaved roads. If true, the route is allowed to start and end with unpaved roads, but is not allowed to have them in the middle of the route path. Otherwise they are allowed.
      - `use_highways` number, double — A measure of willingness to use highways. Values near 0 attempt to avoid highways and stay on roads with lower speeds, and values near 1 indicate the rider is more comfortable on these roads.
      - `use_tolls` number, double — A measure of willingness to take toll roads. Values near 0 attempt to avoid tolls, and values near 1 will favour them. Note that as some routes may be impossible without tolls, 0 does not guarantee avoidance of them.
      - `use_tracks` number, double — A measure of willingness to take track roads. Values near 0 attempt to avoid them, and values near 1 will favour them. Note that as some routes may be impossible without track roads, 0 does not guarantee avoidance of them. The default value is 0 for automobiles, busses, and trucks; and 0.5 for all other costing modes.
      - `top_speed` integer — The top speed (in kph) that the vehicle is capable of travelling.
      - `shortest` boolean — If true changes the cost metric to be quasi-shortest (pure distance-based) costing. This will disable ALL other costing factors.
      - `ignore_closures` boolean — If true, ignores all known closures. This option cannot be set if `location.search_filter.exclude_closures` is also specified.
      - `include_hov2` boolean — If true, indicates the desire to include HOV roads with a 2-occupant requirement in the route when advantageous.
      - `include_hov3` boolean — If true, indicates the desire to include HOV roads with a 3-occupant requirement in the route when advantageous.
      - `include_hot` boolean — If true, indicates the desire to include toll roads which require the driver to pay a toll if the occupant requirement isn't met
      - `alley_factor` number, double — A factor that multiplies the cost when alleys are encountered.
      - `use_distance` number, double — A measure of preference for time vs. distance. Values near 0 (default) optimize for time, while values near 1 optimize for shortest distance.
      - `closure_factor` number, double — A factor that penalizes the cost of traversing closed edges. The value is a multiplier on the cost of a closed edge; higher values make closed edges less likely to be used.
      - `use_trails` number, double — A measure of the rider's sense of adventure. Values near 0 attempt to avoid highways and stay on roads with potentially unsuitable terrain (trails, tracks, unclassified, or bad surfaces), and values near 1 will tend to avoid major roads and route on secondary roads.
    - `pedestrian` PedestrianCostingOptions
      - `walking_speed` number, double — Walking speed in kph.
      - `walkway_factor` number, double — A factor that multiplies the cost when walkways are encountered.
      - `sidewalk_factor` number, double — A factor that multiplies the cost when sidewalks are encountered.
      - `alley_factor` number, double — A factor that multiplies the cost when alleys are encountered.
      - `driveway_factor` number, double — A factor that multiplies the cost when driveways are encountered.
      - `step_penalty` integer — A penalty (in seconds) added to each transition onto a path with steps or stairs.
      - `use_ferry` number, double — A measure of willingness to take ferries. Values near 0 attempt to avoid ferries, and values near 1 will favour them. Note that as some routes may be impossible without ferries, 0 does not guarantee avoidance of them.
      - `use_living_streets` number, double — A measure of willingness to take living streets. Values near 0 attempt to avoid them, and values near 1 will favour them. Note that as some routes may be impossible without living streets, 0 does not guarantee avoidance of them. The default value is 0 for trucks; 0.1 for other motor vehicles; 0.5 for bicycles; and 0.6 for pedestrians.
      - `use_tracks` number, double — A measure of willingness to take track roads. Values near 0 attempt to avoid them, and values near 1 will favour them. Note that as some routes may be impossible without track roads, 0 does not guarantee avoidance of them. The default value is 0 for automobiles, busses, and trucks; and 0.5 for all other costing modes.
      - `use_hills` number, double — A measure of willingness to take tackle hills. Values near 0 attempt to avoid hills and steeper grades even if it means a longer route, and values near 1 indicates that the user does not fear them. Note that as some routes may be impossible without hills, 0 does not guarantee avoidance of them.
      - `use_lit` number, double — A measure of preference for streets that are lit. 0 indicates indifference toward lit streets, and 1 indicates that unlit streets should be avoided. Note that even with values near 1, there is no guarantee that the returned route will include lit segments.
      - `service_penalty` integer — A penalty applied to transitions to service roads. This penalty can be used to reduce the likelihood of suggesting a route with service roads unless absolutely necessary. The default penalty is 15 for cars, busses, motor scooters, and motorcycles; and zero for others.
      - `service_factor` number, double — A factor that multiplies the cost when service roads are encountered. The default is 1.2 for cars and busses, and 1 for trucks, motor scooters, and motorcycles.
      - `max_hiking_difficulty` integer — The maximum difficulty of hiking trails allowed. This corresponds to the OSM `sac_scale`.
      - `bss_rent_cost` integer — The estimated cost (in seconds) to rent a bicycle from a sharing station in `bikeshare` mode.
      - `bss_rent_penalty` integer — A penalty (in seconds) to rent a bicycle in `bikeshare` mode.
      - `type` 'foot' | 'blind' | 'wheelchair' — If set to blind, enables additional route instructions which are helpful for blind users. These include announcing street crossings, stairs, bridges, tunnels, gates, and bollards passed on the route. If set to wheelchair, the walking speed and step penalty are adjusted for wheelchair users.
      - `max_distance` integer — Maximum total walking distance (in meters). Defaults to 100,000 for foot, 10,000 for wheelchair.
      - `max_grade` integer — Maximum grade (steepness) as a percentage. Defaults to 90 for foot, 12 for wheelchair.
      - `mode_factor` number, double — A factor that modifies the cost when transitioning between travel modes. Setting this value higher than 1 will avoid walking, while setting it lower than 1 will prefer walking.
      - `elevator_penalty` integer — A penalty (in seconds) for using an elevator.
    - `low_speed_vehicle` LowSpeedVehicleCostingOptions
      - `maneuver_penalty` integer — A penalty (in seconds) applied when transitioning between roads (determined by name).
      - `gate_cost` integer — The estimated cost (in seconds) when a gate is encountered.
      - `gate_penalty` integer — A penalty (in seconds) applied to the route cost when a gate is encountered. This penalty can be used to reduce the likelihood of suggesting a route with gates unless absolutely necessary.
      - `country_crossing_cost` integer — The estimated cost (in seconds) when encountering an international border.
      - `country_crossing_penalty` integer — A penalty applied to transitions to international border crossings. This penalty can be used to reduce the likelihood of suggesting a route with border crossings unless absolutely necessary.
      - `service_penalty` integer — A penalty applied to transitions to service roads. This penalty can be used to reduce the likelihood of suggesting a route with service roads unless absolutely necessary. The default penalty is 15 for cars, busses, motor scooters, and motorcycles; and zero for others.
      - `service_factor` number, double — A factor that multiplies the cost when service roads are encountered. The default is 1.2 for cars and busses, and 1 for trucks, motor scooters, and motorcycles.
      - `use_living_streets` number, double — A measure of willingness to take living streets. Values near 0 attempt to avoid them, and values near 1 will favour them. Note that as some routes may be impossible without living streets, 0 does not guarantee avoidance of them. The default value is 0 for trucks; 0.1 for other motor vehicles; 0.5 for bicycles; and 0.6 for pedestrians.
      - `use_ferry` number, double — A measure of willingness to take ferries. Values near 0 attempt to avoid ferries, and values near 1 will favour them. Note that as some routes may be impossible without ferries, 0 does not guarantee avoidance of them.
      - `ignore_restrictions` boolean — If set to true, ignores any restrictions (eg: turn and conditional restrictions). Useful for matching GPS traces to the road network regardless of restrictions.
      - `ignore_non_vehicular_restrictions` boolean — If set to true, ignores most restrictions (eg: turn and conditional restrictions), but still respects restrictions that impact vehicle safety such as weight and size.
      - `ignore_oneways` boolean — If set to true, ignores directional restrictions on roads. Useful for matching GPS traces to the road network regardless of restrictions.
      - `private_access_penalty` number, double — A penalty (in seconds) for accessing private roads.
      - `alley_penalty` number, double — A penalty (in seconds) for using alleys.
      - `rail_ferry_cost` integer — The estimated cost (in seconds) when a rail ferry is encountered. Only applies to costing models that support rail ferries (auto, truck, motorcycle).
      - `use_rail_ferry` number, double — A measure of willingness to take rail ferries. Values near 0 attempt to avoid rail ferries, and values near 1 will favor them. Note that as some routes may be impossible without rail ferries, 0 does not guarantee avoidance of them. Only applies to auto, truck, and motorcycle costing.
      - `ignore_access` boolean — If set to true, ignores access restrictions for the route.
      - `ferry_cost` integer — The estimated cost (in seconds) when a ferry is encountered.
      - `vehicle_type` 'low_speed_vehicle' | 'golf_cart' — The type of vehicle: * low_speed_vehicle (BETA): a low-speed vehicle which falls under a different regulatory and licensing regime than automobiles (ex: LSV in the US and Canada, Quadricycles in the EU, etc.) * golf_cart: a street legal golf cart that is under a similar regulator regime as the generic LSV laws, but may need to follow special paths when available or abide by restrictions specific to golf carts.
      - `top_speed` integer — The top speed (in kph) that the vehicle is capable of travelling. This impacts travel time calculations as well as which roads are preferred. A very low speed vehicle will tend to prefer lower speed roads even in the presence of other legal routes.
      - `max_allowed_speed_limit` integer — The maximum speed limit for highways on which it is legal for the vehicle to travel. Defaults to 57 (kph; around 35 mph). Acceptable values range from 20 to 80. Highways with *tagged* speed limits higher than this value will not be routed over (some caveats apply; this feature is still BETA).
  - `date_time` TimeConstraintV1 — Specifies the time context for time-dependent routing (e.g., to account for traffic patterns or time-based access restrictions). Defaults to depart_now for traffic-influenced routing profiles like `auto_traffic`.
    - `type` 'depart_now' | 'depart_at' | 'arrive_at', required — The type of time constraint: `depart_now` = depart now (current time), `depart_at` = depart at the specified time, `arrive_at` = arrive by the specified time.
    - `value` string — The date and time in `YYYY-MM-DDTHH:MM` format (seconds are accepted, but will be ignored). The date and time are local (civil) time as observed at the location. Required when type is depart_at or arrive_at. Must not be provided for depart_now.
  - `elevation_interval` number, float — If greater than zero, attempts to include elevation along the route at regular intervals. The "native" internal resolution is 30m, so we recommend you use this when possible. This number is interpreted as either meters or feet depending on the unit parameter. Elevation for route sections containing a bridge or tunnel is interpolated linearly. This doesn't always match the true elevation of the bridge/tunnel, but it prevents sharp artifacts from the surrounding terrain. This functionality is unique to the routing endpoints and is not available via the elevation API. NOTE: This has no effect on the OSRM response format.
  - `units` 'km' | 'mi'
  - `language` 'bg-BG' | 'ca-ES' | 'cs-CZ' | 'da-DK' | 'de-DE' | 'el-GR' | 'en-GB' | 'en-US-x-pirate' | 'en-US' | 'es-ES' | 'et-EE' | 'fi-FI' | 'fr-FR' | 'hi-IN' | 'hu-HU' | 'it-IT' | 'ja-JP' | 'nb-NO' | 'nl-NL' | 'pl-PL' | 'pt-BR' | 'pt-PT' | 'ro-RO' | 'ru-RU' | 'sk-SK' | 'sl-SI' | 'sv-SE' | 'tr-TR' | 'uk-UA'
  - `directions_type` 'none' | 'maneuvers' | 'instructions' — The level of directional narrative to include. Locations and times will always be returned, but narrative generation verbosity can be controlled with this parameter.
  - `format` 'json' | 'osrm' — The output response format. The default JSON format is extremely compact and ideal for web or data-constrained use cases where you want to fetch additional attributes on demand in small chunks. The OSRM format is much richer and is configurable with significantly more info for turn-by-turn navigation use cases.
  - `banner_instructions` boolean — Optionally includes helpful banners with timing information for turn-by-turn navigation. This is only available in the OSRM format.
  - `voice_instructions` boolean — Optionally includes voice instructions with timing information for turn-by-turn navigation. This is only available in the OSRM format.
  - `filters` AnnotationFilters
    - `action` 'include' | 'exclude'
    - `attributes` string[] — A set of granular attributes to include between every pair of coordinates along the route. This can significantly increase the response size.

## Response `200`

The optimized route, which looks more or less like a normal route response. The only significant difference is that the `locations` may be re-ordered and annotated with an `original_index`.

- union
  - RouteResponse
    - `id` string — An identifier to disambiguate requests (echoed by the server).
    - `trip` RouteTrip, required
      - `status` integer, required — The response status code
      - `status_message` string, required — The response status message
      - `units` 'miles' | 'kilometers', required
      - `language` 'bg-BG' | 'ca-ES' | 'cs-CZ' | 'da-DK' | 'de-DE' | 'el-GR' | 'en-GB' | 'en-US-x-pirate' | 'en-US' | 'es-ES' | 'et-EE' | 'fi-FI' | 'fr-FR' | 'hi-IN' | 'hu-HU' | 'it-IT' | 'ja-JP' | 'nb-NO' | 'nl-NL' | 'pl-PL' | 'pt-BR' | 'pt-PT' | 'ro-RO' | 'ru-RU' | 'sk-SK' | 'sl-SI' | 'sv-SE' | 'tr-TR' | 'uk-UA', required
      - `locations` RoutingResponseWaypoint[], required
        - `lat` number, double, required — The latitude of a point in the shape.
        - `lon` number, double, required — The longitude of a point in the shape.
        - `type` 'break' | 'through' | 'via' | 'break_through' — A `break` represents the start or end of a leg, and allows reversals. A `through` location is an intermediate waypoint that must be visited between `break`s, but at which reversals are not allowed. A `via` is similar to a `through` except that reversals are allowed. A `break_through` is similar to a `break` in that it can be the start/end of a leg, but does not allow reversals. Defaults to `break`.
        - `original_index` integer — The original index of the location (locations may be reordered for optimized routes)
      - `legs` RouteLeg[], required
        - `maneuvers` RouteManeuver[]
          - `type` integer, required — The type of route maneuver. | Code | Type | |------|-------------------------------------| | 0 | None | | 1 | Start | | 2 | Start right | | 3 | Start left | | 4 | Destination | | 5 | Destination right | | 6 | Destination left | | 7 | Becomes | | 8 | Continue | | 9 | Slight right | | 10 | Right | | 11 | Sharp right | | 12 | U-turn right | | 13 | U-turn left | | 14 | Sharp left | | 15 | Left | | 16 | Slight left | | 17 | Ramp straight | | 18 | Ramp right | | 19 | Ramp left | | 20 | Exit right | | 21 | Exit left | | 22 | Stay straight | | 23 | Stay right | | 24 | Stay left | | 25 | Merge | | 26 | Enter roundabout | | 27 | Exit roundabout | | 28 | Enter ferry | | 29 | Exit ferry | | 30 | Transit | | 31 | Transit transfer | | 32 | Transit remain on | | 33 | Transit connection start | | 34 | Transit connection transfer | | 35 | Transit connection destination | | 36 | Post-transit connection destination | | 37 | Merge right | | 38 | Merge left |
          - `instruction` string, required — The written maneuver instruction.
          - `verbal_transition_alert_instruction` string — Text suitable for use as a verbal navigation alert.
          - `verbal_pre_transition_instruction` string — Text suitable for use as a verbal navigation alert immediately prior to the maneuver transition.
          - `verbal_post_transition_instruction` string — Text suitable for use as a verbal navigation alert immediately after to the maneuver transition.
          - `street_names` string[] — A list of street names that are consistent along the entire maneuver.
          - `begin_street_names` string[] — A list of street names at the beginning of the maneuver, if they are different from the names at the end.
          - `time` number, double, required — The estimated time to complete the entire maneuver, in seconds.
          - `length` number, double, required — The length of the maneuver, in `units`.
          - `begin_shape_index` integer, required — The index into the list of shape points for the start of the maneuver.
          - `end_shape_index` integer, required — The index into the list of shape points for the end of the maneuver.
          - `toll` boolean — True any portion of the maneuver is subject to a toll.
          - `rough` boolean — True any portion of the maneuver is unpaved or has portions of rough pavement.
          - `gate` boolean — True if a gate is encountered in the course of this maneuver.
          - `ferry` boolean — True if a ferry is encountered in the course of this maneuver.
          - `sign` ManeuverSign
            - `exit_number_elements` ManeuverSignElement[] — A list of exit number elements. This is typically just a single value.
              - …
            - `exit_branch_elements` ManeuverSignElement[] — A list of exit branch elements. The text is a subsequent road name or route number after the sign.
              - …
            - `exit_toward_elements` ManeuverSignElement[] — A list of exit name elements. The text is the interchange identifier (used more frequently outside the US).
              - …
            - `exit_name_elements` ManeuverSignElement[] — A list of exit name elements. The text is the location where the road ahead goes (typically a city, but occasionally a road name or route number).
              - …
          - `roundabout_exit_count` integer — The exit number of the roundabout to take after entering.
          - `depart_instruction` integer — The written departure time instruction (typically used in a transit maneuver).
          - `verbal_depart_instruction` integer — Text suitable for use as a verbal departure time instruction (typically used in a transit maneuver).
          - `arrive_instruction` integer — The written arrival time instruction (typically used in a transit maneuver).
          - `verbal_arrive_instruction` integer — Text suitable for use as a verbal departure time instruction (typically used in a transit maneuver).
          - `transit_info` TransitInfo — Public transit info (not currently supported).
          - `verbal_multi_cue` boolean — True if the `verbal_pre_transition_instruction` has been appended with the verbal instruction of the next maneuver.
          - `travel_mode` 'drive' | 'pedestrian' | 'bicycle' | 'transit', required
          - `travel_type` 'car' | 'motorcycle' | 'bus' | 'tractor_trailer' | 'motor_scooter' | 'foot' | 'wheelchair' | 'segway' | 'road' | 'cross' | 'hybrid' | 'mountain' | 'tram' | 'metro' | 'rail' | 'ferry' | 'cable_car' | 'gondola' | 'funicular' | 'golf_cart' | 'low_speed_vehicle', required — The type of travel over the maneuver. This can be thought of as a specialization of the travel mode. For example, vehicular travel may be via car, motorcycle, etc.; and travel via bicycle may be via a road bike, mountain bike, etc.
          - `bss_maneuver_type` 'NoneAction' | 'RentBikeAtBikeShare' | 'ReturnBikeAtBikeShare' — Describes a bike share action when using bikeshare routing.
        - `shape` string, required — An encoded polyline (https://developers.google.com/maps/documentation/utilities/polylinealgorithm) with 6 digits of decimal precision (NOTE: Most implementations default to 5!).
        - `summary` RouteSummary, required
          - `time` number, double, required — The estimated travel time, in seconds
          - `length` number, double, required — The estimated travel distance, in `units` (km or mi)
          - `min_lat` number, double, required — The minimum latitude of the bounding box containing the route.
          - `max_lat` number, double, required — The maximum latitude of the bounding box containing the route.
          - `min_lon` number, double, required — The minimum longitude of the bounding box containing the route.
          - `max_lon` number, double, required — The maximum longitude of the bounding box containing the route.
        - `elevation_interval` number, float — The sampling distance between elevation values along the route. This echoes the request parameter having the same name (converted to `units` if necessary).
        - `elevation` number[] — An array of elevation values sampled every `elevation_interval`. Units are either metric or imperial depending on the value of `units`.
      - `summary` RouteSummary, required
        - `time` number, double, required — The estimated travel time, in seconds
        - `length` number, double, required — The estimated travel distance, in `units` (km or mi)
        - `min_lat` number, double, required — The minimum latitude of the bounding box containing the route.
        - `max_lat` number, double, required — The maximum latitude of the bounding box containing the route.
        - `min_lon` number, double, required — The minimum longitude of the bounding box containing the route.
        - `max_lon` number, double, required — The maximum longitude of the bounding box containing the route.
    - `alternates` object[]
      - `trip` RouteTrip
        - `status` integer, required — The response status code
        - `status_message` string, required — The response status message
        - `units` 'miles' | 'kilometers', required
        - `language` 'bg-BG' | 'ca-ES' | 'cs-CZ' | 'da-DK' | 'de-DE' | 'el-GR' | 'en-GB' | 'en-US-x-pirate' | 'en-US' | 'es-ES' | 'et-EE' | 'fi-FI' | 'fr-FR' | 'hi-IN' | 'hu-HU' | 'it-IT' | 'ja-JP' | 'nb-NO' | 'nl-NL' | 'pl-PL' | 'pt-BR' | 'pt-PT' | 'ro-RO' | 'ru-RU' | 'sk-SK' | 'sl-SI' | 'sv-SE' | 'tr-TR' | 'uk-UA', required
        - `locations` RoutingResponseWaypoint[], required
          - `lat` number, double, required — The latitude of a point in the shape.
          - `lon` number, double, required — The longitude of a point in the shape.
          - `type` 'break' | 'through' | 'via' | 'break_through' — A `break` represents the start or end of a leg, and allows reversals. A `through` location is an intermediate waypoint that must be visited between `break`s, but at which reversals are not allowed. A `via` is similar to a `through` except that reversals are allowed. A `break_through` is similar to a `break` in that it can be the start/end of a leg, but does not allow reversals. Defaults to `break`.
          - `original_index` integer — The original index of the location (locations may be reordered for optimized routes)
        - `legs` RouteLeg[], required
          - `maneuvers` RouteManeuver[]
            - `type` integer, required — The type of route maneuver. | Code | Type | |------|-------------------------------------| | 0 | None | | 1 | Start | | 2 | Start right | | 3 | Start left | | 4 | Destination | | 5 | Destination right | | 6 | Destination left | | 7 | Becomes | | 8 | Continue | | 9 | Slight right | | 10 | Right | | 11 | Sharp right | | 12 | U-turn right | | 13 | U-turn left | | 14 | Sharp left | | 15 | Left | | 16 | Slight left | | 17 | Ramp straight | | 18 | Ramp right | | 19 | Ramp left | | 20 | Exit right | | 21 | Exit left | | 22 | Stay straight | | 23 | Stay right | | 24 | Stay left | | 25 | Merge | | 26 | Enter roundabout | | 27 | Exit roundabout | | 28 | Enter ferry | | 29 | Exit ferry | | 30 | Transit | | 31 | Transit transfer | | 32 | Transit remain on | | 33 | Transit connection start | | 34 | Transit connection transfer | | 35 | Transit connection destination | | 36 | Post-transit connection destination | | 37 | Merge right | | 38 | Merge left |
            - `instruction` string, required — The written maneuver instruction.
            - `verbal_transition_alert_instruction` string — Text suitable for use as a verbal navigation alert.
            - `verbal_pre_transition_instruction` string — Text suitable for use as a verbal navigation alert immediately prior to the maneuver transition.
            - `verbal_post_transition_instruction` string — Text suitable for use as a verbal navigation alert immediately after to the maneuver transition.
            - `street_names` string[] — A list of street names that are consistent along the entire maneuver.
            - `begin_street_names` string[] — A list of street names at the beginning of the maneuver, if they are different from the names at the end.
            - `time` number, double, required — The estimated time to complete the entire maneuver, in seconds.
            - `length` number, double, required — The length of the maneuver, in `units`.
            - `begin_shape_index` integer, required — The index into the list of shape points for the start of the maneuver.
            - `end_shape_index` integer, required — The index into the list of shape points for the end of the maneuver.
            - `toll` boolean — True any portion of the maneuver is subject to a toll.
            - `rough` boolean — True any portion of the maneuver is unpaved or has portions of rough pavement.
            - `gate` boolean — True if a gate is encountered in the course of this maneuver.
            - `ferry` boolean — True if a ferry is encountered in the course of this maneuver.
            - `sign` ManeuverSign
              - …
            - `roundabout_exit_count` integer — The exit number of the roundabout to take after entering.
            - `depart_instruction` integer — The written departure time instruction (typically used in a transit maneuver).
            - `verbal_depart_instruction` integer — Text suitable for use as a verbal departure time instruction (typically used in a transit maneuver).
            - `arrive_instruction` integer — The written arrival time instruction (typically used in a transit maneuver).
            - `verbal_arrive_instruction` integer — Text suitable for use as a verbal departure time instruction (typically used in a transit maneuver).
            - `transit_info` TransitInfo — Public transit info (not currently supported).
            - `verbal_multi_cue` boolean — True if the `verbal_pre_transition_instruction` has been appended with the verbal instruction of the next maneuver.
            - `travel_mode` 'drive' | 'pedestrian' | 'bicycle' | 'transit', required
            - `travel_type` 'car' | 'motorcycle' | 'bus' | 'tractor_trailer' | 'motor_scooter' | 'foot' | 'wheelchair' | 'segway' | 'road' | 'cross' | 'hybrid' | 'mountain' | 'tram' | 'metro' | 'rail' | 'ferry' | 'cable_car' | 'gondola' | 'funicular' | 'golf_cart' | 'low_speed_vehicle', required — The type of travel over the maneuver. This can be thought of as a specialization of the travel mode. For example, vehicular travel may be via car, motorcycle, etc.; and travel via bicycle may be via a road bike, mountain bike, etc.
            - `bss_maneuver_type` 'NoneAction' | 'RentBikeAtBikeShare' | 'ReturnBikeAtBikeShare' — Describes a bike share action when using bikeshare routing.
          - `shape` string, required — An encoded polyline (https://developers.google.com/maps/documentation/utilities/polylinealgorithm) with 6 digits of decimal precision (NOTE: Most implementations default to 5!).
          - `summary` RouteSummary, required
            - `time` number, double, required — The estimated travel time, in seconds
            - `length` number, double, required — The estimated travel distance, in `units` (km or mi)
            - `min_lat` number, double, required — The minimum latitude of the bounding box containing the route.
            - `max_lat` number, double, required — The maximum latitude of the bounding box containing the route.
            - `min_lon` number, double, required — The minimum longitude of the bounding box containing the route.
            - `max_lon` number, double, required — The maximum longitude of the bounding box containing the route.
          - `elevation_interval` number, float — The sampling distance between elevation values along the route. This echoes the request parameter having the same name (converted to `units` if necessary).
          - `elevation` number[] — An array of elevation values sampled every `elevation_interval`. Units are either metric or imperial depending on the value of `units`.
        - `summary` RouteSummary, required
          - `time` number, double, required — The estimated travel time, in seconds
          - `length` number, double, required — The estimated travel distance, in `units` (km or mi)
          - `min_lat` number, double, required — The minimum latitude of the bounding box containing the route.
          - `max_lat` number, double, required — The maximum latitude of the bounding box containing the route.
          - `min_lon` number, double, required — The minimum longitude of the bounding box containing the route.
          - `max_lon` number, double, required — The maximum longitude of the bounding box containing the route.
  - OsrmRouteResponse
    - `code` 'Ok' | 'InvalidUrl' | 'InvalidService' | 'InvalidVersion' | 'InvalidOptions' | 'InvalidQuery' | 'InvalidValue' | 'NoSegment' | 'TooBig' | 'NoRoute' | 'NoTable' | 'NotImplemented' | 'NoTrips', required
    - `message` string
    - `data_version` string
    - `waypoints` OsrmWaypoint[]
      - `name` string
      - `location` number[], required — A (longitude, latitude) coordinate pair.
      - `distance` number, double, required — The distance of the snapped point from the original location.
      - `hint` string
    - `routes` OsrmRoute[]
      - `distance` number, double, required — The distance traveled by the route, in meters.
      - `duration` number, double, required — The estimated travel time, in number of seconds.
      - `geometry` string, required — An encoded polyline (https://developers.google.com/maps/documentation/utilities/polylinealgorithm). Note that the polyline is encoded with 6 digits of precision rather than the default 5!
      - `weight` number, double — The total cost of the route computed by the routing engine.
      - `weight_name` string — The routing profile (costing) used for the route.
      - `legs` OsrmRouteLeg[], required
        - `distance` number, double, required — The distance traveled by the route, in meters.
        - `duration` number, double, required — The estimated travel time, in number of seconds.
        - `weight` number, double — The total cost of the leg computed by the routing engine.
        - `summary` string
        - `steps` OsrmRouteStep[], required
          - `distance` number, double, required — The distance traveled by the route, in meters.
          - `duration` number, double, required — The estimated travel time, in number of seconds.
          - `geometry` string, required — An encoded polyline (https://developers.google.com/maps/documentation/utilities/polylinealgorithm) with 6 digits of decimal precision (NOTE: most implementations default to 5).
          - `weight` number, double
          - `name` string — The name of the segment (ex: road) being traversed
          - `ref` string — A reference number of code for the segment being traversed.
          - `pronunciation` string — Pronunciation of the name (if available). The format of this varies by implementation/vendor.
          - `destinations` string
          - `exits` string
          - `mode` string, required — The mode of travel.
          - `maneuver` OsrmStepManeuver, required
            - `location` number[], required — A (longitude, latitude) coordinate pair.
            - `instruction` string — A human-readable instruction for the maneuver.
            - `bearing_before` integer, required — The clockwise angle from true north to the direction of travel immediately before the maneuver.
            - `bearing_after` integer, required — The clockwise angle from true north to the direction of travel immediately after the maneuver.
            - `type` 'turn' | 'new name' | 'depart' | 'arrive' | 'merge' | 'ramp' | 'on ramp' | 'off ramp' | 'fork' | 'end of road' | 'use lane' | 'continue' | 'roundabout' | 'rotary' | 'roundabout turn' | 'notification' | 'exit roundabout' | 'exit rotary', required
            - `modifier` 'uturn' | 'sharp right' | 'right' | 'slight right' | 'straight' | 'slight left' | 'left' | 'sharp left', nullable — An optional value indicating the directional change of the maneuver (further clarifying type).
            - `exit` integer — The exit number to take (for roundabouts, rotaries, and number of intersections).
          - `intersections` OsrmIntersection[]
            - `location` number[], required — A (longitude, latitude) coordinate pair.
            - `bearings` integer[], required — A list of bearing values that are available for travel through the intersection.
            - `classes` string[]
            - `entry` boolean[], required — A list of entry flags, which map 1:1 to the bearings. A value of true indicates that the respective road could be entered on a valid route. False indicates that the turn onto the respective road would violate a restriction.
            - `in` integer — An index into bearings/entry array. Used to calculate the bearing just before the turn. Namely, the clockwise angle from true north to the direction of travel immediately before the maneuver/passing the intersection. Bearings are given relative to the intersection. To get the bearing in the direction of driving, the bearing has to be rotated by a value of 180. The value is not supplied for depart maneuvers.
            - `out` integer — An index into bearings/entry array. Used to calculate the bearing just after the turn. Namely, the clockwise angle from true north to the direction of travel immediately after the maneuver/passing the intersection. This is not supplied for arrive maneuvers.
            - `lanes` OsrmLane[] — Available turn lanes at the intersection. May be omitted if no lane information is available for the intersection.
              - …
            - `admin_index` integer — The index into the admin boundaries list on the route leg.
            - `duration` number, double — The estimated duration, in seconds, to traverse the intersection.
            - `turn_duration` number, double — The estimated duration, in seconds, to complete the turn.
            - `turn_weight` number, double
            - `geometry_index` integer — The index of the intersection in the leg geometry.
            - `weight` number, double
          - `rotary_name` string — The name of the traffic circle.
          - `rotary_pronunciation` string — Pronunciation of the rotary name (if available). The format of this varies by implementation/vendor.
          - `driving_side` 'left' | 'right' — The side of the road on which driving is legal for this step.
          - `voiceInstructions` OsrmVoiceInstruction[] — A list of announcements which should be spoken at various points along the maneuver.
            - `distanceAlongGeometry` number, double, required — How far (in meters) from the upcoming maneuver the instruction should be announced.
            - `announcement` string, required — The plain-text announcement.
            - `ssmlAnnouncement` string — The announcement in Speech Synthesis Markup Language (SSML). Supported TTS engines include Amazon Polly and Apple's AVSpeechSynthesizer.
          - `bannerInstructions` OsrmBannerInstruction[] — A list of announcements which should be displayed prominently on screen at various points along the maneuver.
            - `distanceAlongGeometry` number, double, required — How far (in meters) from the upcoming maneuver the instruction should start being displayed.
            - `primary` OsrmBannerContent, required
              - …
            - `secondary` OsrmBannerContent
              - …
          - `speedLimitSign` 'mutcd' | 'vienna' — The style of speed limit signs used along the step.
          - `speedLimitUnit` string — The unit of measure that is used locally along the step. This may be different from the unit used in maxspeed annotations, and is provided so that apps can localize their display.
        - `annotation` OsrmAnnotation
          - `distance` number[] — The distance, in meters, between each pair of coordinates.
          - `duration` number[] — The duration between each pair of coordinates, in seconds.
          - `weight` integer[]
          - `speed` number[] — The estimated speed of travel between each pair of coordinates in meters/sec.
          - `maxspeed` OsrmSpeedLimit[]
            - `speed` integer
            - `unit` 'km/h' | 'mph' — The unit of measure for the speed. Always included if speed is present.
            - `unknown` boolean — True if the speed limit is not known.
            - `none` boolean — True if there is no explicit speed limit (ex: some Autobahn sections)
        - `via_waypoints` OsrmViaWaypoint[], nullable — Indicates which waypoints are passed through rather than creating a new leg.
          - `distance_from_start` number, double, required — The distance from the start of the leg, in meters.
          - `geometry_index` integer, required — The index of the waypoint's location in the route geometry.
          - `waypoint_index` integer, required — The index of the associated waypoint.
        - `admins` OsrmAdmin[] — Administrative regions visited along the leg.
          - `iso_3166_1` string — The ISO 3166-1 two-character code for the admin region.
          - `iso_3166_1_alpha3` string — The ISO 3166-1 three-character code for the admin region.

## Other responses

- `400` — Bad request; more details will be included
- `500` — An internal parse error occurred; more details will be included

---

[API](https://skmtc.net/stadiamaps/apis/stadia-maps-geospatial-apis.md) · [All operations](https://skmtc.net/stadiamaps/apis/stadia-maps-geospatial-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/stadiamaps/stadia-maps-geospatial-apis/versions/99e0701a73aa/schema)
