Rank electricity zones by carbon intensity
compare_zonesRanks electricity zones by latest published carbon intensity to identify the cleanest grid for running workloads. Lower values are cleaner; non-comparable GB data is excluded by default.
Instructions
Rank several electricity zones (or all 45) by their most recently published carbon intensity, cleanest first by default.
Use it for "where should I run this training job", "is Sweden cleaner than Poland right now", "what are the five cleanest grids you cover".
Data contract (read this before you report any number to a user):
Unit is gCO2eq/kWh (grams of CO2-equivalent per kilowatt-hour of electricity consumed). LOWER IS CLEANER. There is no upper bound; roughly <100 is very clean, ~100-300 is moderate, >400 is fossil-heavy.
"ts" is the START of the reporting interval, in UTC (ISO-8601, "Z" suffix). A value with ts=2026-08-26T01:00:00Z and a 60-minute resolution covers 01:00-02:00 UTC.
"latest" means NEWEST PUBLISHED, NOT "now". European zones typically run 2-4 hours behind real time; US (EIA) zones run 11-28 hours behind. Every reading carries "age_minutes" and "age_human" -- state that age when you report the value. Saying "the current carbon intensity in Texas is X" about a 20-hour-old number is wrong.
GB values come from NESO and use OPERATIONAL (combustion-only) emission factors, not the IPCC AR5 lifecycle factors used for the other 44 zones. GB numbers are systematically lower and MUST NOT be compared or ranked against other zones.
Coverage starts 2026-08-21T00:00:00Z; there is no data before that date.
Attribution is a licence condition. If you surface these values to an end user, credit: ENTSO-E Transparency Platform / U.S. Energy Information Administration (EIA) / NESO Carbon Intensity API. EIA does not endorse this service or any use of it.
Great Britain — the one thing that makes this tool easy to get wrong: GB's numbers come from NESO and use OPERATIONAL (combustion-only) factors. The other 44 zones use IPCC AR5 LIFECYCLE factors, which also count plant construction and fuel supply chains. GB therefore looks cleaner than like-for-like. GB is EXCLUDED from the ranking by default and returned in "excluded_from_ranking" WITH its value and the reason, so you can still report it — just report it separately, never as "GB is the cleanest of these". Passing include_gb_in_ranking=true ranks it anyway and flags every affected row; only do that if the user has been told why the numbers differ.
Comparing different moments: Each zone's newest published interval has its own timestamp. European zones run 2-4h behind, US zones 11-28h behind, so a Europe-vs-US ranking compares observations taken up to a day apart. "observation_times.age_gap_minutes" reports that spread and a warning is added when it exceeds 6 hours. Say so when it applies.
Args:
zones (string[], optional): zone codes to rank. Omit to rank all covered zones.
order ("cleanest_first" | "dirtiest_first", default "cleanest_first").
limit (integer 1-45, default 45): cap on ranked rows.
include_gb_in_ranking (boolean, default false): see above.
response_format ("markdown" | "json", default "markdown").
Returns (structured): { "unit": "gCO2eq/kWh", "order": "cleanest_first", "comparison_basis": "IPCC AR5 lifecycle factors (GB excluded: operational factors)", "ranked_count": 3, "omitted_by_limit": 0, "ranked": [ { "rank": 1, "zone": "FR", "zone_name": "France", "gco2eq_kwh": 48.3, "ts": "2026-08-26T00:00:00Z", "age_minutes": 168, "age_human": "2h 48m ago", "freshness": "normal", "band": "very clean", "comparable": true, "method": "computed:v1" } ], "cleanest": { ... }, "dirtiest": { ... }, "spread_gco2eq_kwh": 356.1, "excluded_from_ranking": [ { "zone": "GB", "zone_name": "Great Britain", "gco2eq_kwh": 114, "ts": "2026-08-26T01:30:00Z", "age_human": "1h 18m ago", "reason": "GB uses operational (combustion-only) factors ... not comparable ..." } ], "observation_times": { "newest_ts": "...", "oldest_ts": "...", "age_gap_minutes": 90 }, "headline": "Of 3 zone(s) ranked, FR is cleanest at 48.3 gCO2eq/kWh ...", "warnings": [ ... ] }
Unknown zone codes are returned in "excluded_from_ranking" with reason "unknown zone code" instead of failing the whole call — surface them to the user, do not substitute a neighbour.
Examples:
"Germany, France or Spain — which is cleanest?" -> zones=["DE","FR","ES"]
"Five cleanest grids you cover" -> omit zones, limit=5
"Dirtiest US grid today" -> zones=["US-ERCOT","US-PJM","US-MISO","US-SPP","US-SOCO", "US-CAISO","US-ISONE","US-NYISO","US-BPA","US-TVA"], order="dirtiest_first", limit=1
Don't use for: one zone (get_carbon_intensity) or a time series (get_intensity_history).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum ranked rows to return. Mainly useful when ranking all zones, e.g. limit=5 with order='cleanest_first' for the five cleanest grids. | |
| order | No | Sort direction. 'cleanest_first' = ascending gCO2eq/kWh (lowest emissions first). | cleanest_first |
| zones | No | Zone codes to rank, e.g. ["DE","FR","ES"]. Omit to rank every covered zone (use 'limit' to keep that readable). Unknown codes are reported back rather than silently dropped. | |
| response_format | No | Output format for the text content. 'markdown' is compact and human-readable; 'json' returns the full structured payload as text. Structured data is always returned alongside either way. | markdown |
| include_gb_in_ranking | No | Great Britain uses operational (combustion-only) emission factors while the other 44 zones use IPCC AR5 lifecycle factors, so GB's number is systematically lower and ranking it against the others is misleading. By default GB is kept OUT of the ranking and reported separately with its value and an explanation. Set true only if the user has been told about the mismatch; GB is then ranked but flagged as not comparable in every row and in a top-level warning. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| unit | Yes | ||
| order | Yes | ||
| ranked | Yes | ||
| cleanest | No | ||
| dirtiest | No | ||
| headline | Yes | ||
| warnings | Yes | ||
| ranked_count | Yes | ||
| comparison_basis | Yes | ||
| omitted_by_limit | Yes | Zones that had data and were ranked but were cut by 'limit'. When >0, every figure in this response describes the returned rows only. | |
| observation_times | Yes | ||
| spread_gco2eq_kwh | No | ||
| excluded_from_ranking | Yes |