The Elevation API is a web service that returns elevation data, in meters relative to local mean sea level, for one or more locations on the earth, or sampled elevation data along a path. Requests are HTTPS URLs and responses are JSON or XML.
Elevation API: key facts
- Product: Elevation API
- Category: Maps
- Platform: Web service (REST)
- Runs on: Server (backend code)
- Launch stage: GA
- Lifecycle: Active
- Overview: Elevation API overview
- Regional availability: Global. The Get started page says elevation data is available for all locations on the surface of the earth, including depth locations on the ocean floor, which return negative values. The docset has no coverage page.
Elevation API: when to use it
Use Elevation API when:
- You need the elevation, in meters relative to local mean sea level, for one or more latitude/longitude points from a server.
- You need an elevation profile sampled at equidistant points along a path, for example elevation gain and loss for hiking or biking.
- You need ocean-floor depth or below-sea-level elevation values (returned as negative numbers).
Don't use Elevation API when:
- You need elevation data client-side in a browser map; the Maps JavaScript API has its own
ElevationService. Use Maps JavaScript API instead.
Elevation API: setup
- Service to enable:
elevation-backend.googleapis.com - Authentication: API key
- Get started: Set up Elevation API
- Reference: Elevation API reference
- Pricing: Elevation API usage and billing
- Policies: Elevation API policies
Elevation API: common mistakes
- Problem: When you pass several coordinates in one request, especially points that are far apart, the API may smooth the data and return less accurate elevations. The only sign is a larger
resolutionvalue; the response has no warning field or degraded-accuracy status. Fix: To get the most accurate elevation for a point, query that point by itself, and check theresolutionfield in each result. See /maps/documentation/elevation/requests-elevation. - Problem: More than 512 points or coordinates in the
locationsorpathparameter returnsINVALID_REQUEST. Fix: Split large point sets into batches of 512 or fewer. Use encoded polylines to keep URLs short. See /maps/documentation/elevation/requests-elevation. - Problem: Request URLs must be properly encoded and are limited to 16384 characters. Browsers, proxies, and servers can have lower limits. Fix: URL-encode parameters and use the
enc:encoded polyline format for long coordinate lists. See /maps/documentation/elevation/requests-elevation. - Problem: The per-minute request limit is the sum of server-side Elevation API requests and client-side Maps JavaScript API
ElevationServicerequests in the project. Fix: Plan quota for both client-side and server-side traffic, or request a quota increase. See /maps/documentation/elevation/usage-and-billing.
What you can do with Elevation API
See the guides linked below for each task, or compare across products in the Capabilities Explorer.
- Return the elevation of a set of latitude/longitude coordinates.
- Return the difference in elevation along a path between two or more sets of latitude/longitude coordinates.