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

GET https://api.mapzena.com/v1/elevation

Batch lookup

POST https://api.mapzena.com/v1/elevation/batch

Parameters - single point

ParameterTypeRequiredDescription
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

bash - curl
curl "https://api.mapzena.com/v1/elevation?lat=45.8325&lon=6.8652&key=YOUR_KEY"

Example response - single

json
{
  "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.

json - POST body
{
  "points": [
    { "lat": 45.8325, "lon": 6.8652  },
    { "lat": 27.9881, "lon": 86.9250 },
    { "lat": 36.4561, "lon": 138.5044}
  ]
}
json - batch response
{
  "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

HTTPCodeDescription
400missing_coordinateslat or lon is absent.
400invalid_coordinatesCoordinates out of range.
400batch_too_largeBatch request exceeds 100 points.
404not_foundNo modeled elevation value is available for this coordinate.
429rate_limit_exceededQuota reached.

Code examples

PHP - single

php
<?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';