Querying data
Endpoints, parameters, points vs grid, forecast horizons and multi-model queries.
All forecast endpoints accept the same set of parameters and work with both GET
(parameters in the query string) and POST (parameters in a JSON body). Use POST when you
request many coordinates, to avoid URL-length limits.
Endpoints
| Endpoint | Purpose |
|---|---|
GET/POST /weather/v2/query | Convenience endpoint; auto-routes to operational or historical based on the requested period |
GET/POST /weather/v2/point/operational | Latest forecast for one or more points |
GET/POST /weather/v2/point/historical | Historical forecasts for one or more points (period required) |
GET/POST /weather/v2/area/operational | Latest forecast over a grid |
GET/POST /weather/v2/area/historical | Historical forecasts over a grid (period required) |
GET /weather/v2/meta | Model metadata (latest reference time, availability) |
GET /weather/v2/download/{token} | Download a generated NetCDF file |
All paths are relative to https://api.rebase.energy.
Parameters
| Parameter | Required | Default | Description |
|---|---|---|---|
model | yes | — | Model identifier, or several joined with + for a multi-model query |
latitude | yes | — | A single latitude or a comma-separated list (points), or the grid latitude axis |
longitude | yes | — | A single longitude or a comma-separated list |
variables | yes | — | Comma-separated variable names; use Variable:height for a level |
start-date | for historical | — | Start of the period (YYYY-MM-DD or YYYY-MM-DD HH:MM), in timezone |
end-date | for historical | — | End of the period; may be in the future for operational forecasts |
timezone | no | UTC | Timezone for input dates and returned timestamps |
reference-time-freq | no | 6H | Frequency of forecast runs to include; clamped up to the model's native run frequency |
valid-time-freq | no | — | Output time resolution within a forecast (e.g. 1H); values are interpolated to it |
forecast-horizon | no | latest | latest, full, or a list of lead-time hours (see below) |
interpolate | no | false | true = spatially interpolate to the exact coordinates; false = nearest grid point |
output-format | no | json | json or netcdf |
output-schema | no | list | For JSON: list (pandas-style) or xarray |
type | no | points | points (paired lat/lon) or grid (lat × lon mesh) |
wait | no | false | For NetCDF, block until the file is fully generated before responding |
overwrite | no | incompatible | Historical only: incompatible reuses an earlier answer to the same request until the model publishes a newer run inside the period; always recomputes every time; never currently behaves like always (see below) |
The point/* and area/* endpoints fix type to points and grid respectively; on the
generic /query endpoint you set type yourself.
Reused historical answers (overwrite)
A historical answer is computed once and kept: the same request (same model, points, variables,
period, frequencies and provider) is answered from it again. With the default
overwrite=incompatible, an answer whose period reached past the model's newest run is recomputed
as soon as a newer run inside the period is available; answers for periods that lie entirely in the
past are reused as they are. Leave the default unless your job must never receive an answer computed
before its own request (for example one that re-fetches the same period right as each run is
published); then send overwrite=always, which recomputes the answer on every request.
GET vs POST
With GET, lists are comma-separated strings in the query string. With POST, they can be JSON
arrays; the parameter names are the same (hyphenated) in both.
URL="https://api.rebase.energy/weather/v2/point/historical"
# GET: lists are comma-separated strings
curl -G "$URL" -H "Authorization: your_api_key" \
--data-urlencode "model=DWD_ICON-EU" \
--data-urlencode "latitude=60.1, 59.3" \
--data-urlencode "longitude=16.5, 18.1" \
--data-urlencode "variables=Temperature, WindSpeed" \
--data-urlencode "start-date=2023-08-01" \
--data-urlencode "end-date=2023-08-03"
# POST: lists can be JSON arrays; same (hyphenated) parameter names
curl -X POST "$URL" -H "Authorization: your_api_key" -H "Content-Type: application/json" \
-d '{"model": "DWD_ICON-EU", "latitude": [60.1, 59.3], "longitude": [16.5, 18.1],
"variables": ["Temperature", "WindSpeed"],
"start-date": "2023-08-01", "end-date": "2023-08-03"}'import requests
headers = {"Authorization": "your_api_key"}
url = "https://api.rebase.energy/weather/v2/point/historical"
# GET — lists are comma-separated strings
resp = requests.get(url, headers=headers, params={
"model": "DWD_ICON-EU",
"latitude": "60.1, 59.3",
"longitude": "16.5, 18.1",
"variables": "Temperature, WindSpeed",
"start-date": "2023-08-01",
"end-date": "2023-08-03",
})
# POST — lists can be JSON arrays; same (hyphenated) parameter names
resp = requests.post(url, headers=headers, json={
"model": "DWD_ICON-EU",
"latitude": [60.1, 59.3],
"longitude": [16.5, 18.1],
"variables": ["Temperature", "WindSpeed"],
"start-date": "2023-08-01",
"end-date": "2023-08-03",
})Points vs grid
- Points (
type=points):latitudeandlongitudeare paired element-by-element, so the lists must be the same length. Two values each → two points. - Grid (
type=grid):latitudeandlongitudedefine the axes of a mesh; every latitude is combined with every longitude. Grids are best retrieved withoutput-schema=xarray(oroutput-format=netcdf). Thearea/*endpoints use grid mode.
Forecast horizon
forecast-horizon controls which lead times you get back:
latest(default) — a single, continuous "best available" time series built from the most recent runs (each valid time taken from the latest run that covers it). Ideal for "what's the current forecast for the coming days". Served by the operational path.full— the entire forecast horizon of each run in the requested period, keyed by both reference time (run) and valid time.- a list of lead-time hours — e.g.
[0, 1, 2, 6, 12, 24]returns only those lead times from each run. OnGET, pass it as a string:forecast-horizon=[0, 6, 12, 24].
Reference time vs valid time
- Reference time (
ref_datetime) is when a forecast run was initialised.reference-time-freqselects how many runs to include (e.g.6H= every 6 hours), and is automatically clamped up to the model's own run frequency. - Valid time (
valid_datetime) is the time a value applies to.valid-time-freqresamples/interpolates the output to a target step (e.g.1H).
Height levels
Request a specific level with the Variable:height notation, e.g. WindSpeed:100
(100 m wind speed) or a native level like Temperature_Height:80.0. The harmonized
:10 / :100 levels are documented in Post-processed variables;
native level coordinates per model are in Models.
Multi-model queries
Combine models by joining identifiers with +, e.g. model=DWD_ICON-EU+NCEP_GFS. The
response is a single continuous series that fills each valid time from the first model that
provides it. Multi-model queries are restricted to:
- post-processed (harmonized) variables only,
forecast-horizon=latest,output-format=json,output-schema=list,type=points.
Interpolation
By default (interpolate=false) values come from the nearest model grid point. Set
interpolate=true to spatially interpolate to your exact coordinates.