# France Electricity Mix & CO2 (RTE eco2mix) - Live and History (`shadow-tools/france-electricity-mix-eco2mix`) Actor

French electricity in near real time and history: consumption, nuclear, wind, solar, hydro, gas, coal, oil, bioenergy, exchanges and CO2 g/kWh, national and 12 regions, plus min/max/mean summaries. RTE eco2mix open data, unofficial tool, no personal data.

- **URL**: https://apify.com/shadow-tools/france-electricity-mix-eco2mix.md
- **Developed by:** [Shadow Tools](https://apify.com/shadow-tools) (community)
- **Categories:** Automation, News, Other
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 energy records

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

## France Electricity Mix & CO2 (RTE eco2mix) - Live and History

Call this Actor to find **what the French electricity mix is right now and how it evolved**: consumption, generation per source (nuclear, hydro, wind, solar, gas, coal, oil, bioenergy), pumping, physical and commercial exchanges, forecasts and the **CO2 rate in g/kWh**, for **France** or **12 regions**, from the official RTE eco2mix open data published on Open Data Réseaux Énergies (ODRÉ). Use `latest` for the most recent quarter-hours, `range` for a time series (history since 2012 nationally), `summary` for min / max / mean per source over a period.

#### Minimal input per mode

| Mode | Minimal input | What comes back |
|---|---|---|
| `latest` | `{"mode": "latest", "maxResults": 4}` | the 4 most recent measured quarter-hours, newest first |
| `range` | `{"mode": "range", "from": "2026-11-01", "to": "2026-11-07", "resolutionMinutes": 60}` | one record per hour for 7 days (Paris time), oldest first |
| `summary` | `{"mode": "summary", "lastDays": 7, "summaryBy": "day", "maxResults": 80}` | per day and per source: min, max, mean, when the min and max occurred |

An **empty input** `{}` works too: it returns the 20 most recent national quarter-hours.

Short real output (`latest`, 8 Nov 2026 13:00 Paris time, shortened; the full record has 34 fields including `attribution` and `extractedAt`):
`{"type": "record", "timestampParis": "2026-11-08T13:00:00+01:00", "timestampUtc": "2026-11-08T12:00:00Z", "perimeter": "France", "regionCode": null, "dataNature": "real-time", "resolutionMinutes": 15, "consumptionMw": 56187, "nuclearMw": 39133, "hydroMw": 2396, "windMw": 1725, "solarMw": 10135, "gasMw": 5467, "coalMw": 0, "oilMw": 36, "bioenergyMw": 981, "pumpingMw": -2542, "physicalExchangesMw": -991, "co2RateGPerKwh": 48, "sourceDataset": "eco2mix-national-tr"}`

#### For AI agents (MCP)

- **One call = one answer.** Default `maxResults` is 20 (max 100,000). Typical run: 1-10 s.
- **Pick the mode by the question**: "right now / today's mix / current CO2" -> `latest`; "evolution / last week / in January 2025" -> `range` (set `from` and `to`, or `lastDays`); "average / peak / minimum per source" -> `summary`.
- **Use `resolutionMinutes: 60`** for anything longer than a day: a year of hourly national data is 8,760 records instead of 35,000.
- **Summary needs room**: `summary` returns one record per metric and period (11 national metrics, 8 regional), so set `maxResults` to at least 11 x number of periods (x regions).
- **Dates are Paris time.** `from: "2026-11-01"` starts at 00:00 Paris; `to: "2026-11-07"` includes that whole day. Every record gives both `timestampParis` and `timestampUtc`.
- **Errors fail fast** as `Field X invalid: expected Y, got Z, example W` (for example `Field mode invalid: expected one of latest, range, summary, got "history", example latest.`). Fix that field and call again; nothing is charged.
- **0 results is not an error.** The run succeeds with an empty dataset and the key-value record `SUMMARY` has a `note` explaining why (for example a period after the end of the consolidated data) and what to change.
- Regions: INSEE codes or names (`"11"`, `"Bretagne"`, `"PACA"`); Corsica is not in the source datasets.

> **Unofficial tool. Not affiliated with, endorsed by or sponsored by RTE or Open Data Réseaux Énergies.** It reads their open data and reformats it. Real-time values are estimates; do not use them for electricity settlement, trading or any safety-critical decision.

### Who uses it

- **Energy and sustainability teams**: hourly CO2 intensity of the French grid for carbon accounting (location-based Scope 2 estimates), with the exact source and date.
- **Developers of "run when the grid is green" tools**: schedule EV charging, batch jobs, heat pumps or data-centre workloads by `co2RateGPerKwh`.
- **Analysts and journalists**: nuclear, wind and solar output, exports, peaks and minima by day, month or region.
- **Dashboards and apps**: a clean JSON/CSV feed of the French mix without handling the ODRÉ API limits.
- **AI assistants**: answer "how green is the French grid today?" with a dated, licensed source.

### Modes

- **latest**: the most recent records that hold measured values, newest first (`order: "asc"` reverses). Looks back 120 days.
- **range**: every record between `from` and `to` (or the last `lastDays` days), oldest first (`order: "desc"` for newest first). When `maxResults` cuts the period, the first records in the chosen order are kept.
- **summary**: for each period (`summaryBy`: `period`, `day` or `month`, Paris calendar) and each region, one record per metric with `sampleCount`, `rowCount`, `min`, `max`, `mean`, `minAt`, `maxAt`. Computed by the Actor from the source rows, over the non-null samples only; a metric without any sample is returned with `sampleCount: 0` and `null` values. The mean is the arithmetic mean of the samples (not weighted by duration); the default step for summaries is 30 minutes so that real-time and consolidated rows weigh the same. Metrics: national `consumptionMw`, `nuclearMw`, `hydroMw`, `windMw`, `solarMw`, `gasMw`, `coalMw`, `oilMw`, `bioenergyMw`, `physicalExchangesMw`, `co2RateGPerKwh`; regional the same without gas / coal / oil / CO2 and with `thermalMw`.

Common options: `perimeter` (`national` / `regional`), `regions`, `source` (`auto` / `realtime` / `consolidated`), `resolutionMinutes` (15, 30, 60: rows are only selected on that grid, never averaged), `includeUnmeasured`, `maxResults`.

### Data sources and what they contain

| Dataset (ODRÉ id) | Content | Coverage seen on 8 Nov 2026 |
|---|---|---|
| `eco2mix-national-tr` | national real time, quarter-hour, refreshed every 15 min | 1 Sep 2026 -> now (rolling, 6,720 rows incl. forecast-only rows up to the end of tomorrow) |
| `eco2mix-national-cons-def` | national consolidated (since 2021) and definitive (2012-2024), half-hour measures | 1 Jan 2012 -> 31 Aug 2026 |
| `eco2mix-regional-tr` | 12 regions, real time, quarter-hour, refreshed hourly | 1 Sep 2026 -> now |
| `eco2mix-regional-cons-def` | 12 regions, consolidated and definitive, half-hour | 1 Jan 2013 -> 31 Aug 2026 |

- `source: "auto"` reads consolidated/definitive data up to the newest timestamp they hold and real-time data after it, so a period crossing the boundary is continuous and has no duplicate. The dataset used is in `sourceDataset`, the quality level in `dataNature` (`real-time`, `consolidated`, `definitive`; `mixed` in summaries that span several).
- Real-time data are replaced by consolidated (about mid next month) and then definitive data (second half of the following year) by RTE: **a figure you fetched live can change later.**
- Only timestamps with a measured consumption or nuclear value are returned by default. The real-time dataset also lists forecast-only rows for the rest of the day and the next day, and the consolidated dataset lists quarter-hour rows that carry only forecasts; `includeUnmeasured: true` returns them (their measures are `null`).

### What you get

Every record has the same keys, in this order (`null` = the source has no value; **nothing is ever filled, interpolated or guessed**):

- `type` (`"record"`), `timestampParis` (ISO 8601 with offset), `timestampUtc`, `perimeter` (`France` or the region name), `regionCode` (INSEE code, `null` nationally), `dataNature`, `resolutionMinutes` (the grid you asked for)
- `consumptionMw`; national only: `forecastDayAheadMw` (J-1), `forecastSameDayMw` (J)
- generation (MW): `nuclearMw`, `hydroMw`, `windMw`, `windOnshoreMw`, `windOffshoreMw`, `solarMw`, `gasMw`, `coalMw`, `oilMw`, `bioenergyMw`; regional: `thermalMw` (gas, coal and oil together)
- `pumpingMw` (power used by pumped-storage pumps, negative), `batteryChargeMw`, `batteryDischargeMw`
- `physicalExchangesMw` (balance of physical exchanges: **negative = net exporter, positive = net importer**, as stated by the source; nationally with neighbouring countries, regionally with neighbouring regions)
- national only: `commercialExchangeUkMw`, `commercialExchangeSpainMw`, `commercialExchangeItalyMw`, `commercialExchangeSwitzerlandMw`, `commercialExchangeGermanyBelgiumMw` (same sign convention) and `co2RateGPerKwh` (the source's estimate of the emissions of electricity generation in France, in g/kWh)
- `sourceDataset`, `attribution` (source, licence and dataset update date), `extractedAt`

Not every column exists in every dataset: wind onshore / offshore and batteries are missing from the national consolidated dataset, wind onshore / offshore are missing from regional real time, so these stay `null` there. Regional coverage rates and load factors published by RTE (`tco_*`, `tch_*`) are not returned.

**Summary record**: `type: "summary"`, `perimeter`, `regionCode`, `periodType`, `period` (`2026-11-05`, `2026-11` or `2026-11-01..2026-11-07`), `metric`, `unit`, `sampleCount`, `rowCount`, `min`, `max`, `mean`, `minAt`, `maxAt`, `firstTimestampParis`, `lastTimestampParis`, `resolutionMinutes`, `dataNature`, `sourceDatasets`, `attribution`, `extractedAt`.

Example (summary, real, 8 Nov 2026, national, shortened):

```json
{"type": "summary", "perimeter": "France", "periodType": "day", "period": "2026-11-06", "metric": "consumptionMw", "unit": "MW", "sampleCount": 21, "rowCount": 21, "min": 55372, "max": 62536, "mean": 58442.81, "minAt": "2026-11-06T22:00:00+01:00", "maxAt": "2026-11-06T19:00:00+01:00", "resolutionMinutes": 30, "dataNature": "real-time"}
```

### Quick start

Current CO2 rate and mix:

```json
{ "mode": "latest", "maxResults": 1 }
```

Hourly nuclear / wind / solar for a week in January 2025 (definitive data):

```json
{ "mode": "range", "from": "2025-01-06", "to": "2025-01-12", "resolutionMinutes": 60, "maxResults": 200 }
```

Daily min / max / mean per source for October 2026, Brittany and Normandy:

```json
{ "mode": "summary", "regions": ["Bretagne", "Normandie"], "from": "2026-10-01", "to": "2026-10-31", "summaryBy": "day", "maxResults": 500 }
```

Call it from the API: `POST https://api.apify.com/v2/acts/<ACTOR>/run-sync-get-dataset-items?token=<TOKEN>` with the JSON input as body.

### Pricing

Pay per event, no subscription:

| Event | Price | Per 1,000 |
|---|---|---|
| `energy-record`: one record delivered (a timestamp, or one summary metric of one period) | **0.003 USD** | **3 USD per 1,000 records** |
| Actor start (once per run) | 0.00005 USD | n/a |

A run returning nothing costs only the start event. Examples: the latest 20 quarter-hours cost 0.06 USD; one year of hourly national data (8,760 records) about 26 USD; daily summaries for a month (30 days x 11 metrics = 330 records) about 1 USD. Use the platform's **Maximum cost per run** to cap spending: the Actor reads it, stops cleanly at the cap and returns what it already delivered (the cap must allow at least one record). If the platform time limit is near, or the source fails after the first query, the records already fetched are kept and the run is flagged `partial` in `SUMMARY`.

### Privacy / GDPR by design

The eco2mix datasets describe the electricity grid (megawatts per source, per country or region and time step). They contain **no data about natural persons**, and the Actor is built so that none can slip in:

- **Allow-list, fail-closed.** The Actor asks the open data API for a fixed list of numeric and time columns and maps only those; every other column the source might add in the future is not requested and not returned. A record is kept only if its perimeter is exactly `France` (national) or its region code is one of the 12 known INSEE codes, and its timestamp is readable; otherwise it is dropped. Unit tests and a mutation test pin this behaviour.
- **No free text.** Region names come from a table inside the Actor, not from the source; `dataNature` is mapped from three known labels (anything else becomes `null`). No name, address, contact or comment field is read.
- **Nothing stored about you.** The Actor keeps no state between runs and uses no named storage, cookies or tracking; the dataset and `SUMMARY` hold only grid data and the credit line. Note that the Apify platform itself stores your run input, as for any Actor.

### Licence and attribution

Data: ODRÉ datasets "Données éCO2mix nationales temps réel", "Données éCO2mix nationales consolidées et définitives", "Données éCO2mix régionales temps réel" and "Données éCO2mix régionales consolidées et définitives", publisher **RTE** (Réseau de transport d'électricité), published on https://odre.opendatasoft.com. The dataset pages state the licence **"Licence Ouverte v2.0 (Etalab)"**: https://www.etalab.gouv.fr/wp-content/uploads/2017/04/ETALAB-Licence-Ouverte-v2.0.pdf

That licence grants a free, non-exclusive right to reuse the information "à des fins commerciales ou non, dans le monde entier et pour une durée illimitée", including adapting, extracting and transforming it and exploiting it commercially in a product or service, **provided the source (at least the name of the licensor) and the date of the last update of the reused information are mentioned**, without suggesting any official endorsement; the information is provided as produced, without warranty, and the reuser is solely responsible for the reuse and must not mislead third parties about the content, the source and the update date. The Actor therefore adds to **every record** an `attribution` of the form: *Source: "<dataset title>" (<dataset id>), RTE (Réseau de transport d'électricité), published on Open Data Réseaux Énergies (odre.opendatasoft.com), Licence Ouverte v2.0 (Etalab). Dataset last updated: \<ODRÉ processing date>. Data extracted on <date>; fields renamed and reformatted.* The run `SUMMARY` repeats the licence name, its URL and a non-affiliation disclaimer. Please keep this credit if you republish the data.

### Limits and good to know

- ODRÉ states a **quota of 50,000 API calls per user and per month** on these datasets because of excessive robot traffic. A run makes about 3 to 15 calls (one per query window, spaced 250 ms); `SUMMARY.odreQuotaRemaining` shows the remaining quota seen by the last call, and the note warns below 2,000. If the shared quota is exhausted, the run fails with the API message.
- On the day of the autumn clock change the source holds no rows for the repeated 02:00-03:00 (Paris) hour: 24 hourly rows instead of 25 (checked on 26 Oct 2025). The Actor does not fill that hole.
- Some source columns are typed as text (for example `"1315"`): numeric text is converted to a number, anything non-numeric becomes `null`.
- The CO2 rate exists only nationally. Regional data has no forecasts and no per-fuel thermal split.
- Real-time regional data are refreshed hourly (national: every 15 minutes), so the newest regional timestamp can be a little older than the national one.
- Unofficial; data may be incomplete or late: check the official eco2mix site (https://www.rte-france.com/eco2mix) before relying on a value.

### En français (court)

Outil **non officiel** qui reprend les données ouvertes éCO2mix de RTE (Licence Ouverte v2.0, Etalab) : consommation, production par filière (nucléaire, hydraulique, éolien, solaire, gaz, charbon, fioul, bioénergies), échanges, taux de CO2 (g/kWh), pour la France ou 12 régions, en temps quasi réel et en historique depuis 2012, avec des synthèses min / max / moyenne. Aucune donnée personnelle : uniquement des mesures du réseau. Les valeurs « temps réel » sont des estimations remplacées plus tard par des données consolidées.

# Actor input Schema

## `mode` (type: `string`):

Pick one. "latest" = use to get the most recent measured quarter-hours (consumption, generation per source, exchanges, CO2 rate), newest first; ignores from, to and lastDays. "range" = use when you need the time series of a period: set from and to (or lastDays), oldest first. "summary" = use to get min, max and mean per energy source (one record per metric and period) over a period instead of every quarter-hour; set from and to (or lastDays, default 7). Allowed values: latest, range, summary. Default: latest.

## `perimeter` (type: `string`):

Geographic scope. "national" = whole of mainland France, with forecasts, gas / coal / oil detail, commercial exchanges per border and the CO2 rate (g/kWh). "regional" = the 12 mainland regions (Corsica is not in the source), with thermal generation as one figure, no forecasts and no CO2 rate. Allowed values: national, regional. Default: national, or regional when regions is set.

## `regions` (type: `array`):

Regions to keep, as INSEE codes or names, e.g. \["11", "Bretagne"]. Names: Île-de-France (11), Centre-Val de Loire (24), Bourgogne-Franche-Comté (27), Normandie (28), Hauts-de-France (32), Grand Est (44), Pays de la Loire (52), Bretagne (53), Nouvelle-Aquitaine (75), Occitanie (76), Auvergne-Rhône-Alpes (84), Provence-Alpes-Côte d'Azur (93). Any of them matches (OR). Setting regions switches the perimeter to regional; empty with perimeter regional = all 12.

## `source` (type: `string`):

Which eco2mix dataset to read. "auto" = consolidated/definitive data where they exist, real-time data for the most recent period (recommended). "realtime" = only the real-time dataset (about the last 2 months, estimates). "consolidated" = only consolidated and definitive data (history since 2012 nationally, consolidated up to about the end of the previous month). Allowed values: auto, realtime, consolidated. Default: auto.

## `lastDays` (type: `integer`):

For range and summary: period = the last N days up to now, e.g. 7. Used only when from is empty. Default: 1 for range, 7 for summary. Not used by mode latest.

## `from` (type: `string`):

Start of the period for range and summary, format YYYY-MM-DD (from 00:00 Paris time) or YYYY-MM-DDTHH:mm (Paris time unless Z or +hh:mm is given), e.g. 2026-11-01. History starts on 2012-01-01 (national) and 2013-01-01 (regional). Empty = use lastDays.

## `to` (type: `string`):

End of the period, format YYYY-MM-DD (the whole day is included) or YYYY-MM-DDTHH:mm, e.g. 2026-11-07. Empty = now.

## `resolutionMinutes` (type: `integer`):

Keep only timestamps on this grid: 15, 30 or 60 minutes (e.g. 60 = one record per hour, 4 times cheaper than 15). Rows are only selected, never averaged or interpolated. Real-time data are quarter-hourly, consolidated data half-hourly. Default: 15 for latest and range, 30 for summary (so that real-time and consolidated rows weigh the same).

## `summaryBy` (type: `string`):

For summary only: "period" = one set of metrics for the whole period, "day" = per Paris calendar day, "month" = per Paris calendar month, e.g. day gives 11 metric records per day (national). Allowed values: period, day, month. Default: period.

## `order` (type: `string`):

Order of records by time for latest and range: "desc" = newest first, "asc" = oldest first. Allowed values: desc, asc. Default: desc for latest, asc for range. When maxResults cuts the period, the first records in this order are kept.

## `includeUnmeasured` (type: `boolean`):

By default only timestamps with measured consumption or generation are returned. Set true to also get rows that hold only forecasts (the real-time dataset lists the rest of the day and the next day with forecasts and empty measures). Default: false.

## `maxResults` (type: `integer`):

Maximum number of records delivered (and billed), e.g. 20. One record = one timestamp (and region) in latest and range, one metric of one period in summary. 20 national quarter-hours = 5 hours. The run also stops when the run cost cap is reached.

## Actor input object example

```json
{
  "mode": "latest",
  "regions": [
    "53"
  ],
  "source": "auto",
  "summaryBy": "period",
  "includeUnmeasured": false,
  "maxResults": 20
}
```

# Actor output Schema

## `records` (type: `string`):

Consumption, forecasts, generation per source, exchanges and CO2 rate per timestamp (and region).

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

Min, max and mean per metric and period, with sample counts.

## `dataset` (type: `string`):

Every field of every record, downloadable as JSON, CSV or Excel.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("shadow-tools/france-electricity-mix-eco2mix").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("shadow-tools/france-electricity-mix-eco2mix").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 '{}' |
apify call shadow-tools/france-electricity-mix-eco2mix --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,shadow-tools/france-electricity-mix-eco2mix"
        }
    }
}
```

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/efYsfQ0mMoiEEEdJc/builds/IyDDC9CdfsR7aTAco/openapi.json
