Skip to content

A new API for grid-aware websites and beyond

Purple to white gradient background with words Grid-aware websites and Green Web Foundation logo in bottom left

In 2025, we worked on the Grid-aware Websites project to explore how frontend developers can create dynamic web experiences that connect digital usage with real world conditions. One outcome from that project has been a set of new APIs from data provider Electricity Maps. In this blog post, Fershad Irani, lead developer on the Grid-aware Websites project introduces the new APIs and shares the story of how they came about.

In late 2024, we kicked off an ambitious project called Grid-aware Websites thanks to funding from SIDN Fonds. At its core, the project aimed to enable the creation of dynamic online experiences that respond to the energy grid they are being used on –  delivering core content when the grid is fuelled by dirtier energy, and enhancing the experience as the grid becomes cleaner. This capability allows developers and organisations to bring digital sustainability directly to their users – be that through reducing device energy consumption when browsing a website, or raising awareness of the connection between digital use and real world planetary impacts. 

The project drew inspiration from the ideas and implementation of carbon-aware computing which we’re seeing more instances of in backend systems, and sought to bring similar concepts into the hands of frontend web developers. There’ll be a blog post with more detailed project learnings coming soon.

To make grid awareness for websites possible, we needed:

  • a live data source,
  • with a wide global coverage,
  • providing some kind of indication as to how much clean or dirty energy was being used on a given energy grid,
  • with generous free access to let people try out grid-aware ideas.

A bump in the road

When we started the project in September 2024, our intention was to rely on the main Electricity Maps’ Live Carbon Intensity API as the main data source. At the time, this API met all the criteria above – returning the latest available information about the carbon intensity value (in grams of CO2e) for a given region.

A couple of months in, though, we discovered that the coverage of the Live Carbon Intensity API had changed. Free use of the API had become restricted to a single region. Not ideal. Most websites are available to a global audience, and so limiting the available data to a single region would have an impact on what outcomes we could achieve through the Grid-aware Websites project. 

Reaching out to Electricity Maps

Following the principle of if you don’t ask, you don’t receive, we reached out to Electricity Maps to seek clarification on these changes and ask if they would entertain the possibility of opening up the API again for our project.

Thankfully, the Electricity Maps team were very receptive to our outreach. Over the course of a few conversations with their API team we came to a solution that enabled our Grid-aware Websites project to continue, and also be used by others exploring grid-aware ideas in other parts of the tech stack.

That solution is a new free API from Electricity Maps called the Carbon Intensity Level API.

What is the Carbon Intensity Level API?

Electricity Maps’ new Carbon Intensity Level API provides a high, moderate, or low signal reflecting the current carbon intensity of a location’s energy grid compared to a rolling 10-day average. 

The high, moderate, and low status is determined by the following thresholds:

Low: 15% below average (ratio < 0.85)

Moderate: between 15% below and 15% above average (0.85 ≤ ratio ≤ 1.15)

High: 15% above average (ratio > 1.15) 

Access to the API is free for all Electricity Maps zones. Data in the API is updated hourly. 

For the Grid-aware Websites project, this API was a perfect solution. Knowing whether a grid was high (dirtier), moderate (around average), low (cleaner) was the exact signal our code library needed in order to determine when grid aware changes should be applied to a web site.

Note: The API currently provides only real-time, relative levels (compared to the rolling 10-day average). To use absolute thresholds, other timeframes, or raw numbers (i.e. standard APIs) a separate, paid plan is required.

Why this matters

There are definitely scenarios where having access to detailed, granular data about energy grids is useful and important. However for most scenarios, especially when it comes to grid-aware applications, being able to receive signals about the state of a grid is more than enough. 

When we first approached Electricity Maps about broader API access we weren’t expecting to end up with a set of new APIs that make building grid-aware applications easier for many more developers. Besides the Carbon Intensity Level API, there are also APIs giving signals about the percentage of carbon-free (Carbon-free Level API), and renewable (Renewable Level API) energy sources on a grid. We’re excited to see developers get the chance to work with these data points, and are pleased to have played a role in making them available to the world.

What else can you do with the Carbon Intensity Level API?

Applications for the Carbon Intensity Level API aren’t just limited to Grid-aware Websites. For us, this API makes the data required to apply grid awareness to a wide range of projects more accessible to developers.

Here are some other grid aware project ideas we’d love to see folks explore:

  • Make your home grid aware: Using this API with Home Assistant, you could have your home appliances run or return to charge at times when the grid is powered by more clean energy.
  • Build grid-aware backends: Schedule database backups, or other heavy computational tasks to run at times when the grid is powered by more clean energy.
  • Grid-aware LLM: Create an LLM that queues queries or tasks when the grid is dirty, and runs them as more clean energy becomes available.

If you’re building a grid-aware website, or another grid-aware project, we’d love to hear about it!

Many thanks once again goes to the team from Electricity Maps for their efforts on ideating, building, and publishing this API.