canonical: https://jentic.com/apis/aemet.es/aemet

# Aemet Es AEMET OpenData

AEMET OpenData is the open data REST API operated by Spain's national meteorological agency (Agencia Estatal de Meteorología). It exposes 62 endpoints covering current observations, short and medium-range forecasts at municipal, provincial, autonomous-community and national level, maritime and mountain forecasts, climatological products, fire-risk maps, lightning networks, radar imagery, and weather warnings. AEMET publishes its own OpenAPI document for this API, and the specification behind this page is a curated Jentic variant built from that document, covering 62 of its 64 operations and kept validated and agent-ready. Authentication uses an api_key passed in the api_key header obtained free of charge from the AEMET portal.

## For AI agents

Pull official Spanish weather observations, forecasts, climatology, fire risk, radar, and CAP warnings across 62 REST endpoints from the national met agency.

## Scope

Does not cover non-Spanish locations, commercial weather routing, or aviation METAR/TAF feeds - use for AEMET-published Spanish weather, climatology, and warnings only.

## Capabilities

- Retrieve current observations from AEMET's network of conventional weather stations
- Pull municipal, provincial, regional, and national forecasts for today, tomorrow, and medium-range
- Access maritime forecasts for coastal zones and high seas around the Iberian peninsula
- Get mountain and snow-condition forecasts for ski and outdoor planning
- Read CAP-formatted weather warnings and historical warning archives
- Pull climatological products including monthly summaries, water balance, and station shapefiles
- Access fire-risk maps, lightning network data, ozone profiles, and national radar imagery

## Use cases

### Spain-Specific Weather Application

Build a Spanish-language weather product using authoritative national-agency data instead of third-party aggregators. AEMET OpenData covers municipal forecasts via /api/prediccion/especifica/municipio/diaria/{municipio}, station-level observations via /api/observacion/convencional/datos/estacion/{idema}, and the master list of Spanish municipalities via /api/maestro/municipios. All responses are referenced to AEMET station identifiers and INE municipality codes.

Example prompt: Call GET /api/maestro/municipios to find the code for Sevilla, then call /api/prediccion/especifica/municipio/diaria/{municipio} to get the 7-day forecast

### Emergency and Warning Monitoring

Subscribe to AEMET CAP warnings for civil-protection or operational alerting in Spain. The /api/avisos_cap/ultimoelaborado/area/{area} endpoint returns the most recent warning bundle for a meteorological area, while /api/avisos_cap/archivo/fechaini/{fechaIniStr}/fechafin/{fechaFinStr} returns historical warnings for incident review and audit trails. Pair with the radar and fire-risk endpoints for an operational picture during severe weather.

Example prompt: Call GET /api/avisos_cap/ultimoelaborado/area/61 to fetch the latest warnings for the Comunidad Valenciana area and parse the CAP XML for active alerts

### Climatology and Research Datasets

Pull long-running climatological products for research, sustainability reporting, or insurance modelling. /api/productos/climatologicos/resumenclimatologico/nacional/{anio}/{mes} returns the national monthly summary, /api/productos/climatologicos/balancehidrico/{anio}/{decena} returns the water balance for a 10-day period, and the network endpoints expose ozone, radiation, and background-pollution series.

Example prompt: Call GET /api/productos/climatologicos/resumenclimatologico/nacional/2025/05 to retrieve the May 2025 national climatological summary

### AI Agent Spanish Weather Tool

Equip an AI agent with authoritative Spanish weather data through Jentic. The agent searches by intent for the right AEMET endpoint - municipal forecast, station observation, or active warning - loads its schema, and executes with the api_key isolated in your Jentic One instance. Useful for travel, logistics, or safety assistants whose users ask in Spanish or about Spanish locations.

Example prompt: Search Jentic for 'spanish municipal weather forecast', load /api/prediccion/especifica/municipio/diaria/{municipio} schema, and execute with municipio=28079 for Madrid

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /api/prediccion/especifica/municipio/diaria/{municipio} | Daily forecast for a Spanish municipality |
| GET | /api/observacion/convencional/datos/estacion/{idema} | Observations from a specific weather station |
| GET | /api/avisos_cap/ultimoelaborado/area/{area} | Latest CAP weather warnings for an area |
| GET | /api/prediccion/maritima/costera/costa/{costa} | Coastal maritime forecast |
| GET | /api/maestro/municipios | List all supported Spanish municipalities |
| GET | /api/productos/climatologicos/resumenclimatologico/nacional/{anio}/{mes} | National monthly climatological summary |
| GET | /api/red/radar/nacional | Latest national radar imagery |

