---
title: "Get the elevation profile along a polyline or at a point."
method: POST
path: "/elevation/v1"
tags: ["Geospatial"]
---

# Get the elevation profile along a polyline or at a point.

`POST /elevation/v1`

The Stadia elevation API allows you to get the elevation of any point on earth. You can pass either a simple set of points or a Google encoded polyline string. This pairs well with our routing APIs, so you can generate an elevation profile for your next bike or run.

## Request body

- HeightRequest — Request body for the elevation endpoint.
  - `id` string, nullable — An identifier to disambiguate requests (echoed by the server).
  - `shape` Coordinate[], nullable — The path to get the height along, expressed as a sequence of coordinates. REQUIRED if `encoded_polyline` is not present.
    - `lat` number, double, required — Latitude in decimal degrees.
    - `lon` number, double, required — Longitude in decimal degrees.
  - `encoded_polyline` string — An encoded polyline (https://developers.google.com/maps/documentation/utilities/polylinealgorithm).
  - `shape_format` 'polyline6' | 'polyline5' — Specifies the precision of an encoded polyline.
  - `range` boolean — Controls whether the returned array is one-dimensional (height only) or two-dimensional (with a range and height). The range dimension can be used to generate a graph or steepness gradient along a route.
  - `height_precision` integer — The decimal precision (number of digits after the point) of the output. When 0, integer values are returned. Valid values are 0, 1, and 2.
  - `resample_distance` integer — The distance in meters at which the input polyline should be sampled to provide uniform distances between points.

## Response `200`

A list of elevations along the polyline, in meters.

- HeightResponse — Response from the elevation endpoint.
  - `id` string, nullable — The request identifier, if provided.
  - `shape` Coordinate[], nullable — The input shape, if provided as coordinates.
    - `lat` number, double, required — Latitude in decimal degrees.
    - `lon` number, double, required — Longitude in decimal degrees.
  - `encoded_polyline` string, nullable — The input polyline.
  - `height` number[], nullable — The list of heights for each point, in meters. Present only if `range` is `false`. Null values indicate missing data.
  - `range_height` array[], nullable — The list of ranges and heights for each point in the shape, where each entry is an array of length 2. Present only if `range` is `true`. In each pair, the first element represents the range or distance along the input locations. It is the cumulative distance along the previous coordinates in the shape up to the current coordinate. This value for the first coordinate in the shape will always be 0. The second element in the pair represents the height or elevation at the associated coordinate. The height is null if no height data exists for a given location. Both values are expressed in meters.
    - number[]

## Other responses

- `400` — Bad request; more details will be included

---

[API](https://skmtc.net/stadiamaps/apis/stadia-maps-geospatial-apis.md) · [All operations](https://skmtc.net/stadiamaps/apis/stadia-maps-geospatial-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/stadiamaps/stadia-maps-geospatial-apis/versions/99e0701a73aa/schema)
