Downloading GRIBs

There are two ways to get a GRIB out of WeatherFiles. They share the same slicing engine and the same parameters — the difference is whether you persist the request.

One-shot — GET /v1/grib

Pass the whole request in the query string and get a GRIB2 streamed straight back. Nothing is saved server-side. This is the right primitive for scripts, cron jobs and one-offs.

curl -H "Authorization: Bearer $WF_TOKEN" -L -o forecast.grib2 \
  "https://api.weatherfiles.com/v1/grib?model=harm-nl&params=wind,gusts&bbox=3,7,51,54&time_window_h=48&time_step_h=3"

Parameters

ParamRequiredNotes
modelyesModel id, e.g. harm-nl (see Models).
paramsyesComma-separated keys, e.g. wind,gusts,pressure. Must be offered by the model.
bboxnowest,east,south,north in degrees. Defaults to the full model domain. Must lie within it.
time_window_hnoForecast horizon in hours (≥ 1). Defaults to the model's full horizon.
time_step_hnoOutput step in hours (≥ 1). Defaults to the model's native step.
spatial_factornoInteger downsample factor (≥ 1) to coarsen the grid and shrink the file.

bbox order is west,east,south,north — longitudes first, then latitudes. This is the most common mistake; a transposed box either errors (outside the domain) or returns the wrong area.

Saved — slices

A slice persists the request and gives you a stable /v1/dl/<token> URL that always serves the model's latest run. Use slices for downloads you repeat, refresh, share or manage — e.g. a route you re-pull each run, or a fixed area you keep on your chartplotter.

Which one?

Use…When
/v1/gribAd-hoc fetches, scripts, cron. The request changes each time, or you only need it once.
A sliceThe same request repeatedly. You want a permanent URL, refresh-on-new-run, tags, and a list of what you've saved.

The output

Either way you get a standard GRIB2 file. Our model-specific encoding fixes mean it opens correctly in XyGrib, Expedition, qtVlm and LuckGrib, and in OpenCPN's built-in GRIB display via the weatherfiles_pi plugin.

Next: Slices · code samples.