UK Carbon Intensity API

Beginner's Pick Environment / No Auth Required Beginner HTTPS
Free to Use
62 C
Measured Score 0 50 100 Speed 3/30 Consistency 20/20 Security 20/20 Browser access 15/15 Transparency 4/15 TESTED 2026-08-10

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.

Measurement Record

What actually happened when we called this API from our own infrastructure. Every value below was recorded by the request, not copied from the provider's documentation.

Request
GET https://api.carbonintensity.org.uk/intensity
Result
HTTP 200 · application/json · 187 bytes
Response time
1046 ms (median of 3) · fastest 1027 ms
Transport
TLSv1.3 · TLS_AES_128_GCM_SHA256 · certificate issued by Amazon
Browser CORS
Allowed — Access-Control-Allow-Origin: *
Recorded
2026-08-10

Fields Returned

Top-level fields present in the response we captured, with the type and value we actually received.

Field Type Value received
from string (date) 2026-08-10T19:00Z
to string (date) 2026-08-10T19:30Z
intensity object {1 fields}

Captured Response

Captured from a real request to https://api.carbonintensity.org.uk/intensity on 2026-08-10. Long arrays and nested objects are truncated to keep the shape readable.

JSON Response · Captured
{
  "data": [
    {
      "from": "2026-08-10T19:00Z",
      "to": "2026-08-10T19:30Z",
      "intensity": {
        "…": "(3 more fields)"
      }
    }
  ]
}

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

Implementation Example

Request skeleton. The URL below is this API's documentation page, not a live endpoint — swap in the path you need from the provider's docs before running it.

Request
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.

How This API Fails

We deliberately sent this API a broken request and recorded exactly what came back on 2026-08-10. Knowing the shape of an error before you hit it makes error handling much easier to write.

HTTP 400 Requesting a path that does not exist application/json
{
  "error": {
    "code": "400 Bad Request",
    "message": "Please enter a valid datetime in ISO8601 format YYYY-MM-DDThh:mmZ e.g. /intensity/2017-08-25T15:30Z"
  }
}

Common Errors & Troubleshooting

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

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

Measured Score Breakdown

Live HTTP request to the API endpoint

Speed 3/30
Consistency 20/20
Security 20/20
Browser access 15/15
Transparency 4/15
Endpoint Response Time 1046ms

Fully tested on Aug 10, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS UNKNOWN
Category Environment
Difficulty Beginner
Endpoint last called: 2026-08-10

Related Tags

Similar APIs

View All →