v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-145615375.2 KB

OptimizeWaypoints calculates the optimal order to travel between a set of waypoints to minimize either the travel time or the distance travelled during the journey, based on road network restrictions and the traffic pattern data.

For more information, see Optimize waypoints in the Amazon Location Service Developer Guide.

post/v2/optimize-waypoints

Query parameters

keystring password

Optional: The API key to be used for authorization. Either an API key or valid SigV4 signature must be provided when making a request.

Request body

DepartureTimestring password
<p>Departure time from the waypoint.</p> <p>Time format:<code>YYYY-MM-DDThh:mm:ss.sssZ | YYYY-MM-DDThh:mm:ss.sss+hh:mm</code> </p> <p>Examples:</p> <p> <code>2020-04-22T17:57:24Z</code> </p> <p> <code>2020-04-22T17:57:24+02:00</code> </p>
DestinationDouble[]

The final position for the route in the World Geodetic System (WGS 84) format: <code>[longitude, latitude]</code>.

OptimizeSequencingFor'FastestRoute' | 'ShortestRoute'
<p>Specifies the optimization criteria for the calculated sequence.</p> <p>Default value: <code>FastestRoute</code>.</p>
OriginDouble[] required

The start position for the route in World Geodetic System (WGS 84) format: [longitude, latitude].

TravelMode'Car' | 'Pedestrian' | 'Scooter' | 'Truck'
<p>Specifies the mode of transport when calculating a route. Used in estimating the speed of travel and road compatibility.</p> <p>Default value: <code>Car</code> </p>

Response

Success

Distanceinteger required

Overall distance to travel the whole sequence.

Durationinteger required
<p>Overall duration to travel the whole sequence.</p> <p> <b>Unit</b>: <code>seconds</code> </p>