Historical climate records from the nearest AEMET climatological station
get_climate_historyRetrieve historical weather observations (temperature, precipitation, wind, humidity, sunshine) for any Spanish location, with daily records or long-term monthly averages.
Instructions
Finds the AEMET climatological station closest to the requested location and returns its measured history. mode='range' returns daily records (temperature, precipitation, wind, humidity, sunshine) between two dates; AEMET serves at most 6 months (186 days) per call, so longer histories need several calls. Ranges longer than 31 days are condensed into one line per month (mean max/min, total precipitation, rainy days, extremes) instead of one line per day. mode='normals' returns the station's long-term monthly averages. Use this for past weather and climate questions, not for forecasts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | End date as YYYY-MM-DD. Defaults to today when mode='range'. | |
| from | No | Start date as YYYY-MM-DD. Required when mode='range'. | |
| mode | No | 'range' (default) returns observed daily records between `from` and `to`. 'normals' returns the station's long-term monthly averages and ignores the dates. | |
| location | Yes | Where to look. Accepts a Spanish municipality name ('Madrid'), 5-digit INE code ('28079'), or a decimal coordinate pair ('40.4168,-3.7038'). |