UK Carbon Intensity API

⭐ Beginner's Pick Environment / No Auth Required Beginner HTTPS
Free to Use Varies (check documentation)

Overview

The UK Carbon Intensity API provides official real-time and forecast carbon intensity data for Great Britain's electricity grid, developed by National Grid. It tells you how much CO2 is generated per kilowatt-hour at any given time. No API key is needed, making it a great starting point for environmental or energy-aware applications.

💡

Beginner Tip

This API requires no authentication — just send a GET request to get live carbon intensity data. Try the /intensity endpoint first to see the current index and forecast.

Available Data

country name and code
population
capital city
region and subregion
flag image URL
vehicle make and model

Example Response

JSON Response
{
  "name": "Japan",
  "capital": "Tokyo",
  "population": 125800000,
  "region": "Asia",
  "languages": [
    "Japanese"
  ],
  "flag": "https://flagcdn.com/jp.svg",
  "currencies": [
    {
      "code": "JPY",
      "name": "Japanese yen"
    }
  ]
}

Field Reference

from ISO 8601 timestamp for the start of the half-hour period
to ISO 8601 timestamp for the end of the half-hour period
intensity.forecast Forecasted carbon intensity in gCO2/kWh
intensity.actual Actual measured carbon intensity in gCO2/kWh
intensity.index Descriptive rating such as very low, low, moderate, high, or very high

Implementation Example

const url = "https://carbon-intensity.github.io/api-definitions/";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

404 Not Found Using an incorrect or misspelled endpoint path
Check the official docs for correct paths such as /intensity, /intensity/date, or /generation
Empty or unexpected response Querying a future date too far ahead where no forecast exists
Limit date queries to within the 48-hour forecast window
CORS error in browser The API may not support all browser-origin requests without a proxy
Use a server-side fetch or a CORS proxy for browser-based apps

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 20/20
🔒 Security 15/15
🛠 Developer XP 20/20
✓ Reliability 7/15
Response Time 60ms

Fully tested on Apr 5, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS UNKNOWN
Category Environment
Difficulty Beginner
Verified: 2026-04-04

Similar APIs

View All →