Skip to content
oslew
Get a free key

APIs

Elevation API

An elevation API returns the height of the terrain at a coordinate. oslew reads it from the Copernicus GLO-30 surface model, at a single point or at up to 512 samples evenly spaced along a path, and the same machinery reads any other raster loaded by name — forecast grids with a time axis among them. A companion route searches satellite scenes and answers with their metadata and links to the imagery, never with the pixels themselves.

Last reviewed

Three routes share one idea: a value that exists everywhere, rather than at named places. /v1/elevation reads the terrain. /v1/raster reads any gridded layer by name, the terrain included. /v1/scenes does not read a grid at all; it searches a catalogue of satellite acquisitions and tells you where each one’s files live.

A height, and what it measures

GET /v1/elevation?at=lat,lon returns elevation_m, interpolated bilinearly between the four grid samples around the point, and resolution_m, the spacing of the grid that answered. The source is stored to the whole metre, so the decimals in an answer are the interpolation’s arithmetic rather than extra precision.

Three properties of the number matter more than its decimals:

  • It is a surface. Copernicus GLO-30 is built from radar, and radar sees the top of whatever is there. A hiking path under trees or a courtyard between tall buildings will read higher than the ground a person stands on.
  • It is relative to the geoid. Heights are measured against EGM2008, close to mean sea level. A receiver’s height above the WGS84 ellipsoid is a different reference, and in most places the gap is large enough to matter, so convert before comparing.
  • An empty value is an answer. A point outside every elevation tile, or on a sample the source flags as void, comes back with elevation_m set to null in a normal 200 response. Only a deployment with no elevation layer at all refuses the request, and it says so in the error.

Profiles along a line

Swap at for path=lat,lon;lat,lon;… and add samples, capped at 512 samples. The service measures the whole polyline by great-circle distance and places the samples at equal intervals along it, the first on the start and the last on the end. It does not stop at your intermediate vertices unless a sample happens to land there, and the answer does not repeat the distance of each sample, because it is the line’s length divided evenly.

That design suits a climb profile for a ride or a hike. Take a route’s geometry from the routing API, thin it before sending — a full road geometry often runs to thousands of vertices and the path travels in the URL, where proxies cap the length — then sum the rises between samples. Two cautions apply. Samples packed closer than the grid spacing add nothing the model knows; samples spread thinly across a long route can straddle a bridge or a cutting. And because the source is a surface model, trees and buildings beside the road add small false climbs, so smooth the profile before totalling it. The route and the profile belong to different products, so the key’s plan needs both Routing and Platform.

Any raster, by name

GET /v1/raster?layer=… takes the same at, path and samples arguments and reads whatever the deployment ingested under that name: the terrain, forecast fields, or any other grid an operator loaded. Names are exact, and a name that is not loaded is refused with a message listing every name that is, which is the quickest way to discover what a deployment carries. Each answer states the layer’s units and resolution_m once, then a value per point, null outside the layer’s extent.

Forecast fields from ECMWF open data are loaded this way — ecmwf_2t for near-surface air temperature in kelvin, ecmwf_10u and ecmwf_10v for the two wind components, ecmwf_tp for precipitation accumulated since the model run began, ecmwf_msl for sea-level pressure. These layers have a time axis. Pass time in unix seconds and the value is interpolated in time as well as space, between the two valid times reported in between.

Linear interpolation has consequences worth planning for. Between steps far apart, a straight line from morning to evening passes under the afternoon peak. Outside the forecast’s span nothing fails: the nearest step’s value is held, and between names that step twice, so a request for next week quietly answers with the last step. Each field holds one model run at a time and a new run replaces it, so cache answers keyed by provenance.release. For readings from actual weather stations rather than model output, see the weather and air quality API.

Satellite scenes, as a catalogue

GET /v1/scenes searches a STAC catalogue — Sentinel-2 as indexed by Earth Search, where that catalogue is loaded — for acquisitions over an area in a date range, optionally under a cloud-cover ceiling, newest first. The area is either bbox, in STAC’s west, south, east, north order with longitude first, or at, a point in this API’s usual latitude-first order. Mixing the two orders up still produces four valid numbers and finds scenes somewhere else, so it is worth a test.

