# Carbon Intensity API — Global Grid CO2 Data (`jenko_systems/carbon-intensity-api`) Actor

Real-time and historical carbon intensity (gCO2eq/kWh) for 45+ countries/regions. Built from raw grid operator data (ENTSO-E, EIA, NESO, ONS) with lifecycle and consumption-based calculations following IPCC AR6 and the ECON-PowerCI methodology (Nature 2025).

- **URL**: https://apify.com/jenko\_systems/carbon-intensity-api.md
- **Developed by:** [Jenko Systems](https://apify.com/jenko_systems) (community)
- **Categories:** Integrations, Automation, News
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

$99.00 / 1,000 results

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## 🌍 Carbon Intensity API

**Real-time and historical electricity carbon intensity (gCO₂eq/kWh) plus prices, load, and cross-border flows for 45+ countries and grid regions.**

🔓 **Zero API keys. Zero registration. Zero tokens.** All data sources are public:

- 🇪🇺 **Fraunhofer Energy-Charts** (Europe — 30 countries via the German research institute Fraunhofer ISE)
- 🇺🇸 **EIA Hourly Electric Grid Monitor** (US — bulk CSVs, public domain)
- 🇬🇧 **UK NESO Carbon Intensity API** (UK — National Energy System Operator)
- 🇧🇷 **ONS Dados Abertos** (Brazil — Operador Nacional do Sistema Elétrico)

Built with both **production-based** and **consumption-based (flow-traced)** calculations following IPCC AR6 emission factors and the ECON-PowerCI methodology (Nature 2025).

---


### 🎯 What this delivers

For each hour and country/region:

| Field | Description |
|---|---|
| `carbon_intensity_gco2_kwh` | gCO₂eq per kWh of electricity |
| `renewable_pct` | % from wind, solar, hydro, biomass, geothermal |
| `fossil_free_pct` | renewable + nuclear |
| `total_generation_mwh` | total electricity generated |
| `fossil_only_intensity_gco2_kwh` | CI of fossil portion only |
| `generation_mix_mw` | breakdown by source: wind, solar, gas, coal, etc |
| **`load_mw`** | total system demand (consumption) |
| **`net_load_mw`** | load minus variable renewables (= load to be served by dispatchable sources) |
| **`day_ahead_price`** | wholesale spot market price |
| **`day_ahead_price_currency`** | EUR (Europe), USD (US), GBP (UK), BRL (BR) |
| **`day_ahead_price_zone`** | bidding zone code (e.g., "DE-LU", "FR", "IT-NORTH") |
| **`cross_border_flows_mw`** | list of imports/exports with neighbouring zones |

Available in 4 methods (all calculated, choose which to return):

- **production_lifecycle** (default) — IPCC AR6 lifecycle factors, only domestic generation
- **production_operational** — combustion-only factors
- **consumption_lifecycle** — flow-traced through cross-border imports, lifecycle factors
- **consumption_operational** — flow-traced, operational factors

---

### 🌐 Coverage

**Europe (30 countries via Fraunhofer Energy-Charts):**
AT, BE, BG, CH, CZ, DE, DK, EE, ES, FI, FR, GR, HR, HU, IE, IT, LT, LU, LV, ME, MK, NL, NO, PL, PT, RO, RS, SE, SI, SK

**United Kingdom (via NESO):**
GB

**United States (10 Balancing Authorities via EIA bulk CSV):**
US-CISO (California), US-ERCO (Texas), US-MISO, US-PJM, US-NYIS, US-ISNE, US-BPAT, US-SWPP, US-SOCO, US-FPL

**Brazil (4 SIN submarkets via ONS):**
BR-SE (Sudeste/CO), BR-S (Sul), BR-NE (Nordeste), BR-N (Norte)

---

### ⚙️ Input

```json
{
  "mode": "latest",
  "hours": 48,
  "method": "production_lifecycle",
  "countries": ["DE", "FR", "GB", "US-CISO", "BR-SE"]
}
````

That's it. Just run it.

#### Modes

- `latest` — last N hours (most recent data, default 48h)
- `today` — current UTC day so far
- `yesterday` — full previous UTC day
- `full_refresh` — entire history since 2015 (long run)

#### Optional skip flags

- `skip_europe`, `skip_us`, `skip_uk`, `skip_brazil` — disable specific data sources

***

### 📦 Output

Each hour × country yields one record:

```json
{
  "country_code": "DE",
  "country_name": "Germany",
  "region": "europe",
  "source": "fraunhofer",
  "timestamp_utc": "2026-05-05T14:00:00+00:00",
  "method": "production_lifecycle",
  "carbon_intensity_gco2_kwh": 312.4,
  "renewable_pct": 47.2,
  "fossil_free_pct": 52.8,
  "total_generation_mwh": 58420.5,
  "fossil_only_intensity_gco2_kwh": 658.3,
  "generation_mix_mw": {
    "wind": 16850.2,
    "solar": 7106.4,
    "nuclear": 3268.5,
    "gas": 13088.4,
    "coal": 8358.2,
    "hydro": 3855.7,
    "biomass": 2400.0,
    "oil": 290.1
  },
  "load_mw": 60140.0,
  "net_load_mw": 29928.5,
  "day_ahead_price": 86.43,
  "day_ahead_price_currency": "EUR",
  "day_ahead_price_zone": "DE-LU",
  "cross_border_flows_mw": [
    { "counterparty": "FR", "flow_mw": 5200.0, "direction": "import" },
    { "counterparty": "PL", "flow_mw": 1100.0, "direction": "import" },
    { "counterparty": "AT", "flow_mw":  800.0, "direction": "export" }
  ]
}
```

***

### 🧮 Methodology

#### Production-based

```
CI_production = Σ(generation_i × emission_factor_i) / Σ(generation_i)
```

Per hour, sum each fuel's MW × its IPCC AR6 lifecycle factor (gCO₂eq/kWh), divide by total. Doesn't account for imports.

#### Consumption-based (flow-traced)

For interconnected grids, what matters is *what you consume*, not *what you produce*. We solve a linear system per hour:

```
(G_i + IM_i) · x_i = own_emissions_i + Σⱼ(flow_jᵢ × x_j)
```

where `x_i` is the consumption-based CI of country `i`, `G_i` is domestic generation, `IM_i` is total imports, and `flow_jᵢ` is the physical power flow from `j` into `i`.

Solved with `numpy.linalg.solve` per hour. Method follows [ECON-PowerCI (Nature Scientific Data, 2025)](https://www.nature.com/articles/s41597-025-05978-7).

#### Emission factors (IPCC AR6 WG3, Annex III median values)

| Source | Lifecycle (gCO₂eq/kWh) | Operational |
|---|---:|---:|
| Wind | 11 | 0 |
| Solar | 48 | 0 |
| Nuclear | 12 | 0 |
| Hydro | 24 | 0 |
| Biomass | 230 | 90 |
| Gas | 490 | 370 |
| Coal | 820 | 760 |
| Oil | 650 | 580 |

***

### 🚀 Use cases

- **ESG / Scope 2 carbon accounting** — accurate hourly CI for corporate reporting
- **Climate tech & green software** — schedule loads when grid is cleanest
- **Energy trading** — backtesting and signal generation
- **Academic research** — replicable, IPCC-aligned dataset
- **Grid-aware applications** — compute, EV charging, smart home

***

### 🔄 Schedule

Apify scheduler can run this actor every hour to keep your dataset fresh. Output is overwritten/upserted by `(country, timestamp, method)` so reruns are idempotent.

***

### 📄 Data sources

All data sources are public and free, no authentication required:

- **Fraunhofer Energy-Charts** — operated by Fraunhofer ISE (German federal research institute), data aggregated from ENTSO-E. License: CC BY 4.0
- **EIA Hourly Electric Grid Monitor** — US Energy Information Administration. Public domain (US gov)
- **NESO Carbon Intensity API** — UK National Energy System Operator. License: CC BY 4.0
- **ONS Dados Abertos** — Operador Nacional do Sistema Elétrico (Brazil). License: CC BY

Methodology citations: IPCC AR6 (Working Group III, Annex III) + ECON-PowerCI (Nature Scientific Data 2025, doi:10.1038/s41597-025-05978-7).

Built by [Jenko Systems](https://jenkosystems.com).

# Actor input Schema

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

How much data to fetch on this run.

## `hours` (type: `integer`):

Number of hours to fetch back from now. Only used when mode=latest.

## `method` (type: `string`):

Which carbon intensity method to return in the dataset. All four are calculated and stored regardless.

## `countries` (type: `array`):

Optional list of country/zone codes to include in output. Leave empty for all 45. Examples: \['DE','FR','GB','US-CISO','BR-SE'].

## `skip_europe` (type: `boolean`):

Skip the European data source if you only need US/UK/BR.

## `skip_us` (type: `boolean`):

Skip US data fetch.

## `skip_uk` (type: `boolean`):

Skip UK data fetch.

## `skip_brazil` (type: `boolean`):

Skip Brazil data fetch.

## Actor input object example

```json
{
  "mode": "latest",
  "hours": 48,
  "method": "production_lifecycle",
  "countries": [],
  "skip_europe": false,
  "skip_us": false,
  "skip_uk": false,
  "skip_brazil": false
}
```

# 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("jenko_systems/carbon-intensity-api").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("jenko_systems/carbon-intensity-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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 jenko_systems/carbon-intensity-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=jenko_systems/carbon-intensity-api",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Carbon Intensity API — Global Grid CO2 Data",
        "description": "Real-time and historical carbon intensity (gCO2eq/kWh) for 45+ countries/regions. Built from raw grid operator data (ENTSO-E, EIA, NESO, ONS) with lifecycle and consumption-based calculations following IPCC AR6 and the ECON-PowerCI methodology (Nature 2025).",
        "version": "1.0",
        "x-build-id": "y39fX9qDCeuCxl9vV"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/jenko_systems~carbon-intensity-api/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-jenko_systems-carbon-intensity-api",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/jenko_systems~carbon-intensity-api/runs": {
            "post": {
                "operationId": "runs-sync-jenko_systems-carbon-intensity-api",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/jenko_systems~carbon-intensity-api/run-sync": {
            "post": {
                "operationId": "run-sync-jenko_systems-carbon-intensity-api",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "mode": {
                        "title": "Run Mode",
                        "enum": [
                            "latest",
                            "today",
                            "yesterday",
                            "full_refresh"
                        ],
                        "type": "string",
                        "description": "How much data to fetch on this run.",
                        "default": "latest"
                    },
                    "hours": {
                        "title": "Hours back (when mode=latest)",
                        "minimum": 1,
                        "maximum": 720,
                        "type": "integer",
                        "description": "Number of hours to fetch back from now. Only used when mode=latest.",
                        "default": 48
                    },
                    "method": {
                        "title": "Calculation Method",
                        "enum": [
                            "production_lifecycle",
                            "production_operational",
                            "consumption_lifecycle",
                            "consumption_operational"
                        ],
                        "type": "string",
                        "description": "Which carbon intensity method to return in the dataset. All four are calculated and stored regardless.",
                        "default": "production_lifecycle"
                    },
                    "countries": {
                        "title": "Country / region filter",
                        "type": "array",
                        "description": "Optional list of country/zone codes to include in output. Leave empty for all 45. Examples: ['DE','FR','GB','US-CISO','BR-SE'].",
                        "items": {
                            "type": "string"
                        },
                        "default": []
                    },
                    "skip_europe": {
                        "title": "Skip Europe (Fraunhofer)",
                        "type": "boolean",
                        "description": "Skip the European data source if you only need US/UK/BR.",
                        "default": false
                    },
                    "skip_us": {
                        "title": "Skip United States (EIA bulk)",
                        "type": "boolean",
                        "description": "Skip US data fetch.",
                        "default": false
                    },
                    "skip_uk": {
                        "title": "Skip United Kingdom (NESO)",
                        "type": "boolean",
                        "description": "Skip UK data fetch.",
                        "default": false
                    },
                    "skip_brazil": {
                        "title": "Skip Brazil (ONS)",
                        "type": "boolean",
                        "description": "Skip Brazil data fetch.",
                        "default": false
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
