# UK Electricity Carbon Intensity by Postcode (`smilemask/uk-grid-carbon-intensity`) Actor

Look up the current half-hourly carbon intensity forecast and electricity generation mix (wind, gas, nuclear, solar, biomass, hydro, coal, imports, other) for the local grid region of any UK postcode. Official National Grid ESO data, no key needed, CC BY 4.0 licensed.

- **URL**: https://apify.com/smilemask/uk-grid-carbon-intensity.md
- **Developed by:** [돈벼락](https://apify.com/smilemask) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## UK Electricity Carbon Intensity by Postcode

Look up the current half-hourly carbon intensity forecast and electricity generation mix (wind, gas, nuclear, solar, biomass, hydro, coal, imports, other) for the local grid region of any UK postcode. Official National Grid ESO data, no key needed, CC BY 4.0 licensed.

### What does UK Electricity Carbon Intensity by Postcode do?

Current grid carbon intensity and fuel mix (wind, gas, nuclear, solar...) for any UK postcode.

### What can you use it for?

- Schedule energy-intensive tasks (EV charging, batch jobs) when the grid is cleanest.
- Add a live carbon-intensity badge to a UK website or app by postcode.
- Compare renewable generation share across UK regions.
- Feed grid carbon data into sustainability or ESG reporting dashboards.

### Why use this Actor?

- **Fast and cheap:** lightweight HTTP-based Actor with no browser, so runs finish in seconds and cost very little.
- **No API keys or accounts needed** for the data source (see notes below).
- **Clean, structured JSON** that you can export as CSV, Excel, JSON or XML, or pull through the Apify API and integrations.
- **Scheduling, webhooks and integrations:** run it daily and send results to Google Sheets, Slack, Zapier, Make, n8n or your own API.

### Input

Configure the run in the **Input** tab (all fields have sensible defaults).

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `postcodes` | array of strings | yes | - | Outward postcode only, e.g. SW1A, EH1, M1, CF10, B1. |

#### Example input

```json
{
  "postcodes": [
    "SW1A",
    "EH1",
    "M1",
    "CF10"
  ]
}
```

### Output

Results are stored in the default dataset. Download them from the **Output** tab or via the API.

#### Example result

```json
{
  "postcode": "EH1",
  "regionId": 2,
  "regionName": "South Scotland",
  "dnoRegion": "SP Distribution",
  "periodFrom": "2026-10-03T23:30:00.000Z",
  "periodTo": "2026-10-04T00:00:00.000Z",
  "forecastIntensity": 0,
  "intensityIndex": "very low",
  "windPct": 82.3,
  "gasPct": 0,
  "nuclearPct": 17.7,
  "solarPct": 0,
  "biomassPct": 0,
  "hydroPct": 0,
  "coalPct": 0,
  "importsPct": 0,
  "otherPct": 0,
  "license": "CC BY 4.0 (National Energy System Operator, Carbon Intensity API)",
  "scrapedAt": "2026-10-04T00:11:08.102Z"
}
```

#### Output fields

| Field | Type | Example |
|---|---|---|
| `postcode` | string | "EH1" |
| `regionId` | number | 2 |
| `regionName` | string | "South Scotland" |
| `dnoRegion` | string | "SP Distribution" |
| `periodFrom` | string | "2026-10-03T23:30:00.000Z" |
| `periodTo` | string | "2026-10-04T00:00:00.000Z" |
| `forecastIntensity` | number | 0 |
| `intensityIndex` | string | "very low" |
| `windPct` | number | 82.3 |
| `gasPct` | number | 0 |
| `nuclearPct` | number | 17.7 |
| `solarPct` | number | 0 |
| `biomassPct` | number | 0 |
| `hydroPct` | number | 0 |
| `coalPct` | number | 0 |
| `importsPct` | number | 0 |
| `otherPct` | number | 0 |
| `license` | string | "CC BY 4.0 (National Energy System Operator, Carbon Inten... |
| `scrapedAt` | string | "2026-10-04T00:11:08.102Z" |

### How much does it cost?

The Actor is billed by Apify according to the pricing shown on the **Pricing** tab of this page. Runs are small and fast, and the Apify Free plan includes monthly platform credits so you can try it at no cost. You can set a maximum cost per run, and the Actor stops cleanly when that limit is reached.

### Notes and limitations

- Use the outward part of a UK postcode only, e.g. SW1A, EH1, M1, CF10 (not the full postcode with inward code).
- Data refreshes every 30 minutes. The forecast, not a metered actual, is what the regional API provides.

### Tips

- Start with a small test run, then scale up the input.
- Use **Schedules** to automate recurring runs and **Webhooks** or **Integrations** to deliver the data where you need it.
- Call the Actor from your code with the Apify API or the official JavaScript and Python clients.

### FAQ

**Where does the data come from?**

The UK's National Energy System Operator (NESO, formerly National Grid ESO) Carbon Intensity API, licensed CC BY 4.0.

**What does the intensity number mean?**

Grams of CO2 per kilowatt-hour (gCO2/kWh) of electricity generated in that grid region, forecast for the current half-hour period.

**Why no 'actual' intensity for a postcode?**

NESO only publishes an actual (metered) figure at the national level; regional figures are forecast-only, which this API reflects.

### Feedback

Found a bug or need an extra field? Open an issue from the **Issues** tab of this Actor and it will be looked at quickly.

### More tools from the same author

- [Solar Panel Energy Estimate by Location (PVGIS, Bulk)](https://apify.com/SmileMask/solar-pv-energy-estimate-pvgis) - Monthly solar PV energy output estimates for any location from the EU PVGIS model.
- [Global Weather Forecast by Coordinates: Hourly (Bulk)](https://apify.com/SmileMask/weather-forecast-met-norway) - Hourly weather forecasts for any coordinates worldwide from the Norwegian Meteorological Institute.

# Changelog

This Actor's version history is a separate document: https://apify.com/smilemask/uk-grid-carbon-intensity/changelog.md

# Actor input Schema

## `postcodes` (type: `array`):

Outward postcode only, e.g. SW1A, EH1, M1, CF10, B1.

## Actor input object example

```json
{
  "postcodes": [
    "SW1A",
    "EH1",
    "M1",
    "CF10"
  ]
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {
    "postcodes": [
        "SW1A",
        "EH1",
        "M1",
        "CF10"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("smilemask/uk-grid-carbon-intensity").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 = { "postcodes": [
        "SW1A",
        "EH1",
        "M1",
        "CF10",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("smilemask/uk-grid-carbon-intensity").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "postcodes": [
    "SW1A",
    "EH1",
    "M1",
    "CF10"
  ]
}' |
apify call smilemask/uk-grid-carbon-intensity --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,smilemask/uk-grid-carbon-intensity"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/WStXpTW3Q6Nq3asNa/builds/sjRfAZrQsFojdd3ot/openapi.json
