Skip to main content
POST
Optimise visit order for multiple stops

Authorizations

x-api-key
string
header
required

Your Footstep API key

Body

application/json
locations
object[]
required

Locations (min 4 for TSP)

Required array length: 4 - 50 elements
travel
enum<string>
default:auto
Available options:
auto,
bicycle,
pedestrian
travel_options
object

Fine-tuning options. Include only the key matching your travel type.

units
enum<string>
default:kilometers
Available options:
kilometers,
miles
elevation_interval
number
default:30
Required range: 10 <= x <= 200
narrative
boolean
default:false

Include a natural language summary of the optimised route. Uses AI generation, adds ~500ms latency.

format
enum<string>
default:footstep

Response format. footstep = optimised for app developers (encoded polyline, flat structure). geojson = standard GeoJSON FeatureCollection (decoded coordinates, immediately usable in Leaflet/Mapbox GL/deck.gl).

Available options:
footstep,
geojson

Response

Optimised route with savings

route
object
required

A complete route with terrain analytics

optimized_order
number[]
required

Original location indices in optimised visit order

savings
object
required

Savings compared to original location order