Each result is a full STAC item: its id, collection, acquisition time, bounding box, actual footprint, every catalogue property such as eo:cloud_cover, and an assets map linking every band, the scene classification layer and a thumbnail. Up to 500 scenes come back per request; to page further back in time, move to to just before the oldest scene you already have.

Three habits avoid wrong conclusions:

  • Test the footprint, not the box. Matching is on each scene’s bounding rectangle, and a tile at the edge of a swath can be partly empty. Check your point against geometry before choosing a scene.
  • Cloud cover is per scene. A low eo:cloud_cover can still hide your site; the classification asset labels each pixel, and reading it at your point is the only way to be sure.
  • The pixels stay where they are. Every href points at the host that stores the file. Send no oslew key there. The cloud-optimised GeoTIFFs can be read a window at a time over HTTPS; the JPEG 2000 copies sit in a requester-pays bucket, where the reader pays for transfer.

Attribution travels with each value

Each route answers with provenance, and each source asks for something different:

Route Source Licence What it asks of you
/v1/elevation Copernicus DEM Copernicus DEM licence (attribution: © DLR e.V. 2010-2014 and © Airbus Defence and Space GmbH 2014-2018 provided under COPERNICUS by the European Union and ESA) Reproduce the attribution wherever heights are shown
/v1/raster forecast fields ECMWF open data CC-BY-4.0 Name ECMWF as the source
/v1/scenes Earth Search various (per collection; Sentinel-2: CC-BY-SA-3.0-IGO) Follow the collection’s licence for anything made from the imagery

The licensing page sets out every layer’s terms side by side.

What it costs

All three routes belong to the Platform product. The Platform plan is $699 a month for 20 requests a second sustained, burst 100, with no monthly quota. A profile of many samples is still one request, so a long path costs the same share of the rate as a single point; the price of a big samples value is response size and latency, not capacity.

Limits worth knowing

  • Heights are answered at points and along lines only. There is no route that serves the model as tiles or files for download.
  • A path is a URL parameter, so very detailed geometries have to be simplified or split before sending.
  • Forecast fields hold one model run; an answer for a time the run does not cover is the nearest step’s value, flagged only by between.
  • Which rasters and scene collections exist is a property of the deployment. An empty scene list means nothing loaded matched, not that no satellite passed overhead.

Bottom line

Use /v1/elevation for terrain heights and profiles, knowing it measures the surface radar sees. Use /v1/raster for forecast grids and any other named layer, and read between before trusting a time. Use /v1/scenes to choose imagery, then fetch the pixels from their own host. To pull a height together with the administrative chain, time zone and nearest road for the same point, the point enrichment use case shows the one-call route.

Questions

Is the elevation the height of the ground or of the buildings on it?

It is the height of whatever the radar saw. Copernicus GLO-30 is a surface model, so in open country it is the ground, but over a forest it reads the canopy and in a dense city block it can read the roofs. Heights are relative to the geoid, roughly mean sea level, not to the ellipsoid a raw satellite position uses.

How many points can I sample along a path?

Up to 512 samples per request, spaced evenly by distance along the whole line from its first point to its last. The vertices in between are followed but not themselves sampled. For a very long line, split it and ask in pieces so the spacing stays fine enough to catch ridges and cuttings.

Does the scenes endpoint return satellite images?

No. It returns catalogue records — footprint, acquisition time, cloud cover and a link to every file of each scene. The imagery is read from those links on the host that stores it, without an oslew key, and a raster library can read just the window you need from a cloud-optimised file.

Can I get a weather forecast from the raster endpoint?

Yes, where ECMWF open-data fields are loaded. Ask /v1/raster for a field such as ecmwf_2t with a time, and the answer is interpolated in space and in time between the two forecast steps named in between. A time beyond the last step answers with that step’s value, so check between before trusting it.

What attribution do I need to show?

Elevations carry the Copernicus DEM licence, which asks you to reproduce its attribution sentence; forecast fields are CC-BY-4.0 and need ECMWF named. Satellite imagery carries its collection’s own licence — for Sentinel-2 a share-alike one — which applies to what you make from the pixels.

Browse every page →