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¶ms=wind,gusts&bbox=3,7,51,54&time_window_h=48&time_step_h=3"
Parameters
| Param | Required | Notes |
|---|---|---|
model | yes | Model id, e.g. harm-nl (see Models). |
params | yes | Comma-separated keys, e.g. wind,gusts,pressure. Must be offered by the
model. |
bbox | no | west,east,south,north in degrees. Defaults to the full model domain. Must lie
within it. |
time_window_h | no | Forecast horizon in hours (≥ 1). Defaults to the model's full horizon. |
time_step_h | no | Output step in hours (≥ 1). Defaults to the model's native step. |
spatial_factor | no | Integer 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/grib | Ad-hoc fetches, scripts, cron. The request changes each time, or you only need it once. |
| A slice | The 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.