The data API
Experimental. The API may change or break without notice, including routes, parameters and response shapes, and it has no versioning promise beyond the
/v1prefix. It runs on a best-effort basis with no guarantee of availability or of freshness: a run can reach the API late, or not at all. For anything that must keep working, read the static catalog and the Zarr stores directly (docs/stac.md,docs/zarr-profile.md), which are the published data contract.
In the viewer: /api is a console for these routes.
https://xue-api.ringsaturn.me is a read-only JSON service over the
published dataset. It resolves a run the way the STAC catalog does
(Collection → live pointer → manifest), reads the bundle’s Zarr store with
ranged requests and decodes the quantized codes with the same xue crate
the viewer’s wasm decoder uses. The point products — soundings, airports,
surface stations, air-quality stations, weather alerts, tropical
cyclones — it reads through their own pointer
and index, one station per ranged read, and answers in physical units. It
writes nothing. The viewer does not depend on it, so the site and the
catalog work when it is down.
This document is the contract (how the same routes run on a self-hosted
origin, and why, is in
contribution/api-origin.md). rust/xue-worker/static/openapi.json is
its machine copy, served at /v1/openapi.json with the live source list
filled in and rendered at /docs (Swagger UI). A test holds the two to the
same set of routes. https://xue.ringsaturn.me/api.html is a console
that builds and sends requests from a browser, and finds a /v1/cell
row and column from a latitude and longitude.
Everything a response says comes from the bucket at request time: the sources, a run’s variables, grids and codebooks. A new source, variable or run needs no deploy of the API.
Endpoints
All are GET (and HEAD), answer application/json; charset=utf-8 and
carry access-control-allow-origin: *, with
access-control-expose-headers naming the headers below (and
retry-after, age, cf-cache-status) so a page can read them.
OPTIONS answers the CORS preflight. Unknown query parameters are
ignored.
| Route | Answers | Cache-Control |
|---|---|---|
GET /health | {status, build, now}; never touches the bucket | no-store |
GET /v1/openapi.json | the OpenAPI 3.1 contract, its source enum the live Collections (also at /openapi.json) | max-age=60 |
GET /v1/catalog | {dataOrigin, collections: [{id, title, href}]}, one entry per child of the root catalog | max-age=60 |
GET /v1/sources/{source} | one source’s live run (§ Sources) | max-age=60 |
GET /v1/point | one cell’s series for one or more bundles (§ Point) | max-age=30, or a day with run= |
GET /v1/cell | one grid cell’s series in a named run (§ Cell) | a day |
GET /v1/soundings | the radiosonde stations of the live issue (§ Soundings) | max-age=60, or a day with issue= |
GET /v1/soundings/{station} | one station’s ascents | same |
GET /v1/airports | every airport’s newest observation (§ Airports) | same |
GET /v1/airports/{icao} | one airport’s METARs and TAF | same |
GET /v1/synop | every surface station’s current values (§ Surface stations) | same |
GET /v1/synop/{station} | one station’s 24-hour window | same |
GET /v1/aq | every air-quality station’s current values (§ Air-quality stations) | same |
GET /v1/aq/{station} | one air-quality station’s 24-hour window | same |
GET /v1/alerts | the weather alerts in force (§ Alerts) | same |
GET /v1/alerts/{id} | one alert’s full record | same |
GET /v1/storms | the tropical systems of the live issue (§ Storms) | same |
GET /v1/storms/{storm} | one storm’s tracks | same |
Every response carries x-xue-api (the build) and x-xue-ms (the
server’s own wall time, a diagnostic, not part of the contract). A point
or cell read carries x-xue-run, a product read x-xue-issue: what the request
resolved to.
Point
| Parameter | Required | Meaning |
|---|---|---|
source | yes | a Collection id: gfs, ecmwf, mrms, himawari, … |
lat | yes | degrees, −90 to 90 |
lon | yes | degrees, −180 to 360; a longitude past 180 wraps onto the same cell |
variables | no | bundle ids, comma-separated (tmp2m,wind10m) or repeated (variables=tmp2m&variables=wind10m); the run’s first bundle when absent |
time | no | an ISO 8601 instant; the frame nearest to it is returned. Without it the whole axis is |
run | no | pin a run instead of following the live pointer: a STAC Item id (gfs.2026092506, mrms.2026092509.1455), a run directory (mrms.2026092509/1455) or a run id |
The response:
variablesis a flat map keyed by variable id, whatever was asked for. A vector bundle answers as its components, each naming itsbundle. The API does not derive speed or direction.valuesfollowstime.timesone to one. Bundles of one run need not share an axis (ECMWF’s de-accumulatedpratehas no analysis frame), sotime.timesis the union of the requested bundles’ axes and a variable isnullat a time its bundle has no frame for; the order the bundles are listed in does not change the answer.nullis a missing code (the variable’snodataCode, or a chunk the store never wrote). Values are the codebook’s: a linear field is quantized to its step (0.1 °C fortmp2mread from a series store), a log1p field (prateon a map store, the aerosol fields) to its scale. A linear value is spelled with as many decimals as its codebook’soffsetandscaleneed (12.9, never12.900000000000006); a log1p value is spelled as computed.quantizationis that codebook, as the STAC Item’sxue:quantizationspells it (docs/stac.md). Alinearvalue isoffset + k × scale, withinscale / 2of the source field, and only in[offset, offset + maximumCode × scale]: a field beyond that range is clamped to it. Alog1pcodebook spaces its codes evenly inlog1p(value / scale)fromtracetomaximum, one step being(log1p(maximum / scale) − log1p(trace / scale)) / (maximumCode − minimumCode): a value well abovescaleis within half a step relative (about 3 % forprate), one well below it withinscale× half a step absolute. Belowtraceit is 0; abovemaximumit isnull(theoverflowCode).timesare UTC with milliseconds. On an observation window they are the frames’ own times; on the aurora window they are valid times about an hour ahead of the clock (docs/sources.md).cellis the grid cell the point falls in, by the rule the viewer’s probe and shader use (xue::zarr::probe_cell): nearest cell, longitude wrapped onto the grid’s origin. Itslongitudeandlatitudeare the cell’s true centre: through the projection on a projected grid, the Gaussian latitude on a Gaussian one.timezoneis the IANA zone of the requested point (not of the cell: on a coarse grid the cell centre can sit across a border from it), looked up in thetzf-rspolygon index compiled into the server. Open sea answers the nautical zone (Etc/GMT+10, whose sign is POSIX-inverted);nullonly where no polygon covers the point, which the bundled data does not have.timesstay UTC; the zone is for the client to convert them with.- A bundle whose manifest entry carries a
seriescompanion (docs/zarr-profile.md, “Series store”) is read through it: one chunk for the whole axis. Otherwise its map store is read, one chunk per time chunk. The response is the same either way.
Cell
The same read addressed by grid cell in a named run, for a client that
repeats a place: ask /v1/point once, then read the run, cell.row and
cell.column it answered. Every coordinate in a cell resolves to one URL,
and with the run fixed the answer never changes, so it caches for a day.
| Parameter | Required | Meaning |
|---|---|---|
source | yes | a Collection id |
run | yes | the run, spelled as for /v1/point; /v1/sources/{source} names the live one |
row, column | yes | the cell’s indices on the bundle’s grid, 0 at its first (north-west) cell. On a projected grid they count along the projection’s axes, so neither follows a parallel or a meridian |
variables | no | as for /v1/point; a bundle listed twice is read once |
time | no | as for /v1/point |
The response is /v1/point’s, with two differences: request echoes
{row, column, variables}, and timezone is the cell centre’s.
- Every requested bundle must be on one grid, since
row/columnindex it. A source’s bundles usually share a grid; a reduced-resolution variant or a wave field may not (400 grid_mismatch). Read those separately, each with the cell/v1/pointreports for it. - A cell’s address belongs to its run’s grid, which may change between runs
of one source (a model moved from a resampled to its native grid). Keep
run,cell.rowandcell.columntogether, and ask/v1/pointagain for a new run. - A
runthe prune jobs have deleted answers404 unknown_run: ask/v1/pointagain for the live run and its cell.
Sources
GET /v1/sources/{source} reads the source’s Collection and its live STAC
Item:
| Field | From |
|---|---|
source, title, description, license | the Collection |
run | the Item id, else the Collection’s xue:live |
runTime | the Item’s forecast:reference_datetime, else its datetime |
bbox, time | the Item’s bbox and cube:dimensions.time |
variables | the Item’s cube:variables as a flat table: {<variable id>: {bundle, label, unit, quantization}}, quantization its xue:quantization (null where the Item has none) |
The ids /v1/point?variables= accepts are the distinct bundle values of
variables. A source with no live Item answers an empty table.
kind says what the source is and endpoint which route reads it:
grid and /v1/point for a run or an observation window, point and the
product’s list route (/v1/soundings, /v1/airports, /v1/synop,
/v1/aq, /v1/alerts, /v1/storms) for a point product; null for a point product the API only
names (nexrad). Asking /v1/point for a point product is 400 not_a_grid, whose detail.endpoint is the right route.
Point products
The soundings (docs/sounding.md), airports (docs/airport.md), surface
stations (docs/synop.md), air-quality stations (docs/aq.md), weather
alerts (docs/alerts.md) and tropical cyclones (docs/tc.md) share one
shape on the bucket — a mutable latest-<product>.json naming an immutable
<product>.<issue>/index.json, the records beside it addressed by byte
span — and one shape here: a list route that answers the index, and a
record route that answers one station or storm. Each read costs the
pointer, the index (held in the isolate by its crc) and, for a record, one
ranged request of exactly that record’s bytes.
Every product answer opens with the same four fields:
| Field | Meaning |
|---|---|
product | sounding, airport, synop, aq, alerts, tc |
issue | the issue’s STAC Item id: sounding.2026091402, airport.202609161440 |
issued | the aggregation hour, or the ten-minute round |
generated | when the build ran |
and takes the same optional parameter:
| Parameter | Meaning |
|---|---|
issue | pin an issue instead of following the live pointer: <product>.<YYYYMMDDHH> for the hourly products, <product>.<YYYYMMDDHHMM> for the ten-minute rounds. The hourly products’ issues are found under their UTC day (sounding/2026/09/14/sounding.2026091402/), then flat; a pruned issue is 404 unknown_issue |
The four station lists (/v1/soundings, /v1/airports, /v1/synop,
/v1/aq) take the same spatial selection, and echo it as request:
| Parameter | Meaning |
|---|---|
lat, lon | together: sort the stations by great-circle distance from this point, nearest first, and add distanceKm (to a tenth) to each |
radius | with lat/lon: keep only stations within this many km |
bbox | west,south,east,north in degrees; west > east spans the antimeridian |
limit | at most this many stations: the nearest with lat/lon, the first in index order otherwise |
and count is the number of stations answered. The four record routes
take time, an ISO 8601 instant: only the record nearest to it is
answered (one ascent, one METAR, one observation time); without it the
whole window is. A station’s timezone is its IANA zone, as on /v1/point.
The lists are the index with its byte spans removed and nothing added but
distanceKm; sources is the build’s account of its inputs, verbatim.
Soundings
GET /v1/soundings answers stations[], each
{id, wmo, name, lat, lon, elev, latest, times, headline} as the index has
them (docs/sounding.md §4): id is the WIGOS identifier, wmo the
five-digit number, headline the newest ascent’s t500/td500 (°C),
freezingLevel (gpm), pw (mm) and levels.
GET /v1/soundings/{station} takes the WIGOS id or the WMO number and
answers:
soundingsis newest first, at most four nominal times (time=keeps one). The ascent’s fields are the product’s (docs/sounding.md§5).levelsare the product’s seven fixed-point arrays decoded:pPa → hPa,tandtdK × 100 → °C,wsm/s × 10 → m/s,z(gpm),wd(degrees the wind comes from) andsig(the BUFR 0 08 042 flag word) unchanged.-32768isnull. The arrays are parallel,nlong, andpis the axis: present on every level, strictly descending.derivedis the product’s, computed by the publisher from the fixed-point levels (docs/sounding.md§7), not recomputed here.
Airports
GET /v1/airports answers stations[], the index’s compact rows named:
{icao, lat, lon, elev, obsTime, t, td, wd, ws, gust, vis, qnh, category, tafPresent} (docs/airport.md §4), the values the newest observation’s,
tafPresent a boolean. category= keeps one flight category (VFR,
MVFR, IFR, LIFR). units names each value’s unit.
GET /v1/airports/{icao} takes the ICAO id in any case and answers
station (icao, name, lat, lon, elev, iata, wmo, timezone), units,
metars — the last 24 hours newest first, each a Metar of
docs/airport.md §5 verbatim (time, raw, t, td, wd, ws, gust, vis, qnh, slp, wx, cloud, category, auto, type) — and taf, the current Taf or
null. The product’s conventions hold: vis 10000 means at least 10 km,
wd is null for a variable wind, raw is the authority.
Surface stations
GET /v1/synop answers networks[] (each network’s entry of the index
without its file descriptors: id, name, cadence, prPeriod, attribution, license, url, latest, and whatever further fields the index gives a
network), elements (the element table, each {label, unit, cell, period}) and stations[]: {id, network, lat, lon, elev, rank, name, obsTime, values}, values keyed by element with the station’s
current value or null. network= keeps one network (404 unknown_network otherwise, detail.available listing them).
attribution is the credit a display of that network’s data must show.
GET /v1/synop/{station} takes <network>:<number> and answers in the
shape /v1/point does, so a client reads a station and a grid cell with
one type:
time.timesis the station’s window, oldest first, the product’s epoch seconds written as ISO instants;unitSecondsis the network’s cadence.variableshas one entry per element of the index, whether or not the station reports it (an element it never reported is allnull), withvaluesfollowingtimesone to one, and the element’slabel,unit,cellandperiod. There is nobundlefield.labelis the API’s own.unit,cell(point,mean,sum,max,min) andperiod(seconds a value covers, ending at its time;nullfor an instantaneous value;"network"for the network’s own period —prPeriod,wsPeriod) are the index’selementTable(docs/synop.md). A round written before the table has the API’s own unit andnullforcellandperiod.- The line’s further fields (quality codes, a WIGOS identifier) are not answered; read the product for them.
Air-quality stations
GET /v1/aq and GET /v1/aq/{station} read the air-quality product
(docs/aq.md) exactly as the surface-station routes read theirs, with the
same parameters, shapes and errors. The differences:
networks[]carryavgPeriod(seconds each value averages over) andpreliminary(unvalidated data, which a display must say) instead ofprPeriod; every element’speriodis the network’s ("network").- A list’s station carries
agencyaftername: the agency that runs the station and owns its data, which a display credits with the values where the network’s terms ask it to (AirNow). A record’sstationhasid, network, name, names, lat, lon, elev, rank, agency, timezone(nowmo). - The elements are
pm25,pm10(µg/m³),o3,no2,so2(ppb) andco(ppm), hourly means timed at the end of the hour; a station id is<network>:<the network's own id>(airnow:060371103).
Alerts
GET /v1/alerts answers the live snapshot (docs/alerts.md §5):
networks[] (each network’s entry of the index without its file
descriptor: id, name, attribution, license, url, latest, areas, with
areas.path resolved against the data root, /v1/catalog’s
dataOrigin), categories (the index’s list), alerts[] — {id, network, category, level, event, sent, onset, expires, bbox}, the index’s
rows named, in id order, bbox [west, south, east, north] or null —
and ended[], {id, network, reason, by} for each alert that left with
this round (reason expired, cancelled, replaced or gone; by
the id that replaced it, where the round names one, else null).
| Parameter | Meaning |
|---|---|
network | keep one network (nws, jma, eccc, meteoalarm, cma, hko, cwa); 404 unknown_network otherwise, detail.available listing them. Also filters ended[] |
category | keep one of the index’s categories; any other is 400 invalid_parameter, detail.available listing them |
level | keep the alerts at this level or above, an integer 1 … 5 |
lat, lon | together: keep the alerts in force at this point |
bbox | west,south,east,north; keep the alerts whose box meets it (west > east spans the antimeridian) |
limit | at most this many, the first in id order |
radius is refused (400 invalid_parameter): a point either is in an
alert’s area or is not. The point test has two tiers. An alert with its
own polygon (NWS storm-based warnings, every ECCC alert) is tested against
that polygon, read from its line; a MeteoAlarm alert that also names areas
by code (parts of its area the polygon does not draw) matches a point
outside the polygon by its box, as an area-coded alert does. An alert drawn only by area codes is
tested against its box, which is the union of its areas’ boxes and so
wider than the areas themselves: a point near such an alert’s edge can
match it without being in any of its areas. An alert with neither a
polygon nor a box (a network with no boundary set, such as jma, or a
round written before area boxes) matches no point and no bbox. A client
that needs the exact answer for coded alerts joins areas to the boundary
set (docs/alerts.md §9) itself. A point query costs one ranged read per
alert whose box holds the point.
GET /v1/alerts/{id} takes an alert id, percent-encoded where it carries
reserved characters (nws:urn:oid:…), and answers network and alert:
the alert’s line (docs/alerts.md §6) verbatim — id, network, category, level, native, sent, onset, expires, status, texts, areas, geometry, url, sender, and replaces where the round gives it — with bbox from its
row added. An id not in force in the issue is 404 unknown_alert; one
that ended with this round says how in detail.ended ({id, network, reason, by}), so a client following an alert sees what replaced it.
Storms
GET /v1/storms answers storms[], the index’s rows (docs/tc.md §4)
without their file descriptors: {id, level, basin, name, aliases, position, vmax, pmin, class, classAgency, agencies, models, best}, and crosswalk,
old id → current id. basin= and level= keep one basin (AL, EP,
CP, WP, IO, SH) or level (A, B, C), case-insensitive.
GET /v1/storms/{storm} takes a storm id, an id the issue’s crosswalk maps
onto a current one, or one of a storm’s aliases (EP97, ecmwf:70W), and
answers the storm document (docs/tc.md §5) with resolvedFrom naming
the id the request used when it was not the storm’s own:
id, level, basin, name, sid, intl, aliases, then best, agencies,
models, alert, impact and sources. include= (comma-separated
section names) answers only those sections; the seven identity fields are
always present.
A model’s ensemble (docs/tc.md’s Ensemble: leads, members and
flattened fixed-point arrays) is unpacked into one track per member:
lat/lon are degrees, vmax m/s, pmin hPa, time is base + lead;
a lead at which a member has no position is left out of its track, so a
member that never found the system has an empty points. Deterministic
forecasts and best tracks are passed through as the product writes them.
Errors
| Status | code | When |
|---|---|---|
| 400 | invalid_parameter | source, lat or lon missing or out of range; time not ISO 8601; run not a run name; issue not <product>.<digits>; /v1/cell without run, row or column, or a cell outside the grid (detail gives its rows and columns); lat without lon, radius without them, a malformed bbox, limit under 1; an include section that does not exist; an alerts level outside 1 … 5, a category the issue does not list, or radius on /v1/alerts |
| 400 | grid_mismatch | /v1/cell asked for bundles on different grids; detail.bundles names the first two |
| 400 | not_a_grid | /v1/point asked for a point product; detail.endpoint is the route that reads it |
| 404 | unknown_source | no such Collection |
| 404 | no_live_run | the Collection names no live pointer, the run publishes no bundles, or a product publishes no live issue |
| 404 | unknown_run | run= names no manifest |
| 404 | unknown_issue | issue= names no index (pruned, or never published) |
| 404 | unknown_variable | the run has no such bundle (detail.available lists those it has), or the bundle ships no store |
| 404 | unknown_station | the issue has no such sounding station, airport, surface station or air-quality station |
| 404 | unknown_network | network= names no network of the issue (detail.available lists them) |
| 404 | unknown_alert | the issue has no alert in force by that id (detail.ended says how it left, when it left with this round) |
| 404 | unknown_storm | no storm, crosswalk entry or alias by that id (detail.available lists the storms) |
| 404 | not_found | no such route |
| 403 | forbidden | a self-hosted origin set to answer only its proxy (XUE_API_REQUIRE_HEADER) was reached without it |
| 405 | method_not_allowed | anything but GET, HEAD, OPTIONS |
| 422 | point_off_grid | the point is outside a regional grid (HRRR, a satellite disk) |
| 502 | upstream_failed | a bucket read failed, or a document in it is not what the profile says |
| 429 | rate_limited | a self-hosted origin’s request budget is spent; retry after Retry-After seconds (also detail.retryAfter). Cached answers are not limited |
| 503 | overloaded | too many requests are being computed at once (on a self-hosted origin, possibly only this client’s, XUE_API_INFLIGHT_PER_CLIENT); retry after Retry-After seconds |
Errors are not cached.
Caching and freshness
- A
200from any/v1/data route is stored in the edge cache of the data center that served it, keyed by the full URL, for itsmax-age. A self-hosted origin also keeps it for that long and answers a repeat with the remaining lifetime asmax-age, so the two layers together never hold an answer longer than one would. - A live answer can therefore lag a new run by up to 30 s (60 s for the
catalog, the source summaries and the point products), and two data
centers can briefly answer from different runs. Pin
run=orissue=for a stable answer; it caches for a day because a run’s or an issue’s objects never change under it./v1/cellalways pins its run. - Inside an isolate (or the origin process), the manifest and a product’s index are held by their
pointer’s crc, store documents and shard indices by
path#crc32, and a station’s byte span bypath#crc32:offset+length. The Collection and the pointer are read on every uncached request, so the API never names a run or an issue the prune jobs have deleted.
Limits and attribution
- Requests are rate-limited per IP at the zone. The rule lives in the Cloudflare dashboard, not in this repository.
- There is no key, quota or SLA (see the experimental notice above).
- The data keep their sources’ licences. NOAA products are public domain
(attribution requested); ECMWF, EUMETSAT and JMA require attribution. The
Collection’s
licenseand itsproviders(/v1/sources/{source}, or the STAC Collection) say which applies to a source. - Every
timezonefield contains information from timezone-boundary-builder, which is made available here under the Open Database License (ODbL). The chain is © OpenStreetMap contributors → timezone-boundary-builder → the derived database tzf-dist →tzf-rs, which compiles it into the server; every link is ODbL. A client that shows or republishes those zones keeps that notice with them.
Not in this contract
- Spatial aggregates, area statistics, long-history stitching: those are the encoder’s job, published as products, not computed per request.
- Derived quantities over a product’s records (a skew-T index not in
derived, a METAR decoded further than the service decodes it, a storm’s impact area): the products define what is published and the API returns it; a client computes the rest. - Anything older than the live issue that the bucket no longer holds. The API reads what the prune jobs leave (seven days of hourly issues, three hours of ten-minute rounds); the archive is not its concern.
- The single-site radar (
nexrad): a polar Zarr product, named in/v1/sources/nexradand read from the catalog (docs/nexrad.md).
Part of the Xue specification, licensed under CC BY 4.0.