The Grid Intensity CLI allows data to be sourced from several providers. Currently the following integrations are available:
If you would like us to integrate more providers please open an issue.
You can generate a list of all the available providers in the Grid Intensity CLI by running the
grid-intensity provider list command. This will generate a table output with the provider name, and related website URL.
grid-intensity provider list
When running the Grid Intensity CLI, you can change providers by passing the
--provider flag, along with the name of the provider you want to use. Alternately, you can set
GRID_INTENSITY_PROVIDER as an environment variable.
When no provider is set, the CLI will use Ember as the default.
Ember is an energy think tank that uses data-driven insights to shift the world from coal to clean electricity.
Ember is the default provider for the Grid Intensity CLI. The Ember integration returns regional data by country, for the last calendar year.
When using Ember, you will need to pass either an Alpha-2 or Alpha-3 ISO country code. You can do this using the
For example, the code below returns data for Taiwan.
grid-intensity --provider Ember --location TW
"units": "gCO2e per kWh",
WattTime is a nonprofit that offers technology solutions that make it easy for anyone to achieve emissions reductions without compromising cost, comfort, and function.
Before using the WattTime integration, you must first create a user account. This will allow you to access and use their API. Details on registering an account are available on the WattTime website.
Once you have created a WattTime account, you must set the
WATT_TIME_PASSWORD environment variables. This allows the Grid Intensity CLI to access the WattTime API.
When using WattTime, you will need to pass a location that is supported by the WattTime API. WattTime's API documentation details how you can get a list of locations, or use latitude & longitude to find a specific location.
For example, running the command below returns an array data for California Independent System Operator (North).
grid-intensity --provider WattTime --location CAISO_NORTH
"units": "lbCO2e per MWh",
Each location will return a
percent field. This value represents the relative real-time marginal emissions intensity for the past month.
If you require absolute Marginal Operating Emissions Rate (MOER) data, this is available for free when querying the
CAISO_NORTH location as shown above. However, you will require a WattTime Pro subscription to obtain this data for other locations.
The Electricity Map API provides worldwide access to 24/7 grid carbon intensity historically, in real time, and as a forecast for the next 24 hours.
Before using the Electricity Maps integration, you must first obtain an API key. This will allow you to access and use their API.
Once you have an Electricity Map API key, you must set the
ELECTRICITY_MAP_API_TOKEN environment variable. This allows the Grid Intensity CLI to access the Electricity Map API.
When using Electricity Maps, you will need to pass a supported location. You can get a list of all supported locations using the Electricity Map API.
For example, running the command below will return data for Portugal.
grid-intensity --provider ElectricityMap --location PT
National Grid ESO have developed a Regional Carbon Intensity forecast for the Great Britain electricity grid.
The UK Carbon Intensity API integration supports only one area,
--location=UK. This can be passed to the CLI as an optional parameter.
For example, the code below returns data for the UK.
grid-intensity --provider CarbonIntensityOrgUK --location UK
"units": "gCO2e per kWh",