oslew docs
Console
Menu

EarthplatformoperationId observations

GET/v1/observations

One parameter's time series (air quality, weather) at the stations nearest a point, from a station feed.

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

Explained in Weather and air quality.

Example

Air temperature at the nearest station.

curl
curl -G "https://api.oslew.com/v1/observations" \
  -H "Authorization: Bearer $GEO_API_KEY" \
  --data-urlencode 'at=19.4326,-99.1332' \
  --data-urlencode 'parameter=temp_c'
Python
from oslew import Client

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

answer = client.observations("19.4326,-99.1332", "temp_c")
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.observations("19.4326,-99.1332", "temp_c");
Response
HTTP/1.1 200 OK
content-type: application/json
ratelimit-limit: 100
ratelimit-remaining: 295
ratelimit-reset: 1

{
  "at": [
    19.4326,
    -99.1332
  ],
  "parameter": "temp_c",
  "decimals": 1,
  "from": 1795019400,
  "to": 1795105800,
  "stations": [
    {
      "station": {
        "id": "MMMX",
        "name": null,
        "lat": 19.436,
        "lon": -99.072
      },
      "distance_m": 6428.533455622266,
      "points": [
        {
          "time": 1795103100,
          "value": 15
        }
      ]
    }
  ],
  "provenance": {
    "name": "metar",
    "release": "2026-11-19T16:30Z",
    "license": "US NWS / aviationweather.gov, public domain"
  },
  "took_us": 882
}

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

Query

NameTypeDescription
at
queryrequired
string
lat,lon.
parameter
queryrequired
string
pm25, o3, … as the feed names it; an unknown one lists what is loaded.
from
query
integer
Unix seconds; 24 hours before to when absent.
to
query
integer
Unix seconds; the feed's end when absent.
stations
query
integer
≥ 1, ≤ 10
default 1
Nearest stations to answer with.
radius_m
query
number
≤ 50000
default 50000

Responses

200 — Points per station, nearest first; at most 10,000 points in all.

  • atnumber[]required
  • decimalsintegerrequired
    Decimals the feed stores the parameter at.
  • fromintegerrequired
  • parameterstringrequired
  • provenanceSource | nullrequired
    • licensestringrequired
    • namestringrequired
    • releasestringrequired
  • stationsobject[]required
    • distance_mnumberrequired
    • pointsPoint[]required
      • timeintegerrequired
        Unix seconds.
      • valuenumberrequired
    • stationStationrequired
      • idstringrequired
      • latnumberrequired
      • lonnumberrequired
      • namestring | nullrequired
  • tointegerrequired
  • took_usintegerrequired

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 no station carries the parameter within the radius.
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

PM2.5 at the two nearest monitors
curl
curl -G "https://api.oslew.com/v1/observations" \
  -H "Authorization: Bearer $GEO_API_KEY" \
  --data-urlencode 'at=37.7749,-122.4194' \
  --data-urlencode 'parameter=pm25' \
  --data-urlencode 'stations=2'
Python
from oslew import Client

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

answer = client.observations("37.7749,-122.4194", "pm25", stations=2)
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.observations("37.7749,-122.4194", "pm25", { stations: 2 });
Response
HTTP/1.1 200 OK
content-type: application/json
ratelimit-limit: 100
ratelimit-remaining: 294
ratelimit-reset: 1

{
  "at": [
    37.7749,
    -122.4194
  ],
  "parameter": "pm25",
  "decimals": 1,
  "from": 1795035600,
  "to": 1795122000,
  "stations": [
    {
      "station": {
        "id": "060750005",
        "name": "San Francisco",
        "lat": 37.7658,
        "lon": -122.3978
      },
      "distance_m": 2151.382566508885,
      "points": [
        {
          "time": 1795035600,
          "value": 2
        },
        {
          "time": 1795039200,
          "value": 1
        },
        {
          "time": 1795042800,
          "value": 2
        },
        {
          "time": 1795046400,
          "value": 7
        }
      ]
    },
    {
      "station": {
        "id": "060010011",
        "name": "Oakland West",
        "lat": 37.8148,
        "lon": -122.282402
      },
      "distance_m": 12829.247075845218,
      "points": [
        {
          "time": 1795035600,
          "value": 3
        },
        {
          "time": 1795039200,
          "value": 5
        },
        {
          "time": 1795042800,
          "value": 4
        },
        {
          "time": 1795046400,
          "value": 1
        }
      ]
    }
  ],
  "provenance": {
    "name": "airnow",
    "release": "2026-11-19T21:00Z",
    "license": "US EPA AirNow, public domain"
  },
  "took_us": 275
}

A real response, captured from the service at commit b8f4bde-dirty. Timing fields such as took_us differ on every call. Shortened for the page: stations.0.points shows 4 of 23. Shortened for the page: stations.1.points shows 4 of 23.

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