Guide · Chile electricity market
Chile electricity market API: how to get marginal cost, generation and demand from the Coordinador Eléctrico Nacional
How to get official data on Chile's national grid (Sistema Eléctrico Nacional, SEN) from your code or an AI agent: what the Coordinador's public information system publishes, how its API works directly, and how to receive marginal cost per bus, generation by technology or plant and demand as clean JSON with Better Llama's MCP tool, with no user_key to request.
What is the Coordinador Eléctrico Nacional and which data does it publish?
The Coordinador Eléctrico Nacional (CEN) is the technical body that coordinates the operation of Chile's national grid, from Arica to Chiloé. Its public information system (Sistema de Información Pública, SIP) exposes by API the data most used to analyze the electricity market:
- Marginal cost per bus: the cost of supplying one more MWh at each point of the grid, in USD/MWh. The preliminary (online) value comes every 15 minutes; the real or final one, weeks later.
- Real generation per plant, hour by hour, and daily generation by technology (hydro, solar, wind, thermal, geothermal and batteries).
- Net system demand and estimated real demand per bus.
- Catalogs of power plants and transmission lines, facility limitations, ancillary-service instructions and unserved energy.
For example, on November 20, 2026 the SEN generated 277,184 MWh; hydro supplied 35.1% and solar 26.2%, according to the real query shown below. Every answer from our tool carries the citation «Fuente: Coordinador Eléctrico Nacional, Sistema de Información Pública» with the link www.coordinador.cl.
Two ways to get Coordinador data by API
1. The SIP API, directly
The Coordinador developer portal gives you a free credential (user_key) when you subscribe to the «Sistema de Información Pública» plan. The credential goes as a parameter in every call. For example, daily generation by technology for one day:
curl -s "https://sipub.api.coordinador.cl/generacion-real/v3/getDailySum?date=2026-11-20&user_key=$CEN_USER_KEY"The integration is up to you: each dataset has its own route and version, paging differs between routes, one day of marginal cost is about 145,000 rows, the API does not filter by bus and the free plan's quota is 60 queries per hour.
2. Better Llama's Coordinador tool (over MCP)
Our tool Electricity market (Coordinador Eléctrico), get_chile_electricity_market, queries that same API and returns a ready-to-use result:
- No
user_keyto request: during the beta we use ours, limited to one call per minute and cached for an hour. To use yours, send it in theX-CEN-Keyheader. - A single
datasetparameter for the 11 datasets, with dates in Chile time and up to 31 days per call. - A text filter by bus, plant, technology or company (
filter), which the original API lacks. - Local and UTC date-time, numeric values with their unit, and the source attribution in every answer.
Use it as an MCP tool from Claude, Cursor or other agents, or over HTTP with JSON-RPC from any language.
Step by step: get Coordinador Eléctrico data
Step 1. Choose the dataset
Pass one of these 11 values in dataset:
| dataset | What it returns | Unit |
|---|---|---|
costo_marginal_online | Preliminary marginal cost per bus, every 15 minutes | USD/MWh |
costo_marginal_real | Real (final) marginal cost per bus; published weeks later | USD/MWh |
generacion_real | Hourly real generation per plant | MW |
generacion_diaria | Daily total generation by technology | MWh |
demanda_neta | Hourly net system demand | MWh |
demanda_real_estimada | Estimated real demand (withdrawals) per bus | kWh |
centrales | Power plant catalog | MW |
lineas_transmision | Transmission line catalog | — |
limitaciones_transmision | Facility limitations and disturbances | MW |
instrucciones_sscc | Ancillary-service operating instructions | MW |
energia_no_suministrada | Unserved energy per outage | MWh |
Step 2. Connect the MCP server
Use the MCP https://mcp.betterllama.com/mcp in your client or call it over HTTP with JSON-RPC, as in the examples. No account or sign-up is needed during the beta.
Step 3. Build your query
| Parameter | What it does |
|---|---|
dataset | What to query (table above). Default costo_marginal_online |
startDate / endDate | From and to (YYYY-MM-DD, Chile time, inclusive). Yesterday by default; up to 31 days per call. Not used by the plant and line catalogs |
filter | Text that must appear in the name, case-insensitive: a bus («quillota 220», «crucero 220»), a plant or technology, or a facility or company in limitations |
maxItems | Maximum results (1 to 500, default 50) |
This is real generation on November 20, 2026 by technology, as the tool returns it with dataset generacion_diaria (query of November 22 at 08:22 Chile time; we computed the share over the total):
| Technology | Code (name) | MWh in the day | Share |
|---|---|---|---|
| Hydro | TOTAL HIDRÁULICO | 97,255 | 35.1% |
| Solar | TOTAL SOLAR | 72,584 | 26.2% |
| Batteries (BESS) | BESS | 43,190 | 15.6% |
| Wind | TOTAL EÓLICAS | 34,329 | 12.4% |
| Thermal | TOTAL TÉRMICAS | 29,178 | 10.5% |
| Geothermal | TOTAL GEOTÉRMICAS | 647 | 0.2% |
| Total | TOTAL GENERACIÓN | 277,184 | 100.0% |
With the shared credential each call reads one API page and the filter is applied to that page, so a day of marginal cost (about 145,000 rows) comes from the first hours and with the notice «Page cap reached». Real example: with filter «quillota 220» the tool returned 6 records for November 21, 2026 between 00:45 and 01:15, at 0.11 USD/MWh at the BA S/E QUILLOTA 220KV BP1-1 bus. To read more pages per call (up to five), use your own credential in X-CEN-Key.
Step 4. Call the tool with curl
A JSON-RPC POST returns the result as JSON. This call asks for daily generation by technology on November 20, 2026:
curl -s https://mcp.betterllama.com/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "get_chile_electricity_market", "arguments": {"dataset": "generacion_diaria", "startDate": "2026-11-20", "maxItems": 50}}}'The same in Python
Each technology's share and the marginal cost at one bus:
import json
import requests
URL = "https://mcp.betterllama.com/mcp"
HEADERS = {"Accept": "application/json, text/event-stream"}
def cen(arguments):
body = {"jsonrpc": "2.0", "id": 1, "method": "tools/call",
"params": {"name": "get_chile_electricity_market", "arguments": arguments}}
resp = requests.post(URL, json=body, headers=HEADERS, timeout=180)
resp.raise_for_status()
return json.loads(resp.json()["result"]["content"][0]["text"])
# Generation on 2026-11-20 by technology and its share
gen = cen({"dataset": "generacion_diaria", "startDate": "2026-11-20", "maxItems": 50})
total = next(r["value"] for r in gen["results"] if r["code"] == "TOTAL GENERACIÓN")
for r in gen["results"]:
if r["code"] != "TOTAL GENERACIÓN":
print(f'{r["name"]:<18} {r["value"]:>9,.0f} MWh {r["value"] / total:6.1%}')
# Preliminary marginal cost at the Quillota 220 kV bus
cmg = cen({"dataset": "costo_marginal_online", "filter": "quillota 220", "maxItems": 24})
for r in cmg["results"][:3]:
print(r["localDateTime"], r["name"], r["value"], r["unit"])Real output (November 22, 2026, Chile time):
BESS 43,190 MWh 15.6%
TOTAL EÓLICAS 34,329 MWh 12.4%
TOTAL GEOTÉRMICAS 647 MWh 0.2%
TOTAL HIDRÁULICO 97,255 MWh 35.1%
TOTAL SOLAR 72,584 MWh 26.2%
TOTAL TÉRMICAS 29,178 MWh 10.5%
2026-11-21 00:45 BA S/E QUILLOTA 220KV BP1-1 0.11 USD/MWh
2026-11-21 00:45 BA S/E QUILLOTA 220KV BP1-2 0.11 USD/MWh
2026-11-21 01:00 BA S/E QUILLOTA 220KV BP1-2 0.11 USD/MWhFrom JavaScript or any other language, a POST with the same JSON-RPC body is enough (for example, with fetch).
Use the Chile electricity market API from an AI agent (MCP)
Add the Better Llama MCP server to your client (Claude, Cursor, VS Code or any other with remote MCP). One MCP brings get_chile_electricity_market and the rest of the catalog, with no sign-up during the beta.
{
"mcpServers": {
"better-llama": {
"url": "https://mcp.betterllama.com/mcp"
}
}
}claude mcp add --transport http better-llama https://mcp.betterllama.com/mcpSetup for Claude, Codex, Gemini CLI, Windsurf, VS Code and other clients: connect your agent.
Ready-to-run Python and Node.js examples, with config files for each client: examples repository on GitHub.
Then ask, for example: «How much energy did Chile's national grid generate yesterday, and what share was solar and wind? Cite the source.»
Beta: free and with no sign-up while we test the service.
Which fields it returns
Each item in results has dataset, datasetTitle, date, localDateTime (Chile time), dateTimeUtc for hourly data, name (bus, plant or technology), code, value (numeric) and unit, plus fields specific to each dataset, such as costClpKwh and voltageKv in marginal cost. The answer includes count, warnings, stopReason, attribution, source and retrievedAt.
Real, complete response to the curl call above (November 22, 2026, 08:22 Chile time):
{
"tool": "get_chile_electricity_market",
"count": 7,
"results": [
{
"dataset": "generacion_diaria",
"datasetTitle": "Generación diaria total por tecnología",
"date": "2026-11-20",
"localDateTime": "2026-11-20",
"name": "BESS",
"code": "BESS",
"value": 43190.42,
"unit": "MWh",
"redacted": false,
"officialUrl": "https://www.coordinador.cl/",
"dataSource": "Coordinador Eléctrico Nacional (CEN), Sistema de Información Pública (SIP) — https://www.coordinador.cl / https://sipub.api.coordinador.cl",
"retrievedAt": "2026-11-22T11:22:32.452Z"
},
{
"dataset": "generacion_diaria",
"datasetTitle": "Generación diaria total por tecnología",
"date": "2026-11-20",
"localDateTime": "2026-11-20",
"name": "TOTAL EÓLICAS",
"code": "TOTAL EÓLICAS",
"value": 34329.08,
"unit": "MWh",
"redacted": false,
"officialUrl": "https://www.coordinador.cl/",
"dataSource": "Coordinador Eléctrico Nacional (CEN), Sistema de Información Pública (SIP) — https://www.coordinador.cl / https://sipub.api.coordinador.cl",
"retrievedAt": "2026-11-22T11:22:32.452Z"
},
{
"dataset": "generacion_diaria",
"datasetTitle": "Generación diaria total por tecnología",
"date": "2026-11-20",
"localDateTime": "2026-11-20",
"name": "TOTAL GEOTÉRMICAS",
"code": "TOTAL GEOTÉRMICAS",
"value": 646.78,
"unit": "MWh",
"redacted": false,
"officialUrl": "https://www.coordinador.cl/",
"dataSource": "Coordinador Eléctrico Nacional (CEN), Sistema de Información Pública (SIP) — https://www.coordinador.cl / https://sipub.api.coordinador.cl",
"retrievedAt": "2026-11-22T11:22:32.452Z"
},
{
"dataset": "generacion_diaria",
"datasetTitle": "Generación diaria total por tecnología",
"date": "2026-11-20",
"localDateTime": "2026-11-20",
"name": "TOTAL HIDRÁULICO",
"code": "TOTAL HIDRÁULICO",
"value": 97254.69,
"unit": "MWh",
"redacted": false,
"officialUrl": "https://www.coordinador.cl/",
"dataSource": "Coordinador Eléctrico Nacional (CEN), Sistema de Información Pública (SIP) — https://www.coordinador.cl / https://sipub.api.coordinador.cl",
"retrievedAt": "2026-11-22T11:22:32.452Z"
},
{
"dataset": "generacion_diaria",
"datasetTitle": "Generación diaria total por tecnología",
"date": "2026-11-20",
"localDateTime": "2026-11-20",
"name": "TOTAL SOLAR",
"code": "TOTAL SOLAR",
"value": 72584.15,
"unit": "MWh",
"redacted": false,
"officialUrl": "https://www.coordinador.cl/",
"dataSource": "Coordinador Eléctrico Nacional (CEN), Sistema de Información Pública (SIP) — https://www.coordinador.cl / https://sipub.api.coordinador.cl",
"retrievedAt": "2026-11-22T11:22:32.452Z"
},
{
"dataset": "generacion_diaria",
"datasetTitle": "Generación diaria total por tecnología",
"date": "2026-11-20",
"localDateTime": "2026-11-20",
"name": "TOTAL TÉRMICAS",
"code": "TOTAL TÉRMICAS",
"value": 29178.42,
"unit": "MWh",
"redacted": false,
"officialUrl": "https://www.coordinador.cl/",
"dataSource": "Coordinador Eléctrico Nacional (CEN), Sistema de Información Pública (SIP) — https://www.coordinador.cl / https://sipub.api.coordinador.cl",
"retrievedAt": "2026-11-22T11:22:32.452Z"
},
{
"dataset": "generacion_diaria",
"datasetTitle": "Generación diaria total por tecnología",
"date": "2026-11-20",
"localDateTime": "2026-11-20",
"name": "TOTAL GENERACIÓN",
"code": "TOTAL GENERACIÓN",
"value": 277183.54,
"unit": "MWh",
"redacted": false,
"officialUrl": "https://www.coordinador.cl/",
"dataSource": "Coordinador Eléctrico Nacional (CEN), Sistema de Información Pública (SIP) — https://www.coordinador.cl / https://sipub.api.coordinador.cl",
"retrievedAt": "2026-11-22T11:22:32.452Z"
}
],
"warnings": [],
"stopReason": "completed",
"attribution": "Fuente: Coordinador Eléctrico Nacional, Sistema de Información Pública — https://www.coordinador.cl",
"source": "https://portal.api.coordinador.cl/",
"retrievedAt": "2026-11-22T11:22:34.261Z"
}If you reuse the data, cite «Fuente: Coordinador Eléctrico Nacional, Sistema de Información Pública» with the link https://www.coordinador.cl/.
Pricing
Free during the beta, with no sign-up and a limit of 60 requests per minute per IP; with the shared Coordinador credential, one new query per minute (repeated ones come from the cache). If paid plans come later, we will announce them on betterllama.com first.
Frequently asked questions
Does the Coordinador Eléctrico Nacional have an API?
Yes. The Coordinador's public information system (SIP) has an API with a free credential (user_key) from portal.api.coordinador.cl. Better Llama's get_chile_electricity_market tool queries that API and returns 11 datasets as clean JSON over MCP or JSON-RPC, without you requesting the credential.
What is marginal cost?
It is the cost of supplying one more MWh of energy at a grid bus at a given time, in USD/MWh. It is used to value energy transfers between companies. Online marginal cost is preliminary and comes every 15 minutes; real marginal cost is final and is published weeks later.
How do I get generation by technology for a day?
Call get_chile_electricity_market with dataset generacion_diaria and the day's startDate. On November 20, 2026 the total was 277,184 MWh, with 35.1% hydro and 26.2% solar.
Do I need a Coordinador user_key?
No. During the beta a Better Llama credential is used. Its quota is 60 queries per hour, so the server limits it to one call per minute and caches answers for an hour. If you need more, create your free credential at portal.api.coordinador.cl and send it in the X-CEN-Key header.
Which dates can I query?
startDate and endDate as YYYY-MM-DD, Chile time, up to 31 days per call; yesterday by default. Real marginal cost is published weeks later, so for recent days use costo_marginal_online. If a dataset has no data for those dates, the answer comes back empty with a notice in warnings.
Can I filter by bus or plant?
Yes, with filter: the text must appear in the bus, plant, technology or facility name, case-insensitive. Since the Coordinador API does not filter by bus, the filter is applied to the pages downloaded in each call.
Is Better Llama affiliated with the Coordinador Eléctrico Nacional?
No. Better Llama is an independent project, not affiliated with, sponsored or endorsed by the Coordinador Eléctrico Nacional. The data comes from the public information system API and every answer includes the source attribution.
Other guides
- Chile open data APIs: official sources by API and MCP — map of the official Chilean sources available by API and MCP, how to find the tool with search_tools, one real call per family and an index of every guide.
- Chile CMF API: UF value, dollar, UTM and maximum conventional rate — the seven API CMF Bancos series with no API key to request, curl and Python examples, and MCP usage.
- Chile public procurement API: Mercado Público tenders and purchase orders — ChileCompra ticket, curl and Python examples, and MCP usage.
- Chile economic indicators API: UF, dollar, euro, CPI and TPM — One real call per indicator (UF, dollar, euro, UTM, CPI, TMC, TIP, TPM, Imacec, GDP, unemployment and real exchange rate), from the CMF or the Central Bank, with curl, Python, JavaScript and MCP.
- Chile public holidays API: 2026 holidays, business days and RUT — National, regional and local holidays with no key, curl and Python examples, and MCP usage.
- Chile fuel prices API: gasoline 93, 95, 97, diesel and LPG from Bencina en Línea — CNE data with no sign-up, the cheapest by comuna or near a point, curl, Python and JavaScript examples, and MCP usage.
- Chilexpress API: coverage by comuna, shipping quotes and tracking — covered comunas and sectors with their code and no key, names that differ from the official ones, quotes and tracking with your free keys, and MCP usage.
- Chile earthquakes API: latest quake, magnitude, depth and alerts — Public-domain USGS data with Chile local time, no USGS key, curl and Python examples, and MCP usage.
- Chile Official Gazette API: laws, decrees and new companies — Laws, decrees, notices and company incorporations with CVE and official PDF, no key, curl and Python examples, and MCP usage.
- Colombia SECOP II API: public procurement contracts and processes — Open data from datos.gov.co with no key, curl and Python examples, and MCP usage.
- Colombia TRM API: today's TRM and the COP/USD rate — Superintendencia Financiera data via datos.gov.co with no key, curl and Python examples, and MCP usage.
- Peru BCRP API: exchange rate, inflation and rates — BCRPData series with no key, curl and Python examples, and MCP usage.
- Banxico API: Mexico's FIX exchange rate, UDIS and TIIE — Banco de México SIE indicators with no token to request, curl and Python examples, and MCP usage.
- Chile USD/CLP exchange rate API: the observed dollar as JSON — today's rate, daily series by month, range or year and the warning for values published in advance, with CMF data, curl, Python and JavaScript examples, and MCP usage.
- Chile UF API: the Unidad de Fomento value as JSON — today's UF, full month, next month's days already published, range or year, with CMF data and a Central Bank cross-check, curl, Python and JavaScript examples, and MCP usage.
- Central Bank of Chile API: BDE series as JSON — dollar, UF, policy rate, CPI, Imacec, GDP, unemployment and any series by code, series search, curl, Python and JavaScript examples, and MCP usage.
- Chile RUT validation API: check digit as JSON — the modulo 11 algorithm, accepted formats, computing the check digit, batches and privacy, curl, Python and JavaScript examples, and MCP usage.
- Chile communes API: regions, provinces and CUT codes — all 346 communes with CUT codes, region filters, name search, curl, Python and JavaScript examples, and MCP usage.
- Chile business days API: deadlines and business-day counts — business-day deadlines from a notice date, Saturdays as business days, calendar days, business days per month, regional holidays and edge cases, with curl, Python and JavaScript, and MCP usage.
This guide is also available en español.