Skip to main content
POST
/
v1
/
routing
/
elevation
curl --request POST \
  --url https://api.footstep.ai/v1/routing/elevation \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "shape": [
    {
      "lat": 51.5322,
      "lon": -0.124
    },
    {
      "lat": 51.5007,
      "lon": -0.1246
    },
    {
      "lat": 51.5055,
      "lon": -0.0754
    }
  ]
}
'
{
  "shape": [
    {
      "lat": 0,
      "lon": 0
    }
  ],
  "height": [
    123
  ],
  "range_height": [
    [
      123
    ]
  ],
  "summary": {
    "total_ascent_m": 123,
    "total_descent_m": 123,
    "max_elevation_m": 123,
    "min_elevation_m": 123,
    "avg_elevation_m": 123
  }
}

Authorizations

x-api-key
string
header
required

Your Footstep API key

Body

application/json

Provide either shape or encoded_polyline

shape
object[]

Coordinates (max 2000)

Maximum array length: 2000
encoded_polyline
string

Encoded polyline alternative

range
boolean
default:false

Include cumulative distances

resample_distance
number

Resample interval in meters

Required range: 1 <= x <= 1000
height_precision
number
default:0

Decimal places for heights

Required range: 0 <= x <= 2
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

Elevation data with summary

shape
object[]
height
number[]

Elevations (when range=false)

range_height
number[][]

[distance_m, elevation_m] tuples (when range=true)

Required array length: 2 elements
summary
object