> ## Documentation Index
> Fetch the complete documentation index at: https://docs.footstep.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Elevation

> Query elevation values for coordinates or an encoded polyline. Returns height values with a computed summary including ascent, descent, min/max/avg elevation.



## OpenAPI

````yaml POST /v1/routing/elevation
openapi: 3.1.0
info:
  title: Footstep API
  description: >-
    Terrain-intelligent routing, geocoding, elevation, and spatial analysis.
    Every routing response includes terrain analytics by default. Routing
    endpoints support two response formats: footstep (default, compact) and
    geojson (standard GeoJSON).
  version: 1.0.0
servers:
  - url: https://api.footstep.ai
    description: Production
security:
  - apiKey: []
paths:
  /v1/routing/elevation:
    post:
      tags:
        - Routing
      summary: Get elevation data for points or a path
      description: >-
        Query elevation values for coordinates or an encoded polyline. Returns
        height values with a computed summary including ascent, descent,
        min/max/avg elevation.
      operationId: getElevation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ElevationRequest'
            examples:
              points:
                summary: Elevation for specific points
                value:
                  shape:
                    - lat: 51.5322
                      lon: -0.124
                    - lat: 51.5007
                      lon: -0.1246
                    - lat: 51.5055
                      lon: -0.0754
              range:
                summary: Distance-elevation profile
                value:
                  shape:
                    - lat: 51.5322
                      lon: -0.124
                    - lat: 51.5055
                      lon: -0.0754
                  range: true
                  resample_distance: 50
      responses:
        '200':
          description: Elevation data with summary
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ElevationResponse'
            application/geo+json:
              schema:
                type: object
                description: >-
                  GeoJSON FeatureCollection of Point features with 3D
                  coordinates [lon, lat, elevation].
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Routing engine unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ElevationRequest:
      type: object
      description: Provide either shape or encoded_polyline
      properties:
        shape:
          type: array
          items:
            $ref: '#/components/schemas/Coordinate'
          maxItems: 2000
          description: Coordinates (max 2000)
        encoded_polyline:
          type: string
          description: Encoded polyline alternative
        range:
          type: boolean
          default: false
          description: Include cumulative distances
        resample_distance:
          type: number
          minimum: 1
          maximum: 1000
          description: Resample interval in meters
        height_precision:
          type: number
          minimum: 0
          maximum: 2
          default: 0
          description: Decimal places for heights
        format:
          $ref: '#/components/schemas/Format'
    ElevationResponse:
      type: object
      properties:
        shape:
          type: array
          items:
            $ref: '#/components/schemas/Coordinate'
        height:
          type: array
          items:
            type: number
          description: Elevations (when range=false)
        range_height:
          type: array
          items:
            type: array
            items:
              type: number
            minItems: 2
            maxItems: 2
          description: '[distance_meters, elevation_meters] tuples (when range=true)'
        summary:
          $ref: '#/components/schemas/ElevationSummary'
    Error:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
        message:
          type: string
    Coordinate:
      type: object
      required:
        - lat
        - lon
      properties:
        lat:
          type: number
          minimum: -90
          maximum: 90
        lon:
          type: number
          minimum: -180
          maximum: 180
    Format:
      type: string
      enum:
        - footstep
        - geojson
      default: footstep
      description: >-
        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).
    ElevationSummary:
      type: object
      description: >-
        Elevation statistics for the requested points. `total_ascent_meters` and
        `total_descent_meters` are included only when `range: true` was
        requested.
      required:
        - max_elevation_meters
        - min_elevation_meters
        - avg_elevation_meters
      properties:
        total_ascent_meters:
          type: number
          description: 'Cumulative climb along the path. Present when `range: true`.'
        total_descent_meters:
          type: number
          description: 'Cumulative drop along the path. Present when `range: true`.'
        max_elevation_meters:
          type: number
        min_elevation_meters:
          type: number
        avg_elevation_meters:
          type: number
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Your Footstep API key

````