Skip to main content
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>"
  }
}

Authorizations

x-api-key
string
header
required

Your Footstep API key

Body

application/json
locations
object[]
required

Waypoints (min 2, max 20)

Required array length: 2 - 20 elements
travel_modes
enum<string>[]
required

Travel modes to compare (2-4)

Required array length: 2 - 4 elements
Available options:
auto,
bicycle,
pedestrian,
bus,
truck
travel_options
object

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

elevation_interval
number
default:30

Elevation sampling interval in meters

Required range: 10 <= x <= 200
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

Routes for each travel mode with comparison

routes
object
required

Routes keyed by travel mode (e.g. { "pedestrian": Route, "bicycle": Route })

comparison
object
required