## Key resources

- **Predicciones especificas** — Municipal, beach, mountain, snow, and UV forecasts
- **Predicciones normalizadas texto** — Standard text forecasts for autonomous communities, provinces, and the nation
- **Observacion convencional** — Real-time observations from AEMET conventional stations
- **Avisos CAP** — Common Alerting Protocol weather warnings, current and archived
- **Prediccion maritima** — Coastal and high-seas marine forecasts
- **Productos climatologicos** — Monthly climate summaries, water balance, and station shapefiles
- **Indices incendios** — Estimated and forecast fire-risk maps
- **Red radares** — National radar imagery
- **Maestro** — Master lists of municipalities and stations

## Why Jentic

- **Setup:** Wiring AEMET OpenData by hand means managing its api_key header and finding the right operation among dozens of Spanish forecast, observation, and warning paths. Through Jentic you install once, import AEMET OpenData from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** AEMET puts location codes such as the municipio or estacion in the URL path, and every operation is a read, so a rule can pin the agent to the forecast and observation reads it needs. You choose which read operations are in the allowed set, so anything you leave out is not reachable.
- **Credential handling:** Your AEMET api_key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'Spanish municipal weather forecast', and Jentic returns the matching AEMET operation with its input schema, including the municipio path parameter, so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **OpenWeatherMap** — Global weather and forecast API with broad coverage outside Spain
- **WeatherAPI.com** — Commercial global weather and astronomy data API
- **Open-Meteo** — Free, no-auth weather API combining multiple national models
- **Meteostat** — Historical weather observations from stations worldwide

## FAQ

### Which OpenAPI specification does this AEMET OpenData page describe?

A curated Jentic specification covering 62 AEMET OpenData operations, built from AEMET's own OpenAPI document. AEMET publishes that document at `https://opendata.aemet.es/AEMET_OpenData_specification.json`, the file its Swagger UI documentation loads, and it declares 64 operations. The Jentic variant omits the two bulk all-municipality forecast endpoints and keeps the remaining 62 validated and agent-ready, against the same 2.0 API version and the same base URL as AEMET's document. Read AEMET's document as the upstream reference. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the AEMET OpenData API use?

AEMET uses an api_key passed in a header named api_key, obtained free of charge from https://opendata.aemet.es/centrodedescargas/altaUsuario after agreeing to the reuse conditions. Through Jentic the key is stored in the vault and injected at execution time.

### Which Spanish locations does AEMET OpenData cover?

AEMET covers all Spanish municipalities (call GET /api/maestro/municipios for the master list using INE codes), every autonomous community and province for regional forecasts, the coastal areas and high seas around Iberia and the Canaries, and the conventional observation network for station-level data.

### How do I get active weather warnings for a region in Spain?

Call GET /api/avisos_cap/ultimoelaborado/area/{area} with the AEMET area code; the response contains a CAP-formatted XML bundle of every active warning for that area. For historical review use /api/avisos_cap/archivo/fechaini/{fechaIniStr}/fechafin/{fechaFinStr} with date range parameters.

### What are the rate limits for the AEMET OpenData API?

AEMET applies a per-key throttle but does not document a fixed quota in the spec; HTTP 429 responses are returned when the limit is exceeded. Jentic surfaces the 429 response so agents can back off and retry.

### How do I retrieve a municipal forecast through Jentic?

Run pip install jentic, search Jentic with 'spanish municipal weather forecast', load the /api/prediccion/especifica/municipio/diaria/{municipio} schema, and execute with the 5-digit INE municipality code. Jentic returns the parsed forecast without exposing your api_key.

### Can I limit what my agent is allowed to do with the AEMET OpenData API?

Yes. Because you run Jentic One yourself, your own rules decide which AEMET operations the agent may call, and every AEMET OpenData operation is a read, so you can pin the agent to just the forecast and observation reads it needs, such as the daily municipal forecast at /api/prediccion/especifica/municipio/diaria/{municipio} or station data at /api/observacion/convencional/datos/estacion/{idema}. Location codes like the municipio or estacion sit in the URL path, so your rules can scope access down to specific paths. Any operation you leave out of the allowed set, such as the CAP warnings or radar endpoints, stays unreachable to the agent. Your api_key is injected at execution time and never enters the agent's prompt or logs.
