Skip to main content

GET /v1/elevation

Overview​

Look up terrain elevation for one or more points. With range=true the response also pairs each point with its cumulative distance along the path: a ready-to-plot elevation profile for a bike ride or a hike. Other uses: grade-aware logistics (EV range, truck routes) and enriching GPS traces with altitude.

Cost: 2 credits per request (whatever the number of points). Availability: from the Startup plan.

Request​

GET https://api.geocodeme.net/v1/elevation

Required header: X-Api-Key: gm_YOUR_API_KEY

Parameters​

ParameterTypeRequiredDefaultDescription
pointsstringYesn/aPoints as lon,lat separated by | (1 to 500 entries), e.g. 6.8652,45.8326|6.8700,45.8300
rangebooleanNofalseWhen true, also return the cumulative-distance elevation profile (range_profile)
note

Remember to URL-encode the | separator as %7C if your HTTP client does not do it for you.

Code Examples​

curl -H "X-Api-Key: gm_YOUR_API_KEY" \
"https://api.geocodeme.net/v1/elevation?points=6.8652,45.8326%7C6.8700,45.8300&range=true"

Response​

info

All responses include rate limiting headers (X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Monthly-Remaining, etc.).

With range=true:

{
"elevations": [1035.0, 1002.0],
"range_profile": [
[0.0, 1035.0],
[472.0, 1002.0]
],
"attribution": "Route data (c) OpenStreetMap contributors; elevation (c) Tilezen/AWS",
"meta": {
"took_ms": 12,
"cache_hit": false
}
}

Without range, the response only contains elevations (the range_profile field is omitted, not null).

Schema​

FieldTypeDescription
elevationsarrayelevations[i] = height in meters of the i-th input point, or null when the point is outside known terrain
range_profilearray[cumulative_distance_m, height_m] pairs along the path, present only when range=true
attributionstringAlways "Route data (c) OpenStreetMap contributors; elevation (c) Tilezen/AWS"
meta.took_msintegerServer processing time in milliseconds
meta.cache_hitbooleanWhether the response was served from cache
null elevations

A null entry means the point falls outside the terrain model's coverage (for example, in open sea). The request itself still succeeds; check individual entries rather than the HTTP status.

Error Responses​

Too many (or zero) points​

{
"error": {
"code": "INVALID_PARAMETER",
"message": "'points' must contain between 1 and 500 'lon,lat' entries",
"field": "points"
}
}

Endpoint not included in your plan (Free)​

{
"error": {
"code": "PLAN_UPGRADE_REQUIRED",
"message": "The 'elevation' feature is not included in your plan. Upgrade to unlock it.",
"upgrade_url": "https://geocodeme.net/dashboard/billing"
}
}
tip

All endpoints are also subject to INVALID_API_KEY (401) and RATE_LIMIT_EXCEEDED / QUOTA_EXCEEDED (429) errors. See Error Codes for the full reference.