# Brazil Power Grid Data (ONS) - Load, Reservoirs, Inflow & CMO (`kman-br/ons-energia-sin`) Actor

Official ONS open data for Brazil's national grid (SIN): daily electricity load, reservoir storage (EAR %), natural inflow (ENA, % of long-term average) and weekly marginal operating cost (CMO) by subsystem. Daily, weekly or monthly, with period-over-period and year-over-year changes.

- **URL**: https://apify.com/kman-br/ons-energia-sin.md
- **Developed by:** [Kman](https://apify.com/kman-br) (community)
- **Categories:** Business, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 data points

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Brazil Power Grid Data (ONS) - Load, Reservoirs, Inflow & CMO

**EN** · [PT-BR abaixo](#pt-br)

Clean, ready-to-use time series from the **ONS (Operador Nacional do Sistema Elétrico)** open data portal, the official operator of Brazil's national grid (SIN). No scraping, no CSV wrangling, no encoding issues:

- **Load (carga)**: daily average electricity load in MWmed.
- **Reservoir storage (EAR)**: % of maximum stored energy, MWmonth stored and capacity.
- **Natural inflow (ENA)**: gross inflow in MWmed and % of the long-term average (MLT).
- **Marginal operating cost (CMO)**: weekly CMO in R$/MWh, with light/medium/heavy load levels.
- By subsystem (Southeast/Center-West, South, Northeast, North) plus **SIN total** computed for you.
- Daily, weekly (Mon-Sun) or monthly aggregation.
- **Period-over-period** and **year-over-year** change on every point.

Use it for energy trading desks, power price forecasting, hydro risk monitoring, ESG and industrial demand dashboards, journalism and research.

### Input

```json
{ "series": ["carga", "ear", "ena", "cmo"], "subsistemas": ["SIN", "SE"], "agregacao": "semanal", "dataInicio": "2026-10-01", "dataFim": "2026-11-12", "compararAnoAnterior": true }
```

Defaults: all series, all subsystems, last 30 days, daily.

### Output

```json
{ "serie": "carga", "subsistema": "SIN", "agregacao": "semanal", "periodo": "2026-10-05", "ultima_data": "2026-10-11", "dias_no_periodo": 7, "valor": 84729.4, "unidade": "MWmed", "variacao_periodo_anterior_pct": -0.9, "valor_ano_anterior": 79030.15, "variacao_ano_anterior_pct": 7.21 }
```

`RUN_SUMMARY` (key-value store) shows the last available date per series.

### Pricing (pay per event)

- US$ 0.01 per run
- US$ 0.0005 per data point (1,000 points = US$ 0.50)

Invalid input is not charged. A series temporarily unavailable at the source returns a free error row.

### Source and licence

ONS Dados Abertos (https://dados.ons.org.br), datasets *carga-energia*, *ear-diario-por-subsistema*, *ena-diario-por-subsistema*, *cmo-semanal*, licence **CC-BY 4.0**. Aggregate grid data only, no personal data. Not affiliated with ONS.

***

### PT-BR

Séries oficiais do **ONS** prontas para usar, por subsistema e com o total do **SIN**:

- **Carga de energia** diária (MWmed).
- **EAR**: energia armazenada nos reservatórios (% da máxima).
- **ENA**: energia natural afluente (MWmed e % da MLT).
- **CMO** semanal (R$/MWh) nos patamares leve, médio e pesado.
- Agregação diária, semanal ou mensal, com **variação contra o período anterior e contra o mesmo período do ano anterior**.
- Preço: US$ 0,01 por execução + US$ 0,0005 por ponto.
- Fonte: ONS Dados Abertos, licença CC-BY 4.0. Sem dado pessoal.

# Actor input Schema

## `series` (type: `array`):

Load, reservoir storage, natural inflow and marginal cost.

## `subsistemas` (type: `array`):

SIN = total of the 4 subsystems (not available for CMO).

## `dataInicio` (type: `string`):

AAAA-MM-DD. Default: 30 days before the end date.

## `dataFim` (type: `string`):

AAAA-MM-DD. Default: today.

## `agregacao` (type: `string`):

Load and inflow use the period average; reservoirs use the last day plus min/max.

## `compararAnoAnterior` (type: `boolean`):

Adds the value of the same period one year before and the % change.

## `maxItems` (type: `integer`):

Cap on charged data points.

## Actor input object example

```json
{
  "series": [
    "carga",
    "ear",
    "ena",
    "cmo"
  ],
  "subsistemas": [
    "SIN",
    "SE",
    "S",
    "NE",
    "N"
  ],
  "agregacao": "diaria",
  "compararAnoAnterior": true,
  "maxItems": 5000
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `summary` (type: `string`):

RUN_SUMMARY: status, last available date per series, charged events.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "series": [
        "carga",
        "ear",
        "ena",
        "cmo"
    ],
    "subsistemas": [
        "SIN",
        "SE",
        "S",
        "NE",
        "N"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("kman-br/ons-energia-sin").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "series": [
        "carga",
        "ear",
        "ena",
        "cmo",
    ],
    "subsistemas": [
        "SIN",
        "SE",
        "S",
        "NE",
        "N",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("kman-br/ons-energia-sin").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "series": [
    "carga",
    "ear",
    "ena",
    "cmo"
  ],
  "subsistemas": [
    "SIN",
    "SE",
    "S",
    "NE",
    "N"
  ]
}' |
apify call kman-br/ons-energia-sin --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kman-br/ons-energia-sin"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/djVGt3gPhi0ZkQIct/builds/LduYhgXz8QLG499hz/openapi.json
