Weather forecast for a Spanish municipality
get_forecastFetch AEMET forecasts for any Spanish municipality by name or INE code. Choose daily data (temperature, sky, precipitation, wind) for up to 7 days or hourly data for the next 40 hours.
Instructions
Returns the AEMET forecast for any of Spain's 8000+ municipalities. Accepts a name (with or without accents) or INE code. Daily granularity returns temperature min/max, sky state, precipitation probability and wind for each day. Hourly returns the next ~40h.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Daily forecasts: number of days to include (1-7, default 3). Ignored when granularity='hourly'. | |
| location | Yes | Spanish municipality, either by name (e.g. 'Madrid', 'Logroño', 'A Coruña') or by 5-digit INE code (e.g. '28079'). | |
| granularity | No | 'daily' (default) summarises up to 7 days. 'hourly' returns hour-by-hour values for the next ~40 hours. |