get_weather_history
Historical weather (archive) with server-side aggregation.
The archive holds 20 years, but how much of it a key may read depends on
its plan: startup includes the last 7 days, standard the last year,
premium and flexi all 20 years; byvalue reaches 366 days back and no
further. Older days need Meteosource's paid historical add-on (billed per
location and day); without it the API refuses such a day with "not
allowed to access historical data this old", reported per location, so
start inside the plan's range. Dates are YYYY-MM-DD, inclusive.
Granularity: 'hourly' (raw hours, max 14 days per call), 'daily'
(per-day min/max/avg/sum statistics, max 366 days) or 'monthly'
(folded from daily, max 366 days per call — call repeatedly for
multi-year analyses; results are cached so repeats are cheap).
Variables (default: temperature, precipitation, wind): cape, cloud_cover,
dew_point, evaporation, feels_like, humidity, irradiance, ozone,
precipitation, precipitation_type, pressure, soil_temperature,
surface_temperature, temperature, weather, wind, wind_distribution.
Aggregations per variable: temperature min/max/avg, precipitation sum,
wind speed avg + gusts max, irradiance sum in Wh/m2 (useful for PV
analysis), weather = most frequent code of the day, precipitation_types =
kinds seen that day (e.g. "rain,snow"; "none" when dry) — use weather and
precipitation_type to document what happened (snow, fog, thunderstorm).
wind_distribution (daily/monthly; for wind-turbine siting) = hours per
10 m wind-speed bin (wind_hours_0_2 … wind_hours_10_plus) and
wind_power_density_w_m2 = 1/2 * 1.225 * mean(v^3) at 10 m — scale to hub
height yourself (the API has no hub-height wind).
`normals=true` (daily/monthly) adds long-term columns for each calendar
day: temperature_normal_avg/min/max, temperature_record_min/max,
wind_normal_speed, wind_record_gusts, precipitation_normal_sum and
precipitation_normal_probability — compare a period with its normal in
one call. Each location+day costs one API request on first fetch;
a single call is capped at 400 location-days — split longer ranges
into multiple calls. Not available on the free tier (startup+).
Output: `columns` once at the top level; each location has `rows` as
arrays in column order (a year of daily rows is ~15 kB).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| units | No | metric | |
| date_to | Yes | ||
| normals | No | ||
| timezone | No | auto | |
| date_from | Yes | ||
| locations | Yes | ||
| variables | No | ||
| granularity | No | daily |