Elevation API
The MapTiler Elevation API makes it possible to get accurate altitude above mean sea level for any place on Earth. See the intro to elevation to learn how it works and what you can use it for.
How to use the API
- Directly from your web or backend applications.
- Via the Elevation API client library, which wraps the API calls in ready-made functions for easier use in JavaScript. This is the best option if you don’t need a map.
- With our complete map SDK for JavaScript. It provides an elevation profile module to add a control to your map which draws the elevation profile for a specified route.
You can get elevation for a single point or multiple points at once by providing their coordinates. Note that each pair of coordinates counts separately towards your API quota.
Get elevation
GET https://api.maptiler.com/elevation/{locations}.json
Get the elevation in meters at given locations.
Request
You must include an API Key with every API request
Path Parameters
| Parameters | Type | Description |
|---|---|---|
| locations | string |
List of lng,lat pairs seperated by ; delimeter (Max 50 pairs). Longitude values must be > -180 < 180. Latitudes values must be >= -85 <= 85.
Example: 17,50;-133.5,58.39 |
Request example
https://api.maptiler.com/elevation/17,50;-133.5,58.39.json?key=YOUR_MAPTILER_API_KEY
Get your FREE API key in your MapTiler account.
Responses
| Code | Content | Description |
|---|---|---|
| 200 | application/json | ElevationResults |
| 400 |
Out of bounds |
ElevationResults
Array of locations with elevation in meters [lng, lat, ele]
Array of array (3 items) [number]
ElevationResults example
[
[17, 50, 364.20001220703125],
[-133.5, 58.39, 1323.800048828125]
]
Using the OpenAPI Specification?
Get the openapi.yaml
On this page