Elevation API
Query terrain and bathymetry values in metres or feet for any geographic coordinate. Powered by SRTM15+ with variable effective resolution, interpolation where needed, and support for negative elevations.
Elevation API
The Elevation API returns the terrain height above mean sea level for any lat/lon point on Earth. Results include both metric and imperial values, the data source used, and the effective resolution at that point. Batch lookups of up to 100 points per request are supported.
Endpoints
Single point
Batch lookup
Parameters - single point
| Parameter | Type | Required | Description |
|---|---|---|---|
key |
string | optional | Optional in free mode. Required for metered usage above the free allowance. |
lat |
float | required | Latitude in decimal degrees. |
lon |
float | required | Longitude in decimal degrees. |
units |
string | optional | metric (default) or imperial. Affects elevation field; both values are always present in the response. |
Example request - single
curl "https://api.mapzena.com/v1/elevation?lat=45.8325&lon=6.8652&key=YOUR_KEY"
Example response - single
{
"status": "ok",
"lat": 45.8325,
"lon": 6.8652,
"elevation_m": 4808,
"elevation_ft": 15774,
"source": "SRTM15+",
"resolution_m": 12.5,
"location": {
"display_name": "Mont Blanc, Haute-Savoie, France",
"country_code": "FR"
}
}
Batch request
POST a JSON body with a points array of up to 100 coordinate objects. Each batch request counts as one request unit per point.
{
"points": [
{ "lat": 45.8325, "lon": 6.8652 },
{ "lat": 27.9881, "lon": 86.9250 },
{ "lat": 36.4561, "lon": 138.5044}
]
}
{
"status": "ok",
"count": 3,
"results": [
{ "lat": 45.8325, "lon": 6.8652, "elevation_m": 4808 },
{ "lat": 27.9881, "lon": 86.9250, "elevation_m": 8849 },
{ "lat": 31.5590, "lon": 35.4732, "elevation_m": -430 }
]
}
Data source
Elevation and bathymetry values are sourced from SRTM15+. Effective resolution is variable and can reach down to about 1 metre in some locations, with interpolation applied where source spacing is coarser. The model supports negative elevations for below-sea-level terrain and water bodies.
Error codes
| HTTP | Code | Description |
|---|---|---|
| 400 | missing_coordinates | lat or lon is absent. |
| 400 | invalid_coordinates | Coordinates out of range. |
| 400 | batch_too_large | Batch request exceeds 100 points. |
| 404 | not_found | No modeled elevation value is available for this coordinate. |
| 429 | rate_limit_exceeded | Quota reached. |
Code examples
PHP - single
<?php $key = 'YOUR_KEY'; $url = "https://api.mapzena.com/v1/elevation?lat=27.9881&lon=86.925&key={$key}"; $el = json_decode(file_get_contents($url), true); echo $el['elevation_m'] . ' m';