---
title: "Along-route elevation profile endpoint (see module docs)."
method: POST
path: "/elevation/along"
tags: ["elevation"]
---

# Along-route elevation profile endpoint (see module docs).

`POST /elevation/along`

## Request

- Base URL: `https://api.mapmap.ai`
- URL: `https://api.mapmap.ai/elevation/along`
- Auth: one of:
  - HTTP bearer
  - API key in query parameter `api_key`

## Request body

- object

## Response `200`

`{samples: [{distance_m, lat, lon, elevation_m, source, resolution_m, grade_percent}], total_distance_m, total_ascent_m, total_descent_m, coverage_fraction, sample_count}`. `grade_percent` on sample i is the percent grade of the segment ending at i (null on sample 0, and whenever either endpoint lacks elevation). `total_ascent_m`/`total_descent_m` are null (not 0) when no consecutive pair of samples both have elevation

- object

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid API key
- `429`: Quota or rate limit exceeded
- `501`: Elevation not enabled on this deployment (SN_ELEVATION_ENABLED unset; the hosted gateway sets it true: this is a self-hosting gate for a Valhalla with no DEM tiles staged)
- `502`: Upstream routing engine failed

---

[API](https://skmtc.dev/mapmap/apis/sn-gateway.md) · [All operations](https://skmtc.dev/mapmap/apis/sn-gateway/llms.txt) · [OpenAPI document](https://skmtc.dev/mapmap/apis/sn-gateway/revisions/2293be8b4c38?raw)
