# Brazil Power Generation by Plant (ONS) - MWh & Capacity Factor (`kman-br/brazil-power-generation-by-plant-ons`) Actor

Generation of every power plant dispatched by ONS in Brazil (hydro, thermal, wind, solar, nuclear) from hourly open data: MWh, average/peak MW, generating hours, installed capacity, capacity factor, owner and operator. Per plant x month, plant x day, source x state or subsystem.

- **URL**: https://apify.com/kman-br/brazil-power-generation-by-plant-ons.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

Pay per event

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 Generation by Plant (ONS) - MWh & Capacity Factor

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

ONS publishes the hourly generation of every centrally dispatched power plant in Brazil, about 540,000 rows (70 MB) per month. This Actor turns it into one clean row per plant and period, joined with ONS's installed-capacity register:

- **Generation**: MWh, average MW, peak MW, hours generating, days with data.
- **Capacity**: installed capacity in operation that month (units commissioned/decommissioned are respected) and **capacity factor %**.
- **Companies**: owner and operator agents (from the ONS unit register).
- **Sources**: hydro, thermal, wind, solar, nuclear; optional ONS estimates for distributed generation (MMGD) per state.
- **Granularity**: plant x month, plant x day, source x state x month, source x subsystem x month.
- Filters: months (up to 3 per run), sources, states, subsystems, plant name / ONS id / CEG, minimum MWh.

Built for energy traders and analysts, generators benchmarking competitors, M\&A and lenders, equipment and O\&M suppliers, consultancies and journalists.

### Input

```json
{ "meses": ["2026-10"], "tipos": ["hidraulica"], "granularidade": "usina_mes", "minGeracaoMWh": 100000 }
```

### Output (real row, Oct/2026)

```json
{ "periodo": "2026-10", "tipo": "hidraulica", "subsistema": "SE", "estado": "PR", "usina": "ITAIPU 60 HZ", "id_ons": "PRIT60", "ceg": "UHE.PH.PR.001161-4.01", "geracao_mwh": 3643186.5, "geracao_media_mw": 4896.8, "pico_mw": 6644.3, "horas_com_geracao": 744, "capacidade_instalada_mw": 7000, "fator_capacidade_pct": 69.95 }
```

`RUN_SUMMARY` adds total MWh per source for your filter. Capacity is matched by ONS id or CEG; ONS publishes many wind/solar clusters ("Conj.") without a unit register, so those rows come without capacity (about 70% of the MWh in a month has a capacity match). Implausible matches (factor above 110%) are flagged `capacidade_inconsistente`.

### Pricing (pay per event)

- US$ 0.02 per run
- US$ 0.002 per row (all ~710 plants in a month ≈ US$ 1.45)

### Source and licence

ONS - Operador Nacional do Sistema Elétrico, *Geração por usina em base horária* and *Capacidade instalada de geração*, https://dados.ons.org.br, **CC-BY 4.0**. Plants and companies only, no personal data. Not affiliated with ONS.

***

### PT-BR

**Geração de cada usina despachada pelo ONS**, agregada a partir dos dados horários oficiais:

- MWh, MW médio, pico, horas gerando; capacidade instalada em operação no mês e **fator de capacidade**; agente proprietário e operador.
- Hidráulica, térmica, eólica, solar e nuclear (MMGD opcional); usina x mês, usina x dia, fonte x UF ou fonte x subsistema.
- Preço: US$ 0,02 por execução + US$ 0,002 por linha.
- Fonte: ONS, licença CC-BY 4.0. Sem dado pessoal.

# Actor input Schema

## `meses` (type: `array`):

Up to 3 months, e.g. 2026-10. Empty = last closed month(s).

## `ultimosMeses` (type: `integer`):

Used when 'Months' is empty.

## `incluirMesCorrente` (type: `boolean`):

The current month is partial (ONS updates it daily).

## `granularidade` (type: `string`):

Aggregation level of each row.

## `tipos` (type: `array`):

hidraulica, termica, eolica, solar, nuclear. Empty = all.

## `estados` (type: `array`):

e.g. BA, MG, PA. Empty = all.

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

N, NE, SE, S. Empty = all.

## `usinas` (type: `array`):

Part of the plant name, ONS id (e.g. PRIT60) or CEG.

## `incluirMmgd` (type: `boolean`):

Adds ONS aggregated small/distributed generation estimates (PQU ... MMGD) per state.

## `incluirCapacidade` (type: `boolean`):

Joins ONS installed capacity per generating unit: capacity in the month, capacity factor, owner and operator.

## `minGeracaoMWh` (type: `number`):

Only rows with at least this energy.

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

Cap on charged rows.

## Actor input object example

```json
{
  "meses": [
    "2026-10"
  ],
  "ultimosMeses": 1,
  "incluirMesCorrente": false,
  "granularidade": "usina_mes",
  "incluirMmgd": false,
  "incluirCapacidade": true,
  "minGeracaoMWh": 0,
  "maxItems": 1000
}
```

# Actor output Schema

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

No description

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

RUN_SUMMARY: files read, MWh per source, 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 = {
    "meses": [
        "2026-10"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("kman-br/brazil-power-generation-by-plant-ons").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 = { "meses": ["2026-10"] }

# Run the Actor and wait for it to finish
run = client.actor("kman-br/brazil-power-generation-by-plant-ons").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 '{
  "meses": [
    "2026-10"
  ]
}' |
apify call kman-br/brazil-power-generation-by-plant-ons --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kman-br/brazil-power-generation-by-plant-ons"
        }
    }
}
```

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/L5opn2U1OriXXPVQp/builds/W2BgW1kwlO72ZfxOA/openapi.json
