On this page

    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.

    Key

    You need a MapTiler API key to use this service. Get it here and learn how to protect it.

    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 at given locations. If unit is omitted, elevation values are in meters.

    Request

    You must include an API Key with every API request

    Path Parameters

    Parameters Type Description
    locations
    string
    List of lng,lat WGS 84 positions seperated by ; delimeter (Max 50 positions). Longitude values must be > -180 < 180. Latitudes must be >= -85 <= 85.
    Example: 17,50;-133.5,58.39

    Query Parameters

    Parameters Type Description
    unit
    string
    Unit of the elevation.
    Allowed values: meters feet
    Default: meters
    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 [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

    Was this helpful?

    MapTiler Cloud API
    Elevation API
    Elevation API