Sourcing carbon intensity data shouldn’t be the remit of developers. For that reason, CO2.js now includes yearly average grid intensity data from Ember, as well as marginal intensity data from the UNFCCC (United Nations Framework Convention on Climate Change).

Average and marginal intensity explained

Average emissions intensity uses the fuel mix of the entire electricity grid and can be used to derive estimates for the carbon footprint of a digital product or service. You’ll see average intensity used in the majority of carbon reporting standards and tooling. This makes it useful if you were to use CO2.js to feed in data to other carbon reporting tools.

Marginal intensity, on the other hand, looks at where the additional electricity to power a device, product or service would come from. In almost all cases it would be from a fossil-fuel power source, and so marginal intensity figures tend to be higher than average intensity figures. The Green Software Foundation is one group that uses marginal intensity as part of its specification.

If you want to learn more about the differences between average or marginal grid intensity data, the team over at Electricity Maps have two great blog posts explaining both concepts and why you might use one over the other.

Where to find the data

The raw data files (in CSV) format, can be found in the data folder in the CO2.js repository. We have written a generation script that parses the raw data files, and outputs grid intensity data in unminified JSON and CommonJS formats. The generated output can be found in the data/output folder of the CO2.js repository.

Using emissions intensity data

You can also import annual, country-level marginal or average grid intensity data into your projects directly from CO2.js. For example, if you wanted to use the average grid intensity for Australia in a project, then you can do so by using the code below:

import { averageIntensity } from '@tgwf/co2';
const { data, type, year } = averageIntensity;

const { AUS } = data;
console.log({ AUS })

Likewise, if you want to use annual marginal intensity for Australia:

import { marginalIntensity } from '@tgwf/co2';
const { data, type, year } = marginalIntensity;

const { AUS } = data;
console.log({ AUS })

All countries are represented by their respective Alpha-3 ISO country code.