You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently, data used to estimate the carbon impact ouf of electrical consumption is stored in the package, stored manually.
CPU references & their TDP values are often requested by users, and must be integrated in a manual way.
Data center carbon impact & global energy mix values are updated at most yearly when we get the data, with heterogeneous sources.
Describe the solution you'd like
A clear process to update data, which can be applied to the following paramters :
Datacenter PUE, when available
Location-based energy mix
Country-based energy mix
Datacenter WUE
Processors TDP
Other ?
It could be exposed to the user via multiple ways :
Make it available through the public API, and make the OnlineTracker query it periodically
Export a new version of the datasets at each release, for a full offline fallback
Other ?
Both ways would require an ingestion task, which could be automated quite easily.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Could help solving following issues: #894, #513, #503, #435, #403 (with a better support / doc of electricitymaps), #384, #365, #336, #222, #138
https://github.com/Green-Software-Foundation/real-time-cloud/blob/main/Cloud_Region_Metadata.csv is maintained by the Green Software Foundation and contains some of this information for Azure, AWS, and GCP (and I think they are working on Oracle): PUE, WUE, and carbon intensity.
If we want more data than they currently provide, it may be worth talking to them first to see if they would be interested in adding it.
For the United States, the Energy Information Administration (EIA) compiles hourly average emission factors by balancing authority. I was having trouble finding them on the EIA Hourly Electric Grid Monitor (it looks like maybe they were discontinued in 2023), but the data is available from other sources, like GridStatus. I believe GridStatus has an API, so integrating with their data should be doable. The data also includes hourly energy mix and average emission factor by fuel type in case that's helpful.
There are other sources of data for outside the United States that I am less familiar with, such as WattTime for marginal emissions factors and Electricity Maps for average emission factors.
Hi, I'd like to contribute a data source for this. I've built a live UK National Grid ESO Carbon Intensity API integration (national_grid_eso_api.py), following the same pattern as the existing electricitymaps_api.py. It calls the free, public National Grid ESO API (api.carbonintensity.org.uk), preferring the actual measured intensity and falling back to forecast when actual isn't available yet for the current half-hour.
This replaces the current static 2023 annual average for GBR (237.589 gCO2/kWh in global_energy_mix.json) with live, half-hourly data when available, while falling back gracefully to the existing behavior if the API is unreachable or the location isn't GB.
I've wired it into the get_private_infra_emissions fallback chain in emissions.py, positioned after Electricity Maps (which is preferred when a token is configured, since it covers GB too) and before the static country average fallback. Included full unit tests (mocked, following the existing responses-based pattern) plus a skipped integration test for the live API, and verified it against the real live endpoint locally.
Happy to open a PR if this approach looks right to you, or adjust based on any feedback first.
On the question of where to get this data: I publish an open dataset, SOMA AI Emission Factors, under CC BY 4.0 (concept DOI 10.5281/zenodo.20443585). Its cloud_regions.csv maps 143 AWS, Azure and Google Cloud regions to a country grid or US eGRID subregion, each with a confidence flag and a source link.
impact.csv currently has 40 rows, all Google Cloud. Two things could help, both optional. 39 of those 40 rows have a matching region id, so differences would be easy to list as a cross-check. The AWS and Azure mappings could also be a starting point for rows that do not exist yet.
The grid values are Ember 2023 lifecycle intensities, so they would need converting or labelling if CodeCarbon uses another basis. This is separate from the country refresh in #1468, and I am not suggesting replacing that.
I am the author and can send a PR or just a comparison table, whichever you prefer.
Activity
cianc commentedon Oct 27, 2025
https://github.com/Green-Software-Foundation/real-time-cloud/blob/main/Cloud_Region_Metadata.csv is maintained by the Green Software Foundation and contains some of this information for Azure, AWS, and GCP (and I think they are working on Oracle): PUE, WUE, and carbon intensity.
If we want more data than they currently provide, it may be worth talking to them first to see if they would be interested in adding it.
fletchapin commentedon Oct 28, 2025
For the United States, the Energy Information Administration (EIA) compiles hourly average emission factors by balancing authority. I was having trouble finding them on the EIA Hourly Electric Grid Monitor (it looks like maybe they were discontinued in 2023), but the data is available from other sources, like GridStatus. I believe GridStatus has an API, so integrating with their data should be doable. The data also includes hourly energy mix and average emission factor by fuel type in case that's helpful.
There are other sources of data for outside the United States that I am less familiar with, such as WattTime for marginal emissions factors and Electricity Maps for average emission factors.
brendamougang23-cell commentedon Mar 26, 2026
this projet is very good
feat(emissions): add UK National Grid ESO live carbon intensity source
sufirehman commentedon Jun 22, 2026
Hi, I'd like to contribute a data source for this. I've built a live UK National Grid ESO Carbon Intensity API integration (
national_grid_eso_api.py), following the same pattern as the existingelectricitymaps_api.py. It calls the free, public National Grid ESO API (api.carbonintensity.org.uk), preferring theactualmeasured intensity and falling back toforecastwhen actual isn't available yet for the current half-hour.This replaces the current static 2023 annual average for GBR (237.589 gCO2/kWh in
global_energy_mix.json) with live, half-hourly data when available, while falling back gracefully to the existing behavior if the API is unreachable or the location isn't GB.I've wired it into the
get_private_infra_emissionsfallback chain inemissions.py, positioned after Electricity Maps (which is preferred when a token is configured, since it covers GB too) and before the static country average fallback. Included full unit tests (mocked, following the existingresponses-based pattern) plus a skipped integration test for the live API, and verified it against the real live endpoint locally.Happy to open a PR if this approach looks right to you, or adjust based on any feedback first.
feat(emissions): add UK National Grid ESO live carbon intensity source
guillermollopis commentedon Oct 30, 2026
On the question of where to get this data: I publish an open dataset, SOMA AI Emission Factors, under CC BY 4.0 (concept DOI 10.5281/zenodo.20443585). Its cloud_regions.csv maps 143 AWS, Azure and Google Cloud regions to a country grid or US eGRID subregion, each with a confidence flag and a source link.
impact.csv currently has 40 rows, all Google Cloud. Two things could help, both optional. 39 of those 40 rows have a matching region id, so differences would be easy to list as a cross-check. The AWS and Azure mappings could also be a starting point for rows that do not exist yet.
The grid values are Ember 2023 lifecycle intensities, so they would need converting or labelling if CodeCarbon uses another basis. This is separate from the country refresh in #1468, and I am not suggesting replacing that.
I am the author and can send a PR or just a comparison table, whichever you prefer.