Chevron Demystifying the Carbon Intensity API - Will Rowe

Demystifying the Carbon Intensity API - Will Rowe

Comment by Will Rowe, Data Scientist at Energy Systems Catapult. 

I’ve recently been working with the Carbon Intensity API, and I thought it might be worth sharing a few learnings. Let’s dive straight in.

What’s the Carbon Intensity API anyway?

Have you ever wondered how much carbon it takes to generate the electricity you’re using right now? Well now you can find out. The Carbon Intensity API tells you how much carbon it took to produce each unit of electricity (the ‘carbon intensity’) in any given half hour for any location in Great Britain. It can even give you a forecast.

Who’s Behind It? National Grid ESO, the University of Oxford Department of Computer Science, and the WWF teamed up. Their mission? To allow scheduling and minimisation of CO2 emissions.

Who can use it? Reading the terms, it seems like anyone can use the data for almost any use. Obviously, there are the usual restrictions of not using the API to break the law, but other than this, the main restrictions are not to sell access to or reproduce the API yourself.

The nitty-gritty: what can you do?

Although it can also be used for forecasts, I used the API to calculate historic, time-of-use carbon emissions. Pairing the API with half-hourly energy use data, this is straightforward and comes with three main benefits over using national conversion factors.

Simplicity: The API gives you a single, programmatic source for carbon intensity figures going back years. No need to reference multiple spreadsheets or CSVs.

loading="lazy"

Figure 1: Example python code snippet of simple API call with received response in json format.

Time-of-use transparency: Electricity is kind of moody—it’s generally cleaner when it’s windy, sunny or during times of low demand, like at night. It’s dirtier at peak times and on cloudy, still days. With half-hourly data, we can easily account for this. Thanks to the API, we can pinpoint CO2 emissions based on when you switch on that kettle. Taking time-of-use into account, you get credit for only consuming when the grid is green, whereas using average figures assumes the same intensity for use at all times of day, and throughout the year. You can get an instant look at the live energy mix on energydashboard.co.uk, they use the API for their carbon intensity numbers.

loading="lazy"

Figure 2: API call URL adapted for specific datetime range of data and response received.

Location, location, location: Regional carbon intensity varies. For example, Scotland’s wind turbines often produce significant proportions of the region’s electricity, meaning theirs is often the greenest electricity in GB. Using national figures would unfairly treat usage in the highlands as causing the same emissions as usage in more polluting areas. Again, this API makes it easy to account for this. For a better visual understanding of how generation varies across GB see the map on energydashboard.co.uk.

loading="lazy"

Figure 3: API call URL for specific region specified by outer postcode (outcode) and response received.

Behind the scenes: CO2 API tips

  1. Call limitations: If you’re after all the historic intensity data you can get, be patient. The API has its limits. It’ll only serve you two weeks’ worth of data at a time. So, be patient, you’ll need to loop and make calls for subsequent two-week periods. This can take time (a few minutes for years of data), but good things come to those who wait…
  2. Local data cache: We found it really helpful to make a local cache of the data rather than requesting all the data on every run. By saving the data where our code can reach it faster, we’ve sped up our calculations. Plus, it’s a win-win—we reduce the load on the API service too.
  3. Regional rendezvous: Does your analysis cover multiple regions? Not to worry, the API has got you covered. Make a single regional call and you’re done. Data for all GB regions arrives simultaneously, for the requested time period.
loading="lazy"

Figure 4: API call URL for regional data for a datetime range. Response given for all regions is too long to include here but resembles the response shown in figure 3.

The future: Why does this matter?

  1. When matters: As we transition to renewable generation the grid carbon intensity will become more volatile. Throughout the day, fluctuations in electricity demand and windspeed change the grid generation mix and thus its carbon intensity. Time-of-use analysis is therefore becoming more important as we understand it is not only the amount of energy we consume, but when we use it, that matters.
  2. Where matters: The challenges of balancing the grid are growing as more renewables come onto the system, often located further away from major centres of demand. Grid constraints are a major challenge for the Electricity System Operator, and we still need to reduce our reliance on gas generation, often used to manage those constraints. While a rapid move to nodal pricing has been ruled out for now, the debate about locational market reform continues. Again, this shows that amount of energy use is only part of the picture, place-of-use matters and is growing in importance.

It is important for users to have easy access to carbon intensity data, granular to time and location. The Carbon Intensity API provides this data for free, in a fast and simple way.

Download

Carbon Intensity API example code

Harnessing Digital & Data

Independent thought leadership and practical expertise that harnesses digital and data innovation to tackle the hardest challenges on the way to Net Zero.

Find out more

Want to know more?

Find out more about how Energy Systems Catapult can help you and your teams