CARBON INTENSITY API

Last-hour grid carbon intensity, by country

Operational, lifecycle and consumption-based carbon intensity (gCO2eq/kWh) for every country with published electricity data — 213 in total. Real last-hour readings where a live grid feed exists; a labelled annual snapshot everywhere else. Refreshed hourly.

Quick example

Get the latest hour for one country (ISO code, alpha-3, or name):

curl https://ci-api.fabiocicerchia.it/v1/last-hour/DE
{
  "country": "Germany",
  "country_code": "DE",
  "hour_start": "2026-08-08T13:00:00Z",
  "hour_end": "2026-08-08T14:00:00Z",
  "unit": "gCO2eq/kWh",
  "direct": 330,
  "lifecycle": 380,
  "consumption": 370,
  "basis": "measured",
  "source": "ENTSO-E",
  "generated_at": "2026-08-08T13:05:00Z",
  "stale": false
}

Each country is a static file for O(1) access. basis is "measured" (a real live reading) or "annual-average" (fallback); stale is true if the hourly refresh is late.

Endpoints

PathReturns
/v1/last-hour/<CODE>Last-hour reading for one country (O(1); accepts ISO-2/ISO-3/name)
/v1/latest.jsonAll countries in one snapshot
/v1/countriesSupported countries (with data source per country)
/health, /licenseService + license info

Data & methodology

Built from raw grid-operator data with lifecycle factors following IPCC AR6 and consumption-based accounting in the spirit of the ECON-PowerCI method (Nature, 2025). Live readings compute operational intensity from each grid's generation mix; lifecycle and consumption are layered on per country.

Sources & attribution