# Elevation API | Rijwind docs

# Elevation

Get the ground elevation (metres above sea level) for a set of points, or build
an elevation profile along a route — for climb totals, gradient charts, and
"how much climbing is in this ride?".

`POST /elevation/v1` returns one elevation per input coordinate. There are two
input modes — use exactly one.

**Cost:** 1 unit per call.

## Points

Pass up to **512** discrete coordinates. You get one elevation back per point,
in the same order.

```bash
curl -X POST https://api.rijwind.com/elevation/v1 \
  -H "Authorization: Bearer rw_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "points": [ { "lat": 50.7536, "lon": 6.0208 }, { "lat": 52.3730, "lon": 4.8910 } ] }'
```

```json
{
  "elevations": [
    { "lat": 50.7536, "lon": 6.0208, "elevation": 322.4 },
    { "lat": 52.373, "lon": 4.891, "elevation": 2 }
  ]
}
```

`elevation` is `null` where there's no coverage (e.g. open ocean).

## A route — `encodedPolyline`

For a whole route or GPS track, send the geometry as a single **encoded
polyline** (precision 6 — the same `shape` the routing endpoints return) and the
API samples it at `samples` evenly-spaced points along the line. Send one
compact polyline instead of thousands of track points and get a clean,
fixed-size profile back.

```bash
curl -X POST https://api.rijwind.com/elevation/v1 \
  -H "Authorization: Bearer rw_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "encodedPolyline": "_p~iF~ps|U_ulLnnqC", "samples": 256 }'
```

`samples` defaults to **256** and is capped at **1000**.

## With the SDK

```ts
import { createClient } from "@rijwind/sdk/client";

const client = createClient({ apiKey: "rw_live_…" });

// Points
const { data } = await client.elevation({
  points: [{ lat: 50.7536, lon: 6.0208 }],
});

// Or a route profile straight from a directions result
const route = await client.route({ locations: [a, b], costing: "bicycle" });
const shape = route.data!.trip.legs[0].shape;
const profile = await client.elevation({ encodedPolyline: shape, samples: 200 });
```

Elevations come from a global elevation model. Along a route, the **total
ascent** is more meaningful than any single point's exact value.

---

Looking to show shaded relief or 3D terrain **on a map**? That's part of the
[basemap](/basemap#terrain-and-hillshade), not this API.
