Data model, query examples, MCP integration, and REST API reference for the Spanish electricity market dataset.
API access
Query ESIOS market data programmatically from Python. Use the datons client or call the REST endpoints directly.
Quickstart
Video walkthrough
Install
pip install datonsExample
from datons import Client
client = Client(token="YOUR_API_KEY")
# Query preprocessed I90 market data → pandas DataFrame
df = client.esios.query(
"SELECT unit, datetime, energy, price "
"FROM esios.archives_i90 "
"WHERE program = 'PDBF' AND toDate(datetime) >= '2025-01-01' "
"LIMIT 100"
)
print(df.head())Authentication
Request header
Include your API key in every request:
X-API-Key: your_key_hereEnvironment variable
Set DATONS_API_KEY and the client will pick it up automatically:
export DATONS_API_KEY=your_key_hereBase URL
https://api.datons.com/esiosDon't have an API key yet? Get your API key from your account dashboard.
Force-refresh revised data
Use this only when ESIOS has revised already-published values and you need to fetch a specific range again. Routine freshness is the pipeline’s responsibility; reingest is a targeted recovery path, not a regular update mechanism.
REST · POST /ingest/reingest
Eligible planscurl -X POST https://api.datons.com/esios/ingest/reingest \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"indicators": [600, 1293],
"date_from": "2026-08-01",
"date_to": "2026-08-03",
"reason": "ESIOS revised already-published values"
}'MCP
request_reingest Accepts the same indicators, dates and reason. Use it from Claude or another MCP client when you discover a revision during analysis.
The request is asynchronous
The API queues the reingest and returns an identifier, a coarse ETA and a status URL. Poll status_url as it moves from pending to running and then done or failed; do not keep the POST request open.
{
"checkpoint_id": "2a6b6f08-...",
"status": "pending",
"eta_seconds": 42,
"status_url": "/ingest/checkpoints/2a6b6f08-..."
}Endpoint reference
Rate limits
All API requests are rate-limited by tier. See plans for tier comparison.
All queries are read-only (SELECT only).
Response headers
Every response includes rate limit headers so you can track your usage:
Query examples
esios.indicators
Time-series table with ~1,966 ESIOS indicators: market prices, demand, generation forecasts, and more. Updated hourly.
| Column | Type | Description |
|---|---|---|
| indicator_id | UInt16 | ESIOS indicator number (e.g. 600 = spot price) |
| datetime | DateTime | Timestamp (Europe/Madrid) |
| value | Float64 | Indicator value (units depend on indicator) |
| geo_id | UInt16 | Geography (3 = España, 8741 = Península) |
| indicator_name | String | Human-readable indicator label |
| frequency | String | Data frequency (Hora, Diez minutos, etc.) |
| unit | String | Measurement unit (€/MWh, MWh, MW, etc.) |
Common indicator IDs:
| ID | geo_id | Indicator |
|---|---|---|
| 600 | 3 | Spot market price (OMIE daily) |
| 551 | 8741 | Wind generation (T.Real eólica) |
| 1295 | 8741 | Solar PV generation (T.Real Solar fotovoltaica) |
| 1294 | 8741 | Solar thermal generation (T.Real Solar térmica) |
| 546 | 8741 | Hydro generation (T.Real hidráulica) |
| 549 | 8741 | Nuclear generation (T.Real nuclear) |
| 550 | 8741 | Combined cycle (T.Real C.Combinado) |
| 547 | 8741 | Coal generation (T.Real carbón) |
Column dictionary
Description and type of each column in the operational_data_15min table.
Program reference
Available market programs and their statistics.
Programa Diario Base Funcionamiento
Programa Diario Viable Provisional
Programa Horario Funcional 1
Banda Secundaria
Programa Horario Funcional 2
Programa Horario Funcional 3
Programa Horario Funcional 4
Programa Horario Funcional 5
Programa Horario Funcional 6
Programa Horario Funcional 7
Restricciones Tiempo Real
Mercado de Balances
Banda Terciaria