Skip to content
GuidesBlogPlaygroundDashboard

Optimize

Optimize route through waypoints
$client->optimize->create(list<Waypoint> waypoints, ?string format, ?Mode mode, ?bool roundtrip): OptimizeResult
POST/api/v1/optimize
Get async optimization result
$client->optimize->retrieve(string jobID): OptimizeJobStatus
GET/api/v1/optimize/{job_id}
ModelsExpand Collapse
list<Feature> features

Waypoints in optimized visit order

string optimization

Optimization method used (e.g. nearest_neighbor, 2opt)

bool roundtrip

Whether the route returns to the starting waypoint

float totalCostS

Total travel time for the optimized route in seconds

Type type
Status status

Current job state

Completed optimization result as a GeoJSON FeatureCollection. Each Feature is a waypoint in optimized visit order. Top-level fields provide summary statistics.

string jobID

Job ID for polling the result

Status status

Always processing

list<Waypoint> waypoints

Waypoints to visit in optimized order (2-50 points)

?Mode mode

Travel mode (default: auto)

?bool roundtrip

Whether the route should return to the starting waypoint (default: true)

One of the following:
list<Feature> features

Waypoints in optimized visit order

string optimization

Optimization method used (e.g. nearest_neighbor, 2opt)

bool roundtrip

Whether the route returns to the starting waypoint

float totalCostS

Total travel time for the optimized route in seconds

Type type
string jobID

Job ID for polling the result

Status status

Always processing