curl --request POST \
--url https://api.footstep.ai/v1/routing/compare \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"locations": [
{
"lat": 51.5322,
"lon": -0.124
},
{
"lat": 51.5055,
"lon": -0.0754
}
],
"travel_modes": [
"pedestrian",
"bicycle"
]
}
'{
"routes": {},
"comparison": {
"fastest": "<string>",
"shortest": "<string>",
"easiest": "<string>",
"summary": "<string>"
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Routing
Compare Routes
Calculate routes between the same locations using multiple travel modes and return a side-by-side comparison. Includes distance, duration, and terrain difficulty for each mode, plus a summary showing which is fastest, shortest, and easiest. Useful for deciding how to travel.
POST
/
v1
/
routing
/
compare
curl --request POST \
--url https://api.footstep.ai/v1/routing/compare \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"locations": [
{
"lat": 51.5322,
"lon": -0.124
},
{
"lat": 51.5055,
"lon": -0.0754
}
],
"travel_modes": [
"pedestrian",
"bicycle"
]
}
'{
"routes": {},
"comparison": {
"fastest": "<string>",
"shortest": "<string>",
"easiest": "<string>",
"summary": "<string>"
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
Your Footstep API key
Body
application/json
Waypoints (min 2, max 20)
Required array length:
2 - 20 elementsShow child attributes
Show child attributes
Travel modes to compare (2-4)
Required array length:
2 - 4 elementsAvailable options:
auto, bicycle, pedestrian, bus, truck Fine-tuning options. Include only the key matching your travel type.
Show child attributes
Show child attributes
Elevation sampling interval in meters
Required range:
10 <= x <= 200Response 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