oslew docs
Console
Menu

EarthplatformoperationId raster

GET/v1/raster

Any named raster layer (solar irradiance, land cover, elevation) at a point or sampled evenly along a path.

Send Authorization: Bearer sk_live_…. The key's plan must include theplatform product; which plans do.

Explained in Errors, Everything at a point, Weather and air quality and Elevation and rasters.

Example

Forecast 2 m temperature at an instant.

curl
curl -G "https://api.oslew.com/v1/raster" \
  -H "Authorization: Bearer $GEO_API_KEY" \
  --data-urlencode 'layer=ecmwf_2t' \
  --data-urlencode 'at=19.4326,-99.1332' \
  --data-urlencode 'time=1795132800'
Python
from oslew import Client

# The key is read from GEO_API_KEY.
client = Client(base_url="https://api.oslew.com")

answer = client.raster("ecmwf_2t", time=1795132800, at="19.4326,-99.1332")
TypeScript
import { Client } from "@oslew/client";

// The key is read from GEO_API_KEY.
const client = new Client({ baseUrl: "https://api.oslew.com" });

const answer = await client.raster("ecmwf_2t", { time: 1795132800, at: "19.4326,-99.1332" });
Response
HTTP/1.1 200 OK
content-type: application/json
ratelimit-limit: 100
ratelimit-remaining: 297
ratelimit-reset: 1

{
  "layer": "ecmwf_2t",
  "units": "K",
  "resolution_m": 27830,
  "time": 1795132800,
  "between": [
    1795132800,
    1795132800
  ],
  "results": [
    {
      "lat": 19.4326,
      "lon": -99.1332,
      "value": 289.96362847999995
    }
  ],
  "provenance": {
    "name": "ecmwf-open-data",
    "release": "2026111906",
    "license": "CC-BY-4.0"
  },
  "took_us": 80
}

A real response, captured from the service at commit b8f4bde-dirty. Timing fields such as took_us differ on every call.

Query

NameTypeDescription
layer
queryrequired
string
The layer's name as ingested: elevation, solar_ghi, ecmwf_2t, …; an unknown name lists the loaded ones.
time
query
integer
Unix seconds, for a field with a time axis: linear between the two valid times around it; now when absent.
at
query
string
lat,lon; one of at or path.
path
query
string
lat,lon;lat,lon;…
samples
query
integer
≥ 2, ≤ 512
default 32

Responses

200 — Values in the layer's units, bilinear; null outside coverage.

  • betweeninteger[] | nullrequired
    The two valid times interpolated between.
  • layerstringrequired
  • provenanceSource | nullrequired
    • licensestringrequired
    • namestringrequired
    • releasestringrequired
  • resolution_mnumberrequired
  • resultsobject[]required
    • latnumberrequired
    • lonnumberrequired
    • valuenumber | nullrequired
  • timeinteger | nullrequired
    The instant answered, for a field with a time axis.
  • took_usintegerrequired
  • unitsstringrequired

With RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset(and their X-RateLimit-* aliases); see rate limits.

Refusals

Every refusal is a JSON object with an error string, except where noted.

400Bad request or unknown layer.
401No key, or one that is unknown, revoked or suspended.
403The key's plan does not include this route's product, or the request is larger than the plan allows. The body names the plan that does.
429This product's bucket is empty: the key is going faster than its plan's sustained rate. Wait Retry-After seconds; nothing is used up. Carries Retry-After.
503The pod cannot reach the control plane and its entitlements are too old to trust. Retry.

A malformed query string or JSON body is refused by the framework before this route runs, in plain text rather than JSON; see errors.

More examples

A layer that is not loaded names the ones that are
curl
curl -G "https://api.oslew.com/v1/raster" \
  -H "Authorization: Bearer $GEO_API_KEY" \
  --data-urlencode 'layer=solar_ghi' \
  --data-urlencode 'at=19.4326,-99.1332'
Python
from oslew import Client

# The key is read from GEO_API_KEY.
client = Client(base_url="https://api.oslew.com")

answer = client.raster("solar_ghi", at="19.4326,-99.1332")
TypeScript
import { Client } from "@oslew/client";

// The key is read from GEO_API_KEY.
const client = new Client({ baseUrl: "https://api.oslew.com" });

const answer = await client.raster("solar_ghi", { at: "19.4326,-99.1332" });
Response
HTTP/1.1 400 Bad Request
content-type: application/json
ratelimit-limit: 100
ratelimit-remaining: 296
ratelimit-reset: 1

{
  "error": "no raster layer `solar_ghi`; loaded: elevation, ecmwf_10u, ecmwf_10v, ecmwf_2t, ecmwf_msl, ecmwf_tp"
}

A real response, captured from the service at commit b8f4bde-dirty. Timing fields such as took_us differ on every call.

Rendered from the OpenAPI document at commit b8f4bde-dirty; the same document is served at/v1/openapi.json and generates both clients.