climatiq.ipynb•67.3 kB
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"# Climatiq notebook examples\n",
"[Climatiq](https://climatiq.io/) provides an API to help you estimate how much greenhouse gasses your activities emit, based on validated conversion factors known as “emission factors.” \n",
"An emission factor is a way to convert different human activities into greenhouse gases.\n",
"It will take that human activity and estimate how much CO2 equivalent (abbreviated CO2e, usually expressed in kilograms), that activity will emit.\n",
"\n",
"Different emission factors can help us answer questions like:\n",
"- How much CO2e is emitted taking the train from Paris to Berlin?\n",
"- How much CO2e is emitted spending $1,000 on soft drinks in the US?\n",
"- How much CO2e is emitted staying a night at a hotel in China?\n",
"\n",
"Climatiq has a wide variety of emission factors available, that you can browse in our [Data Explorer](https://explorer.climatiq.io/), to get a feel for the sort of questions Climatiq can help you answer."
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"# API Key\n",
"All calls to the Climatiq API require that you have an account and that you send your API key. Signing up is free and takes only a few minutes.\n",
"\n",
"[Click here](https://docs.climatiq.io/guides/getting-api-key) to see how to sign up and get your API key, which you should input below."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"ExecuteTime": {
"end_time": "2024-02-06T14:10:43.307090Z",
"start_time": "2024-02-06T14:10:43.295660Z"
},
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"# Read from .env file\n",
"import os\n",
"!{sys.executable} -m pip install python-dotenv\n",
"from dotenv import load_dotenv\n",
"\n",
"# Load environment variables from .env file\n",
"load_dotenv()\n",
"\n",
"# Get API key from environment variable\n",
"MY_API_KEY = os.getenv(\"CLIMATIQ_API_KEY\")"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Collecting requests\n",
" Using cached requests-2.32.3-py3-none-any.whl.metadata (4.6 kB)\n",
"Collecting charset-normalizer<4,>=2 (from requests)\n",
" Downloading charset_normalizer-3.4.1-cp311-cp311-macosx_10_9_universal2.whl.metadata (35 kB)\n",
"Requirement already satisfied: idna<4,>=2.5 in /Users/Jagan/src/climatiq-mcp-server/.venv/lib/python3.11/site-packages (from requests) (3.10)\n",
"Collecting urllib3<3,>=1.21.1 (from requests)\n",
" Downloading urllib3-2.3.0-py3-none-any.whl.metadata (6.5 kB)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /Users/Jagan/src/climatiq-mcp-server/.venv/lib/python3.11/site-packages (from requests) (2025.1.31)\n",
"Using cached requests-2.32.3-py3-none-any.whl (64 kB)\n",
"Downloading charset_normalizer-3.4.1-cp311-cp311-macosx_10_9_universal2.whl (194 kB)\n",
"Downloading urllib3-2.3.0-py3-none-any.whl (128 kB)\n",
"Installing collected packages: urllib3, charset-normalizer, requests\n",
"Successfully installed charset-normalizer-3.4.1 requests-2.32.3 urllib3-2.3.0\n"
]
}
],
"source": [
"# This block installs requests, which is a python library for doing http requests\n",
"# Install requests using pip in the current python kernel\n",
"# See https://jakevdp.github.io/blog/2017/12/05/installing-python-packages-from-jupyter/ for details\n",
"# Note that if you are using conda you might need to uncomment the later line\n",
"import sys\n",
"!{sys.executable} -m pip install requests\n",
"# Delete the above line, and uncomment the below line if you are using conda\n",
"# !conda install --yes --prefix {sys.prefix} numpy\n",
"\n",
"import requests\n",
"import pprint\n",
"import json"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"# Documentation\n",
"This python notebook will mostly focus on some quick examples so you can get a feel for the API.\n",
"If you'd like a little more introduction, check our out [quickstart guide](https://docs.climatiq.io/guides/quickstart)\n",
"\n",
"The notebook is tested using python3.10, but should work in python3.6 and above.\n",
"\n",
"We also won't cover everything the API can do in this notebook, but check out the [API documentation](https://docs.climatiq.io/) for a lot more comprehensive documentation."
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"# Searching\n",
"If you need to figure out which emission factors are available, the easiest way is to try out our [Data Explorer](https://explorer.climatiq.io/) that allows you to search for, and filter emission factors based on sources, regions or free-text searching.\n",
"\n",
"We also have a `search` rendpoint available for searching. It will let you do free-text searching, and optionally filtering on sources, regions etc.\n",
"See how to use it below."
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"ExecuteTime": {
"end_time": "2024-02-06T14:10:45.167147Z",
"start_time": "2024-02-06T14:10:44.715047Z"
},
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"dict_keys(['current_page', 'last_page', 'total_results', 'results', 'possible_filters'])\n"
]
},
{
"data": {
"text/plain": [
"[{'activity_id': 'electricity-supply_grid-source_residual_mix',\n",
" 'id': '27770a3d-b5fa-4d80-895a-a7e9ee4320fe',\n",
" 'name': 'Electricity supplied from grid - residual mix',\n",
" 'category': 'Electricity',\n",
" 'sector': 'Energy',\n",
" 'source': 'GHG Protocol',\n",
" 'source_link': 'https://ghgprotocol.org/sites/default/files/GHG%20Emissions%20Calculation%20Tool_0.xlsx',\n",
" 'source_dataset': 'GHG Emissions Calculation Tool',\n",
" 'uncertainty': None,\n",
" 'year': 2021,\n",
" 'year_released': 2021,\n",
" 'region': 'AT',\n",
" 'region_name': 'Austria',\n",
" 'description': 'Emission intensity of Austria grid mix as reported. Published by the Association of Issuing Bodies (AIB). Retrieved from European Residual Mixes 2018 v1.2 (published July 2019) - Table 2 - Direct GWP (gCO2/kWh). NOTE: this value is provided in CO2 only and does not include the impact of other GHGs. WARNING: The primary source does not report an emission factor for Austria on Table 2 in European Residual Mixes 2018 v1.2. This emission factor is retrieved from European Residual Mixes 2016 v1.2 (published June 2017) - Table 2 - Direct CO2 (gCO2/kWh). We have included this for completeness to retain consistency with the source. NOTE: This dataset has been deprecated by the source.',\n",
" 'unit_type': 'Energy',\n",
" 'unit': 'kg/kWh',\n",
" 'source_lca_activity': 'electricity_generation',\n",
" 'data_quality_flags': ['partial_factor', 'notable_methodological_variance'],\n",
" 'access_type': 'public',\n",
" 'supported_calculation_methods': ['ar4', 'ar5'],\n",
" 'factor': None,\n",
" 'factor_calculation_method': None,\n",
" 'factor_calculation_origin': None,\n",
" 'constituent_gases': {'co2e_total': None,\n",
" 'co2e_other': None,\n",
" 'co2': None,\n",
" 'ch4': None,\n",
" 'n2o': None},\n",
" 'data_version': {'status': 'up_to_date'},\n",
" 'data_version_information': {'status': 'up_to_date'}},\n",
" {'activity_id': 'electricity-supply_grid-source_production_mix',\n",
" 'id': 'a00700d5-eaa5-455f-998d-f1495b09edd8',\n",
" 'name': 'Electricity supplied from grid - production mix',\n",
" 'category': 'Electricity',\n",
" 'sector': 'Energy',\n",
" 'source': 'AIB',\n",
" 'source_link': 'https://www.aib-net.org/facts/european-residual-mix/2016',\n",
" 'source_dataset': 'European Residual Mix',\n",
" 'uncertainty': None,\n",
" 'year': 2016,\n",
" 'year_released': 2017,\n",
" 'region': 'AT',\n",
" 'region_name': 'Austria',\n",
" 'description': 'Emission intensity of production mix as reported. Published by the Association of Issuing Bodies (AIB). Retrieved from 2016 European Residual Mix Report. NOTE: this value is provided in CO2 only and does not include the impact of other GHGs. The source does not clarify if the kgCO2e value is calculated using either IPCC Fourth Assessment Report (AR4) or IPCC Fifth Assessment Report (AR5) methodologies.',\n",
" 'unit_type': 'Energy',\n",
" 'unit': 'kg/kWh',\n",
" 'source_lca_activity': 'electricity_generation',\n",
" 'data_quality_flags': ['partial_factor', 'notable_methodological_variance'],\n",
" 'access_type': 'public',\n",
" 'supported_calculation_methods': ['ar4'],\n",
" 'factor': None,\n",
" 'factor_calculation_method': None,\n",
" 'factor_calculation_origin': None,\n",
" 'constituent_gases': {'co2e_total': None,\n",
" 'co2e_other': None,\n",
" 'co2': None,\n",
" 'ch4': None,\n",
" 'n2o': None},\n",
" 'data_version': {'status': 'up_to_date'},\n",
" 'data_version_information': {'status': 'up_to_date'}},\n",
" {'activity_id': 'electricity-supply_grid-source_production_mix',\n",
" 'id': '5cdacb11-13d0-4faf-9e84-1418fe06221a',\n",
" 'name': 'Electricity supplied from grid - production mix',\n",
" 'category': 'Electricity',\n",
" 'sector': 'Energy',\n",
" 'source': 'AIB',\n",
" 'source_link': 'https://www.aib-net.org/facts/european-residual-mix/2017',\n",
" 'source_dataset': 'European Residual Mix',\n",
" 'uncertainty': None,\n",
" 'year': 2017,\n",
" 'year_released': 2018,\n",
" 'region': 'AT',\n",
" 'region_name': 'Austria',\n",
" 'description': 'Emission intensity of production mix as reported. Published by the Association of Issuing Bodies (AIB). Retrieved from 2017 European Residual Mix Report. NOTE: this value is provided in CO2 only and does not include the impact of other GHGs. The source does not clarify if the kgCO2e value is calculated using either IPCC Fourth Assessment Report (AR4) or IPCC Fifth Assessment Report (AR5) methodologies.',\n",
" 'unit_type': 'Energy',\n",
" 'unit': 'kg/kWh',\n",
" 'source_lca_activity': 'electricity_generation',\n",
" 'data_quality_flags': ['partial_factor', 'notable_methodological_variance'],\n",
" 'access_type': 'public',\n",
" 'supported_calculation_methods': ['ar4'],\n",
" 'factor': None,\n",
" 'factor_calculation_method': None,\n",
" 'factor_calculation_origin': None,\n",
" 'constituent_gases': {'co2e_total': None,\n",
" 'co2e_other': None,\n",
" 'co2': None,\n",
" 'ch4': None,\n",
" 'n2o': None},\n",
" 'data_version': {'status': 'up_to_date'},\n",
" 'data_version_information': {'status': 'up_to_date'}}]"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"url = \"https://api.climatiq.io/data/v1/search\"\n",
"query=\"grid mix\"\n",
"\n",
"query_params = {\n",
" # Free text query can be writen under the query string\n",
" \"query\": query,\n",
" # You can also filter on region, year, source and more\n",
" \"region\": \"AT\",\n",
" # The Climatiq emission factors are versioned.\n",
" # The string below means \"major version 1 compatible\", which means we stay on major version 1 of the data\n",
" # but get new emission factors as they are available\n",
" # Check out the documentation for more information about data versioning\n",
" \"data_version\": \"^1\",\n",
"}\n",
"\n",
"# You must always specify your AUTH token in the \"Authorization\" header like this.\n",
"authorization_headers = {\"Authorization\": f\"Bearer {MY_API_KEY}\"}\n",
"\n",
"\n",
"search_response = requests.get(url, params=query_params, headers=authorization_headers).json()\n",
"# The search endpoint returns a lot of stuff - here are the keys\n",
"print(search_response.keys())\n",
"\n",
"# The most relevant is probably the results - here are the first three results\n",
"search_response[\"results\"][0:3]"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'current_page': 1,\n",
" 'last_page': 3,\n",
" 'total_results': 57,\n",
" 'results': [{'activity_id': 'electricity-supply_grid-source_residual_mix',\n",
" 'id': '27770a3d-b5fa-4d80-895a-a7e9ee4320fe',\n",
" 'name': 'Electricity supplied from grid - residual mix',\n",
" 'category': 'Electricity',\n",
" 'sector': 'Energy',\n",
" 'source': 'GHG Protocol',\n",
" 'source_link': 'https://ghgprotocol.org/sites/default/files/GHG%20Emissions%20Calculation%20Tool_0.xlsx',\n",
" 'source_dataset': 'GHG Emissions Calculation Tool',\n",
" 'uncertainty': None,\n",
" 'year': 2021,\n",
" 'year_released': 2021,\n",
" 'region': 'AT',\n",
" 'region_name': 'Austria',\n",
" 'description': 'Emission intensity of Austria grid mix as reported. Published by the Association of Issuing Bodies (AIB). Retrieved from European Residual Mixes 2018 v1.2 (published July 2019) - Table 2 - Direct GWP (gCO2/kWh). NOTE: this value is provided in CO2 only and does not include the impact of other GHGs. WARNING: The primary source does not report an emission factor for Austria on Table 2 in European Residual Mixes 2018 v1.2. This emission factor is retrieved from European Residual Mixes 2016 v1.2 (published June 2017) - Table 2 - Direct CO2 (gCO2/kWh). We have included this for completeness to retain consistency with the source. NOTE: This dataset has been deprecated by the source.',\n",
" 'unit_type': 'Energy',\n",
" 'unit': 'kg/kWh',\n",
" 'source_lca_activity': 'electricity_generation',\n",
" 'data_quality_flags': ['partial_factor', 'notable_methodological_variance'],\n",
" 'access_type': 'public',\n",
" 'supported_calculation_methods': ['ar4', 'ar5'],\n",
" 'factor': None,\n",
" 'factor_calculation_method': None,\n",
" 'factor_calculation_origin': None,\n",
" 'constituent_gases': {'co2e_total': None,\n",
" 'co2e_other': None,\n",
" 'co2': None,\n",
" 'ch4': None,\n",
" 'n2o': None},\n",
" 'data_version': {'status': 'up_to_date'},\n",
" 'data_version_information': {'status': 'up_to_date'}},\n",
" {'activity_id': 'electricity-supply_grid-source_production_mix',\n",
" 'id': 'a00700d5-eaa5-455f-998d-f1495b09edd8',\n",
" 'name': 'Electricity supplied from grid - production mix',\n",
" 'category': 'Electricity',\n",
" 'sector': 'Energy',\n",
" 'source': 'AIB',\n",
" 'source_link': 'https://www.aib-net.org/facts/european-residual-mix/2016',\n",
" 'source_dataset': 'European Residual Mix',\n",
" 'uncertainty': None,\n",
" 'year': 2016,\n",
" 'year_released': 2017,\n",
" 'region': 'AT',\n",
" 'region_name': 'Austria',\n",
" 'description': 'Emission intensity of production mix as reported. Published by the Association of Issuing Bodies (AIB). Retrieved from 2016 European Residual Mix Report. NOTE: this value is provided in CO2 only and does not include the impact of other GHGs. The source does not clarify if the kgCO2e value is calculated using either IPCC Fourth Assessment Report (AR4) or IPCC Fifth Assessment Report (AR5) methodologies.',\n",
" 'unit_type': 'Energy',\n",
" 'unit': 'kg/kWh',\n",
" 'source_lca_activity': 'electricity_generation',\n",
" 'data_quality_flags': ['partial_factor', 'notable_methodological_variance'],\n",
" 'access_type': 'public',\n",
" 'supported_calculation_methods': ['ar4'],\n",
" 'factor': None,\n",
" 'factor_calculation_method': None,\n",
" 'factor_calculation_origin': None,\n",
" 'constituent_gases': {'co2e_total': None,\n",
" 'co2e_other': None,\n",
" 'co2': None,\n",
" 'ch4': None,\n",
" 'n2o': None},\n",
" 'data_version': {'status': 'up_to_date'},\n",
" 'data_version_information': {'status': 'up_to_date'}},\n",
" {'activity_id': 'electricity-supply_grid-source_production_mix',\n",
" 'id': '5cdacb11-13d0-4faf-9e84-1418fe06221a',\n",
" 'name': 'Electricity supplied from grid - production mix',\n",
" 'category': 'Electricity',\n",
" 'sector': 'Energy',\n",
" 'source': 'AIB',\n",
" 'source_link': 'https://www.aib-net.org/facts/european-residual-mix/2017',\n",
" 'source_dataset': 'European Residual Mix',\n",
" 'uncertainty': None,\n",
" 'year': 2017,\n",
" 'year_released': 2018,\n",
" 'region': 'AT',\n",
" 'region_name': 'Austria',\n",
" 'description': 'Emission intensity of production mix as reported. Published by the Association of Issuing Bodies (AIB). Retrieved from 2017 European Residual Mix Report. NOTE: this value is provided in CO2 only and does not include the impact of other GHGs. The source does not clarify if the kgCO2e value is calculated using either IPCC Fourth Assessment Report (AR4) or IPCC Fifth Assessment Report (AR5) methodologies.',\n",
" 'unit_type': 'Energy',\n",
" 'unit': 'kg/kWh',\n",
" 'source_lca_activity': 'electricity_generation',\n",
" 'data_quality_flags': ['partial_factor', 'notable_methodological_variance'],\n",
" 'access_type': 'public',\n",
" 'supported_calculation_methods': ['ar4'],\n",
" 'factor': None,\n",
" 'factor_calculation_method': None,\n",
" 'factor_calculation_origin': None,\n",
" 'constituent_gases': {'co2e_total': None,\n",
" 'co2e_other': None,\n",
" 'co2': None,\n",
" 'ch4': None,\n",
" 'n2o': None},\n",
" 'data_version': {'status': 'up_to_date'},\n",
" 'data_version_information': {'status': 'up_to_date'}},\n",
" {'activity_id': 'electricity-supply_grid-source_production_mix',\n",
" 'id': '73ea3508-d19f-41f9-8e8b-289e5b7b117c',\n",
" 'name': 'Electricity supplied from grid - production mix',\n",
" 'category': 'Electricity',\n",
" 'sector': 'Energy',\n",
" 'source': 'AIB',\n",
" 'source_link': 'https://www.aib-net.org/facts/european-residual-mix/2018',\n",
" 'source_dataset': 'European Residual Mix',\n",
" 'uncertainty': None,\n",
" 'year': 2018,\n",
" 'year_released': 2019,\n",
" 'region': 'AT',\n",
" 'region_name': 'Austria',\n",
" 'description': 'Emission intensity of production mix as reported. Published by the Association of Issuing Bodies (AIB). Retrieved from 2018 European Residual Mix Report. NOTE: this value is provided in CO2 only and does not include the impact of other GHGs. The source does not clarify if the kgCO2e value is calculated using either IPCC Fourth Assessment Report (AR4) or IPCC Fifth Assessment Report (AR5) methodologies.',\n",
" 'unit_type': 'Energy',\n",
" 'unit': 'kg/kWh',\n",
" 'source_lca_activity': 'electricity_generation',\n",
" 'data_quality_flags': ['partial_factor', 'notable_methodological_variance'],\n",
" 'access_type': 'public',\n",
" 'supported_calculation_methods': ['ar4'],\n",
" 'factor': None,\n",
" 'factor_calculation_method': None,\n",
" 'factor_calculation_origin': None,\n",
" 'constituent_gases': {'co2e_total': None,\n",
" 'co2e_other': None,\n",
" 'co2': None,\n",
" 'ch4': None,\n",
" 'n2o': None},\n",
" 'data_version': {'status': 'up_to_date'},\n",
" 'data_version_information': {'status': 'up_to_date'}},\n",
" {'activity_id': 'electricity-supply_grid-source_production_mix',\n",
" 'id': 'd4ac6219-e7d7-4130-8561-d390a1cb89ec',\n",
" 'name': 'Electricity supplied from grid - production mix',\n",
" 'category': 'Electricity',\n",
" 'sector': 'Energy',\n",
" 'source': 'AIB',\n",
" 'source_link': 'https://www.aib-net.org/facts/european-residual-mix/2019',\n",
" 'source_dataset': 'European Residual Mix',\n",
" 'uncertainty': None,\n",
" 'year': 2019,\n",
" 'year_released': 2020,\n",
" 'region': 'AT',\n",
" 'region_name': 'Austria',\n",
" 'description': 'Emission intensity of production mix as reported. Published by the Association of Issuing Bodies (AIB). Retrieved from 2019 European Residual Mix Report. NOTE: this value is provided in CO2 only and does not include the impact of other GHGs. The source does not clarify if the kgCO2e value is calculated using either IPCC Fourth Assessment Report (AR4) or IPCC Fifth Assessment Report (AR5) methodologies.',\n",
" 'unit_type': 'Energy',\n",
" 'unit': 'kg/kWh',\n",
" 'source_lca_activity': 'electricity_generation',\n",
" 'data_quality_flags': ['partial_factor', 'notable_methodological_variance'],\n",
" 'access_type': 'public',\n",
" 'supported_calculation_methods': ['ar4'],\n",
" 'factor': None,\n",
" 'factor_calculation_method': None,\n",
" 'factor_calculation_origin': None,\n",
" 'constituent_gases': {'co2e_total': None,\n",
" 'co2e_other': None,\n",
" 'co2': None,\n",
" 'ch4': None,\n",
" 'n2o': None},\n",
" 'data_version': {'status': 'up_to_date'},\n",
" 'data_version_information': {'status': 'up_to_date'}},\n",
" {'activity_id': 'electricity-supply_grid-source_production_mix',\n",
" 'id': '1115cac5-7a5b-4e14-a78e-65fcd2e9e077',\n",
" 'name': 'Electricity supplied from grid - production mix',\n",
" 'category': 'Electricity',\n",
" 'sector': 'Energy',\n",
" 'source': 'AIB',\n",
" 'source_link': 'https://www.aib-net.org/facts/european-residual-mix/2020',\n",
" 'source_dataset': 'European Residual Mix',\n",
" 'uncertainty': None,\n",
" 'year': 2020,\n",
" 'year_released': 2021,\n",
" 'region': 'AT',\n",
" 'region_name': 'Austria',\n",
" 'description': 'Emission intensity of production mix as reported. Published by the Association of Issuing Bodies (AIB). Retrieved from 2020 European Residual Mix Report. NOTE: this value is provided in CO2 only and does not include the impact of other GHGs. The source does not clarify if the kgCO2e value is calculated using either IPCC Fourth Assessment Report (AR4) or IPCC Fifth Assessment Report (AR5) methodologies.',\n",
" 'unit_type': 'Energy',\n",
" 'unit': 'kg/kWh',\n",
" 'source_lca_activity': 'electricity_generation',\n",
" 'data_quality_flags': ['partial_factor', 'notable_methodological_variance'],\n",
" 'access_type': 'public',\n",
" 'supported_calculation_methods': ['ar4'],\n",
" 'factor': None,\n",
" 'factor_calculation_method': None,\n",
" 'factor_calculation_origin': None,\n",
" 'constituent_gases': {'co2e_total': None,\n",
" 'co2e_other': None,\n",
" 'co2': None,\n",
" 'ch4': None,\n",
" 'n2o': None},\n",
" 'data_version': {'status': 'up_to_date'},\n",
" 'data_version_information': {'status': 'up_to_date'}},\n",
" {'activity_id': 'electricity-supply_grid-source_production_mix',\n",
" 'id': '2b41f7dc-c27c-4758-8173-cac4b18c361d',\n",
" 'name': 'Electricity supplied from grid - production mix',\n",
" 'category': 'Electricity',\n",
" 'sector': 'Energy',\n",
" 'source': 'AIB',\n",
" 'source_link': 'https://www.aib-net.org/facts/european-residual-mix/2021',\n",
" 'source_dataset': 'European Residual Mix',\n",
" 'uncertainty': None,\n",
" 'year': 2021,\n",
" 'year_released': 2022,\n",
" 'region': 'AT',\n",
" 'region_name': 'Austria',\n",
" 'description': 'Emission intensity of production mix as reported. Published by the Association of Issuing Bodies (AIB). Retrieved from 2021 European Residual Mix Report. NOTE: this value is provided in CO2 only and does not include the impact of other GHGs. The source does not clarify if the kgCO2e value is calculated using either IPCC Fourth Assessment Report (AR4) or IPCC Fifth Assessment Report (AR5) methodologies.',\n",
" 'unit_type': 'Energy',\n",
" 'unit': 'kg/kWh',\n",
" 'source_lca_activity': 'electricity_generation',\n",
" 'data_quality_flags': ['partial_factor', 'notable_methodological_variance'],\n",
" 'access_type': 'public',\n",
" 'supported_calculation_methods': ['ar4'],\n",
" 'factor': None,\n",
" 'factor_calculation_method': None,\n",
" 'factor_calculation_origin': None,\n",
" 'constituent_gases': {'co2e_total': None,\n",
" 'co2e_other': None,\n",
" 'co2': None,\n",
" 'ch4': None,\n",
" 'n2o': None},\n",
" 'data_version': {'status': 'up_to_date'},\n",
" 'data_version_information': {'status': 'up_to_date'}},\n",
" {'activity_id': 'electricity-supply_grid-source_production_mix',\n",
" 'id': '853636b4-b8fd-458c-9a88-64f4f6f2c56e',\n",
" 'name': 'Electricity supplied from grid - production mix',\n",
" 'category': 'Electricity',\n",
" 'sector': 'Energy',\n",
" 'source': 'AIB',\n",
" 'source_link': 'https://www.aib-net.org/facts/european-residual-mix/2022',\n",
" 'source_dataset': 'European Residual Mix',\n",
" 'uncertainty': None,\n",
" 'year': 2022,\n",
" 'year_released': 2023,\n",
" 'region': 'AT',\n",
" 'region_name': 'Austria',\n",
" 'description': 'Emission intensity of production mix as reported. Published by the Association of Issuing Bodies (AIB). Retrieved from 2022 European Residual Mix Report. NOTE: this value is provided in CO2 only and does not include the impact of other GHGs. The source does not clarify if the kgCO2e value is calculated using either IPCC Fourth Assessment Report (AR4) or IPCC Fifth Assessment Report (AR5) methodologies.',\n",
" 'unit_type': 'Energy',\n",
" 'unit': 'kg/kWh',\n",
" 'source_lca_activity': 'electricity_generation',\n",
" 'data_quality_flags': ['partial_factor', 'notable_methodological_variance'],\n",
" 'access_type': 'public',\n",
" 'supported_calculation_methods': ['ar4'],\n",
" 'factor': None,\n",
" 'factor_calculation_method': None,\n",
" 'factor_calculation_origin': None,\n",
" 'constituent_gases': {'co2e_total': None,\n",
" 'co2e_other': None,\n",
" 'co2': None,\n",
" 'ch4': None,\n",
" 'n2o': None},\n",
" 'data_version': {'status': 'up_to_date'},\n",
" 'data_version_information': {'status': 'up_to_date'}},\n",
" {'activity_id': 'electricity-supply_grid-source_production_mix',\n",
" 'id': '522c2e56-9eed-4598-a3d8-5c77a289f813',\n",
" 'name': 'Electricity supplied from grid - production mix',\n",
" 'category': 'Electricity',\n",
" 'sector': 'Energy',\n",
" 'source': 'AIB',\n",
" 'source_link': 'https://www.aib-net.org/facts/european-residual-mix/2023',\n",
" 'source_dataset': 'European Residual Mix',\n",
" 'uncertainty': None,\n",
" 'year': 2023,\n",
" 'year_released': 2024,\n",
" 'region': 'AT',\n",
" 'region_name': 'Austria',\n",
" 'description': 'Emission intensity of production mix as reported. Published by the Association of Issuing Bodies (AIB). Retrieved from 2023 European Residual Mix Report. NOTE: this value is provided in CO2 only and does not include the impact of other GHGs. The source does not clarify if the kgCO2e value is calculated using either IPCC Fourth Assessment Report (AR4) or IPCC Fifth Assessment Report (AR5) methodologies.',\n",
" 'unit_type': 'Energy',\n",
" 'unit': 'kg/kWh',\n",
" 'source_lca_activity': 'electricity_generation',\n",
" 'data_quality_flags': ['partial_factor', 'notable_methodological_variance'],\n",
" 'access_type': 'public',\n",
" 'supported_calculation_methods': ['ar4'],\n",
" 'factor': None,\n",
" 'factor_calculation_method': None,\n",
" 'factor_calculation_origin': None,\n",
" 'constituent_gases': {'co2e_total': None,\n",
" 'co2e_other': None,\n",
" 'co2': None,\n",
" 'ch4': None,\n",
" 'n2o': None},\n",
" 'data_version': {'status': 'up_to_date'},\n",
" 'data_version_information': {'status': 'up_to_date'}},\n",
" {'activity_id': 'electricity-supply_grid-source_residual_mix',\n",
" 'id': 'c1d5d1e3-9186-4009-b8b5-ab5fed60d30a',\n",
" 'name': 'Electricity supplied from grid - residual mix',\n",
" 'category': 'Electricity',\n",
" 'sector': 'Energy',\n",
" 'source': 'AIB',\n",
" 'source_link': 'https://www.aib-net.org/facts/european-residual-mix/2015',\n",
" 'source_dataset': 'European Residual Mix',\n",
" 'uncertainty': None,\n",
" 'year': 2015,\n",
" 'year_released': 2016,\n",
" 'region': 'AT',\n",
" 'region_name': 'Austria',\n",
" 'description': 'Emission intensity of residual mix as reported. Published by the Association of Issuing Bodies (AIB). Retrieved from 2015 European Residual Mix Report. NOTE: this value is provided in CO2 only and does not include the impact of other GHGs. The source does not clarify if the kgCO2e value is calculated using either IPCC Fourth Assessment Report (AR4) or IPCC Fifth Assessment Report (AR5) methodologies.',\n",
" 'unit_type': 'Energy',\n",
" 'unit': 'kg/kWh',\n",
" 'source_lca_activity': 'electricity_generation',\n",
" 'data_quality_flags': ['partial_factor', 'notable_methodological_variance'],\n",
" 'access_type': 'public',\n",
" 'supported_calculation_methods': ['ar4'],\n",
" 'factor': None,\n",
" 'factor_calculation_method': None,\n",
" 'factor_calculation_origin': None,\n",
" 'constituent_gases': {'co2e_total': None,\n",
" 'co2e_other': None,\n",
" 'co2': None,\n",
" 'ch4': None,\n",
" 'n2o': None},\n",
" 'data_version': {'status': 'up_to_date'},\n",
" 'data_version_information': {'status': 'up_to_date'}},\n",
" {'activity_id': 'electricity-supply_grid-source_residual_mix',\n",
" 'id': '66cf6dfd-7186-4725-b53c-b0da97b32319',\n",
" 'name': 'Electricity supplied from grid - residual mix',\n",
" 'category': 'Electricity',\n",
" 'sector': 'Energy',\n",
" 'source': 'AIB',\n",
" 'source_link': 'https://www.aib-net.org/facts/european-residual-mix/2016',\n",
" 'source_dataset': 'European Residual Mix',\n",
" 'uncertainty': None,\n",
" 'year': 2016,\n",
" 'year_released': 2017,\n",
" 'region': 'AT',\n",
" 'region_name': 'Austria',\n",
" 'description': 'Emission intensity of residual mix as reported. Published by the Association of Issuing Bodies (AIB). Retrieved from 2016 European Residual Mix Report. NOTE: this value is provided in CO2 only and does not include the impact of other GHGs. The source does not clarify if the kgCO2e value is calculated using either IPCC Fourth Assessment Report (AR4) or IPCC Fifth Assessment Report (AR5) methodologies.',\n",
" 'unit_type': 'Energy',\n",
" 'unit': 'kg/kWh',\n",
" 'source_lca_activity': 'electricity_generation',\n",
" 'data_quality_flags': ['partial_factor', 'notable_methodological_variance'],\n",
" 'access_type': 'public',\n",
" 'supported_calculation_methods': ['ar4'],\n",
" 'factor': None,\n",
" 'factor_calculation_method': None,\n",
" 'factor_calculation_origin': None,\n",
" 'constituent_gases': {'co2e_total': None,\n",
" 'co2e_other': None,\n",
" 'co2': None,\n",
" 'ch4': None,\n",
" 'n2o': None},\n",
" 'data_version': {'status': 'up_to_date'},\n",
" 'data_version_information': {'status': 'up_to_date'}},\n",
" {'activity_id': 'electricity-supply_grid-source_total_supplier_mix',\n",
" 'id': '45bcf192-516f-42c6-a81e-4887b0346669',\n",
" 'name': 'Electricity supplied from grid - total supplier mix',\n",
" 'category': 'Electricity',\n",
" 'sector': 'Energy',\n",
" 'source': 'AIB',\n",
" 'source_link': 'https://www.aib-net.org/facts/european-residual-mix/2016',\n",
" 'source_dataset': 'European Residual Mix',\n",
" 'uncertainty': None,\n",
" 'year': 2016,\n",
" 'year_released': 2017,\n",
" 'region': 'AT',\n",
" 'region_name': 'Austria',\n",
" 'description': 'Emission intensity of total supplier mix as reported. Published by the Association of Issuing Bodies (AIB). Retrieved from 2016 European Residual Mix Report. NOTE: this value is provided in CO2 only and does not include the impact of other GHGs. The source does not clarify if the kgCO2e value is calculated using either IPCC Fourth Assessment Report (AR4) or IPCC Fifth Assessment Report (AR5) methodologies.',\n",
" 'unit_type': 'Energy',\n",
" 'unit': 'kg/kWh',\n",
" 'source_lca_activity': 'electricity_generation',\n",
" 'data_quality_flags': ['partial_factor', 'notable_methodological_variance'],\n",
" 'access_type': 'public',\n",
" 'supported_calculation_methods': ['ar4'],\n",
" 'factor': None,\n",
" 'factor_calculation_method': None,\n",
" 'factor_calculation_origin': None,\n",
" 'constituent_gases': {'co2e_total': None,\n",
" 'co2e_other': None,\n",
" 'co2': None,\n",
" 'ch4': None,\n",
" 'n2o': None},\n",
" 'data_version': {'status': 'up_to_date'},\n",
" 'data_version_information': {'status': 'up_to_date'}},\n",
" {'activity_id': 'electricity-supply_grid-source_total_supplier_mix',\n",
" 'id': '89615035-8d15-45b8-9171-07cf3e969969',\n",
" 'name': 'Electricity supplied from grid - total supplier mix',\n",
" 'category': 'Electricity',\n",
" 'sector': 'Energy',\n",
" 'source': 'AIB',\n",
" 'source_link': 'https://www.aib-net.org/facts/european-residual-mix/2017',\n",
" 'source_dataset': 'European Residual Mix',\n",
" 'uncertainty': None,\n",
" 'year': 2017,\n",
" 'year_released': 2018,\n",
" 'region': 'AT',\n",
" 'region_name': 'Austria',\n",
" 'description': 'Emission intensity of total supplier mix as reported. Published by the Association of Issuing Bodies (AIB). Retrieved from 2017 European Residual Mix Report. NOTE: this value is provided in CO2 only and does not include the impact of other GHGs. The source does not clarify if the kgCO2e value is calculated using either IPCC Fourth Assessment Report (AR4) or IPCC Fifth Assessment Report (AR5) methodologies.',\n",
" 'unit_type': 'Energy',\n",
" 'unit': 'kg/kWh',\n",
" 'source_lca_activity': 'electricity_generation',\n",
" 'data_quality_flags': ['partial_factor', 'notable_methodological_variance'],\n",
" 'access_type': 'public',\n",
" 'supported_calculation_methods': ['ar4'],\n",
" 'factor': None,\n",
" 'factor_calculation_method': None,\n",
" 'factor_calculation_origin': None,\n",
" 'constituent_gases': {'co2e_total': None,\n",
" 'co2e_other': None,\n",
" 'co2': None,\n",
" 'ch4': None,\n",
" 'n2o': None},\n",
" 'data_version': {'status': 'up_to_date'},\n",
" 'data_version_information': {'status': 'up_to_date'}},\n",
" {'activity_id': 'electricity-supply_grid-source_total_supplier_mix',\n",
" 'id': 'a4d80a2b-081f-44fc-a742-f006bd6285f3',\n",
" 'name': 'Electricity supplied from grid - total supplier mix',\n",
" 'category': 'Electricity',\n",
" 'sector': 'Energy',\n",
" 'source': 'AIB',\n",
" 'source_link': 'https://www.aib-net.org/facts/european-residual-mix/2018',\n",
" 'source_dataset': 'European Residual Mix',\n",
" 'uncertainty': None,\n",
" 'year': 2018,\n",
" 'year_released': 2019,\n",
" 'region': 'AT',\n",
" 'region_name': 'Austria',\n",
" 'description': 'Emission intensity of total supplier mix as reported. Published by the Association of Issuing Bodies (AIB). Retrieved from 2018 European Residual Mix Report. NOTE: this value is provided in CO2 only and does not include the impact of other GHGs. The source does not clarify if the kgCO2e value is calculated using either IPCC Fourth Assessment Report (AR4) or IPCC Fifth Assessment Report (AR5) methodologies.',\n",
" 'unit_type': 'Energy',\n",
" 'unit': 'kg/kWh',\n",
" 'source_lca_activity': 'electricity_generation',\n",
" 'data_quality_flags': ['partial_factor', 'notable_methodological_variance'],\n",
" 'access_type': 'public',\n",
" 'supported_calculation_methods': ['ar4'],\n",
" 'factor': None,\n",
" 'factor_calculation_method': None,\n",
" 'factor_calculation_origin': None,\n",
" 'constituent_gases': {'co2e_total': None,\n",
" 'co2e_other': None,\n",
" 'co2': None,\n",
" 'ch4': None,\n",
" 'n2o': None},\n",
" 'data_version': {'status': 'up_to_date'},\n",
" 'data_version_information': {'status': 'up_to_date'}},\n",
" {'activity_id': 'electricity-supply_grid-source_total_supplier_mix',\n",
" 'id': 'b211c404-b943-42bc-bbbb-cfb2622d7aa4',\n",
" 'name': 'Electricity supplied from grid - total supplier mix',\n",
" 'category': 'Electricity',\n",
" 'sector': 'Energy',\n",
" 'source': 'AIB',\n",
" 'source_link': 'https://www.aib-net.org/facts/european-residual-mix/2019',\n",
" 'source_dataset': 'European Residual Mix',\n",
" 'uncertainty': None,\n",
" 'year': 2019,\n",
" 'year_released': 2020,\n",
" 'region': 'AT',\n",
" 'region_name': 'Austria',\n",
" 'description': 'Emission intensity of total supplier mix as reported. Published by the Association of Issuing Bodies (AIB). Retrieved from 2019 European Residual Mix Report. NOTE: this value is provided in CO2 only and does not include the impact of other GHGs. The source does not clarify if the kgCO2e value is calculated using either IPCC Fourth Assessment Report (AR4) or IPCC Fifth Assessment Report (AR5) methodologies.',\n",
" 'unit_type': 'Energy',\n",
" 'unit': 'kg/kWh',\n",
" 'source_lca_activity': 'electricity_generation',\n",
" 'data_quality_flags': ['partial_factor', 'notable_methodological_variance'],\n",
" 'access_type': 'public',\n",
" 'supported_calculation_methods': ['ar4'],\n",
" 'factor': None,\n",
" 'factor_calculation_method': None,\n",
" 'factor_calculation_origin': None,\n",
" 'constituent_gases': {'co2e_total': None,\n",
" 'co2e_other': None,\n",
" 'co2': None,\n",
" 'ch4': None,\n",
" 'n2o': None},\n",
" 'data_version': {'status': 'up_to_date'},\n",
" 'data_version_information': {'status': 'up_to_date'}},\n",
" {'activity_id': 'electricity-supply_grid-source_total_supplier_mix',\n",
" 'id': '4ed9a1b7-6d2b-4525-a43b-f4cda5a071fc',\n",
" 'name': 'Electricity supplied from grid - total supplier mix',\n",
" 'category': 'Electricity',\n",
" 'sector': 'Energy',\n",
" 'source': 'AIB',\n",
" 'source_link': 'https://www.aib-net.org/facts/european-residual-mix/2020',\n",
" 'source_dataset': 'European Residual Mix',\n",
" 'uncertainty': None,\n",
" 'year': 2020,\n",
" 'year_released': 2021,\n",
" 'region': 'AT',\n",
" 'region_name': 'Austria',\n",
" 'description': 'Emission intensity of total supplier mix as reported. Published by the Association of Issuing Bodies (AIB). Retrieved from 2020 European Residual Mix Report. NOTE: this value is provided in CO2 only and does not include the impact of other GHGs. The source does not clarify if the kgCO2e value is calculated using either IPCC Fourth Assessment Report (AR4) or IPCC Fifth Assessment Report (AR5) methodologies.',\n",
" 'unit_type': 'Energy',\n",
" 'unit': 'kg/kWh',\n",
" 'source_lca_activity': 'electricity_generation',\n",
" 'data_quality_flags': ['partial_factor', 'notable_methodological_variance'],\n",
" 'access_type': 'public',\n",
" 'supported_calculation_methods': ['ar4'],\n",
" 'factor': None,\n",
" 'factor_calculation_method': None,\n",
" 'factor_calculation_origin': None,\n",
" 'constituent_gases': {'co2e_total': None,\n",
" 'co2e_other': None,\n",
" 'co2': None,\n",
" 'ch4': None,\n",
" 'n2o': None},\n",
" 'data_version': {'status': 'up_to_date'},\n",
" 'data_version_information': {'status': 'up_to_date'}},\n",
" {'activity_id': 'electricity-supply_grid-source_total_supplier_mix',\n",
" 'id': 'c549a7e0-1207-49f1-bec0-4955bd928d99',\n",
" 'name': 'Electricity supplied from grid - total supplier mix',\n",
" 'category': 'Electricity',\n",
" 'sector': 'Energy',\n",
" 'source': 'AIB',\n",
" 'source_link': 'https://www.aib-net.org/facts/european-residual-mix/2021',\n",
" 'source_dataset': 'European Residual Mix',\n",
" 'uncertainty': None,\n",
" 'year': 2021,\n",
" 'year_released': 2022,\n",
" 'region': 'AT',\n",
" 'region_name': 'Austria',\n",
" 'description': 'Emission intensity of total supplier mix as reported. Published by the Association of Issuing Bodies (AIB). Retrieved from 2021 European Residual Mix Report. NOTE: this value is provided in CO2 only and does not include the impact of other GHGs. The source does not clarify if the kgCO2e value is calculated using either IPCC Fourth Assessment Report (AR4) or IPCC Fifth Assessment Report (AR5) methodologies.',\n",
" 'unit_type': 'Energy',\n",
" 'unit': 'kg/kWh',\n",
" 'source_lca_activity': 'electricity_generation',\n",
" 'data_quality_flags': ['partial_factor', 'notable_methodological_variance'],\n",
" 'access_type': 'public',\n",
" 'supported_calculation_methods': ['ar4'],\n",
" 'factor': None,\n",
" 'factor_calculation_method': None,\n",
" 'factor_calculation_origin': None,\n",
" 'constituent_gases': {'co2e_total': None,\n",
" 'co2e_other': None,\n",
" 'co2': None,\n",
" 'ch4': None,\n",
" 'n2o': None},\n",
" 'data_version': {'status': 'up_to_date'},\n",
" 'data_version_information': {'status': 'up_to_date'}},\n",
" {'activity_id': 'electricity-supply_grid-source_total_supplier_mix',\n",
" 'id': '8d9eda23-1cd5-43cd-b626-3100b9ce0b57',\n",
" 'name': 'Electricity supplied from grid - total supplier mix',\n",
" 'category': 'Electricity',\n",
" 'sector': 'Energy',\n",
" 'source': 'AIB',\n",
" 'source_link': 'https://www.aib-net.org/facts/european-residual-mix/2022',\n",
" 'source_dataset': 'European Residual Mix',\n",
" 'uncertainty': None,\n",
" 'year': 2022,\n",
" 'year_released': 2023,\n",
" 'region': 'AT',\n",
" 'region_name': 'Austria',\n",
" 'description': 'Emission intensity of total supplier mix as reported. Published by the Association of Issuing Bodies (AIB). Retrieved from 2022 European Residual Mix Report. NOTE: this value is provided in CO2 only and does not include the impact of other GHGs. The source does not clarify if the kgCO2e value is calculated using either IPCC Fourth Assessment Report (AR4) or IPCC Fifth Assessment Report (AR5) methodologies.',\n",
" 'unit_type': 'Energy',\n",
" 'unit': 'kg/kWh',\n",
" 'source_lca_activity': 'electricity_generation',\n",
" 'data_quality_flags': ['partial_factor', 'notable_methodological_variance'],\n",
" 'access_type': 'public',\n",
" 'supported_calculation_methods': ['ar4'],\n",
" 'factor': None,\n",
" 'factor_calculation_method': None,\n",
" 'factor_calculation_origin': None,\n",
" 'constituent_gases': {'co2e_total': None,\n",
" 'co2e_other': None,\n",
" 'co2': None,\n",
" 'ch4': None,\n",
" 'n2o': None},\n",
" 'data_version': {'status': 'up_to_date'},\n",
" 'data_version_information': {'status': 'up_to_date'}},\n",
" {'activity_id': 'electricity-supply_grid-source_total_supplier_mix',\n",
" 'id': '57c7ce44-b56b-44d3-89ed-73ccb4c51b1c',\n",
" 'name': 'Electricity supplied from grid - total supplier mix',\n",
" 'category': 'Electricity',\n",
" 'sector': 'Energy',\n",
" 'source': 'AIB',\n",
" 'source_link': 'https://www.aib-net.org/facts/european-residual-mix/2023',\n",
" 'source_dataset': 'European Residual Mix',\n",
" 'uncertainty': None,\n",
" 'year': 2023,\n",
" 'year_released': 2024,\n",
" 'region': 'AT',\n",
" 'region_name': 'Austria',\n",
" 'description': 'Emission intensity of total supplier mix as reported. Published by the Association of Issuing Bodies (AIB). Retrieved from 2023 European Residual Mix Report. NOTE: this value is provided in CO2 only and does not include the impact of other GHGs. The source does not clarify if the kgCO2e value is calculated using either IPCC Fourth Assessment Report (AR4) or IPCC Fifth Assessment Report (AR5) methodologies.',\n",
" 'unit_type': 'Energy',\n",
" 'unit': 'kg/kWh',\n",
" 'source_lca_activity': 'electricity_generation',\n",
" 'data_quality_flags': ['partial_factor', 'notable_methodological_variance'],\n",
" 'access_type': 'public',\n",
" 'supported_calculation_methods': ['ar4'],\n",
" 'factor': None,\n",
" 'factor_calculation_method': None,\n",
" 'factor_calculation_origin': None,\n",
" 'constituent_gases': {'co2e_total': None,\n",
" 'co2e_other': None,\n",
" 'co2': None,\n",
" 'ch4': None,\n",
" 'n2o': None},\n",
" 'data_version': {'status': 'up_to_date'},\n",
" 'data_version_information': {'status': 'up_to_date'}},\n",
" {'activity_id': 'electricity-supply_grid-source_supplier_mix',\n",
" 'id': 'bc0ba5db-63f8-4be5-b9c2-e2c0fa60a397',\n",
" 'name': 'Electricity supplied from grid',\n",
" 'category': 'Electricity',\n",
" 'sector': 'Energy',\n",
" 'source': 'ADEME',\n",
" 'source_link': 'https://data.ademe.fr/datasets/base-carboner',\n",
" 'source_dataset': 'Base Carbone',\n",
" 'uncertainty': 10,\n",
" 'year': 2017,\n",
" 'year_released': 2021,\n",
" 'region': 'AT',\n",
" 'region_name': 'Austria',\n",
" 'description': 'Emission intensity of grid mix as reported by ADEME. The values include direct emissions from power plants. Cross-border power exchanges are not included. Originally provided by the IEA in 2013. Note that values are reported as CO2e by ADEME and as CO2 by the original source. Retrieved from Base Carbone - Data V20.1.csv.',\n",
" 'unit_type': 'Energy',\n",
" 'unit': 'kg/kWh',\n",
" 'source_lca_activity': 'electricity_generation',\n",
" 'data_quality_flags': ['partial_factor'],\n",
" 'access_type': 'public',\n",
" 'supported_calculation_methods': ['ar4'],\n",
" 'factor': None,\n",
" 'factor_calculation_method': None,\n",
" 'factor_calculation_origin': None,\n",
" 'constituent_gases': {'co2e_total': None,\n",
" 'co2e_other': None,\n",
" 'co2': None,\n",
" 'ch4': None,\n",
" 'n2o': None},\n",
" 'data_version': {'status': 'removed', 'removed_in': '6'},\n",
" 'data_version_information': {'status': 'removed', 'removed_in': 6}}],\n",
" 'possible_filters': {'year': [2023,\n",
" 2022,\n",
" 2021,\n",
" 2020,\n",
" 2019,\n",
" 2018,\n",
" 2017,\n",
" 2016,\n",
" 2015,\n",
" 2014,\n",
" 2013,\n",
" 2012,\n",
" 2011,\n",
" 2010,\n",
" 2009,\n",
" 2008,\n",
" 2007,\n",
" 2006,\n",
" 2005,\n",
" 2004,\n",
" 2003,\n",
" 2002,\n",
" 2001,\n",
" 2000,\n",
" 1999,\n",
" 1998,\n",
" 1997,\n",
" 1996,\n",
" 1995,\n",
" 1994,\n",
" 1993,\n",
" 1992,\n",
" 1991,\n",
" 1990],\n",
" 'source': [{'source': 'ADEME', 'datasets': ['Base Carbone']},\n",
" {'source': 'AIB', 'datasets': ['European Residual Mix']},\n",
" {'source': 'BEIS',\n",
" 'datasets': ['Greenhouse gas reporting: conversion factors 2021']},\n",
" {'source': 'EEA',\n",
" 'datasets': ['Greenhouse gas emission intensity of electricity generation']},\n",
" {'source': 'GHG Protocol',\n",
" 'datasets': ['GHG Emissions Calculation Tool',\n",
" 'Quantis and GHG Protocol Scope 3 Evaluator']}],\n",
" 'region': [{'id': 'AT', 'name': 'Austria'}],\n",
" 'category': ['Electricity'],\n",
" 'sector': ['Energy'],\n",
" 'unit_type': ['Energy'],\n",
" 'source_lca_activity': ['electricity_generation', 'well_to_tank'],\n",
" 'access_type': ['public'],\n",
" 'data_quality_flags': ['partial_factor', 'notable_methodological_variance']}}"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"search_response\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"# Estimates\n",
"Climatiq allows you to perform estimates based on an emission factor. You specify the emission factor using an activity id, and optionally filtering on region, year or other things.\n",
"The following code snippet will make an estimation of how much CO2e the power grid in Austria emits, for a certain amount of power generated. \n",
"We will be using the `/estimate` endpoint. For a more comprehensive documentation about this endpoint, [click here](https://docs.climatiq.io/#estimate)"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"ExecuteTime": {
"end_time": "2024-02-06T14:10:45.279204Z",
"start_time": "2024-02-06T14:10:45.167789Z"
},
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Activity ID: electricity-supply_grid-source_residual_mix\n",
"Region: AT\n",
"Data Version: ^6\n",
"{'activity_data': {'activity_unit': 'kWh', 'activity_value': 100.0},\n",
" 'audit_trail': 'selector',\n",
" 'co2e': 54.59,\n",
" 'co2e_calculation_method': 'ar5',\n",
" 'co2e_calculation_origin': 'source',\n",
" 'co2e_unit': 'kg',\n",
" 'constituent_gases': {'ch4': None,\n",
" 'co2': 54.59,\n",
" 'co2e_other': None,\n",
" 'co2e_total': 54.59,\n",
" 'n2o': None},\n",
" 'emission_factor': {'access_type': 'public',\n",
" 'activity_id': 'electricity-supply_grid-source_residual_mix',\n",
" 'category': 'Electricity',\n",
" 'data_quality_flags': ['partial_factor',\n",
" 'notable_methodological_variance'],\n",
" 'id': '27770a3d-b5fa-4d80-895a-a7e9ee4320fe',\n",
" 'name': 'Electricity supplied from grid - residual mix',\n",
" 'region': 'AT',\n",
" 'source': 'GHG Protocol',\n",
" 'source_dataset': 'GHG Emissions Calculation Tool',\n",
" 'source_lca_activity': 'electricity_generation',\n",
" 'year': 2021},\n",
" 'notices': []}\n"
]
}
],
"source": [
"# The id for the emission factor. Found via the data explorer or the search endpoint\n",
"# In our case, we take the first activity ID from our search above\n",
"activity_id = search_response[\"results\"][0][\"activity_id\"]\n",
"# We have many regions with the same activity id, representing the power grid in different countries.\n",
"# We'd like to get the power for Australia specifically, so we will need to specify a region. We do this by specifying the UN location code for the region\n",
"# You can also see the region for different emission factors in the data explorer\n",
"region = \"AT\"\n",
"\n",
"# We must also specify how much electricity generation we would like to make the estimation for.\n",
"# In this case we will do it for 100kilowattt-hours. \n",
"# Different emission factors have different requirement as to what units they support estimates for\n",
"# You can see the units supported by an emission factor in the data explorer, and find more documentation about units\n",
"# in the API documentation.\n",
"parameters = {\n",
" \"energy\": 100,\n",
" \"energy_unit\": \"kWh\"\n",
" }\n",
"\n",
"data_version = \"^6\"\n",
"print(\"Activity ID: \", activity_id)\n",
"print(\"Region: \", region)\n",
"print(\"Data Version: \", data_version)\n",
"\n",
"json_body = {\n",
" \"emission_factor\": {\n",
" \"activity_id\": activity_id,\n",
" \"region\": region,\n",
" \"data_version\": data_version\n",
" # More filters are possible here. See the full documentation for more options\n",
" },\n",
" # Specify how much energy we're estimating for\n",
" \"parameters\": parameters\n",
"}\n",
"\n",
"# You must always specify your AUTH token in the \"Authorization\" header like this.\n",
"authorization_headers = {\"Authorization\": f\"Bearer {MY_API_KEY}\"}\n",
"\n",
"# We send a POST request to the estimate endpoint with a json body and the correct authorization headers\n",
"response = requests.post(\"https://api.climatiq.io/data/v1/estimate\", json=json_body, headers=authorization_headers)\n",
"# The response is also json.\n",
"pprint.pprint(response.json())\n",
"\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"# Estimate response\n",
"As you can see above, the estimate response is a JSON response that consists of three parts:\n",
"- The outermost part, which is the emissions for your estimation\n",
"- The `constituent_gases` which is additional information the source provides (if any) about what other greenhouse gases are emitted. You shouldn't worry too much about this field unless you know you need this.\n",
"- The `emission_factor`, which is Climatiq specifying what emission factor was used. You can see that the `id` and the `region` matches what we specified in our API call.\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"# Batch estimate\n",
"The Climatiq API is very fast, but if you have a lot of data it might be problematic to make an API call for every estimation. Climatiq has a batch endpoint where you can make up to 100 estimations per API call.\n",
"It will return a result for each estimation in the same order that the estimates were sent.\n",
"[More details about the batch estimate endpoint here](https://docs.climatiq.io/#batch-estimations)\n",
"\n",
"Below we will make three estimations with the same emission factor, but different energy amounts"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"ExecuteTime": {
"end_time": "2024-02-06T14:10:45.400928Z",
"start_time": "2024-02-06T14:10:45.280519Z"
},
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"data": {
"text/plain": [
"{'results': [{'co2e': 5.459,\n",
" 'co2e_unit': 'kg',\n",
" 'co2e_calculation_method': 'ar5',\n",
" 'co2e_calculation_origin': 'source',\n",
" 'emission_factor': {'name': 'Electricity supplied from grid - residual mix',\n",
" 'activity_id': 'electricity-supply_grid-source_residual_mix',\n",
" 'id': '27770a3d-b5fa-4d80-895a-a7e9ee4320fe',\n",
" 'access_type': 'public',\n",
" 'source': 'GHG Protocol',\n",
" 'source_dataset': 'GHG Emissions Calculation Tool',\n",
" 'year': 2021,\n",
" 'region': 'AT',\n",
" 'category': 'Electricity',\n",
" 'source_lca_activity': 'electricity_generation',\n",
" 'data_quality_flags': ['partial_factor',\n",
" 'notable_methodological_variance']},\n",
" 'constituent_gases': {'co2e_total': 5.459,\n",
" 'co2e_other': None,\n",
" 'co2': 5.459,\n",
" 'ch4': None,\n",
" 'n2o': None},\n",
" 'activity_data': {'activity_value': 10.0, 'activity_unit': 'kWh'},\n",
" 'audit_trail': 'selector',\n",
" 'notices': []},\n",
" {'co2e': 54.59,\n",
" 'co2e_unit': 'kg',\n",
" 'co2e_calculation_method': 'ar5',\n",
" 'co2e_calculation_origin': 'source',\n",
" 'emission_factor': {'name': 'Electricity supplied from grid - residual mix',\n",
" 'activity_id': 'electricity-supply_grid-source_residual_mix',\n",
" 'id': '27770a3d-b5fa-4d80-895a-a7e9ee4320fe',\n",
" 'access_type': 'public',\n",
" 'source': 'GHG Protocol',\n",
" 'source_dataset': 'GHG Emissions Calculation Tool',\n",
" 'year': 2021,\n",
" 'region': 'AT',\n",
" 'category': 'Electricity',\n",
" 'source_lca_activity': 'electricity_generation',\n",
" 'data_quality_flags': ['partial_factor',\n",
" 'notable_methodological_variance']},\n",
" 'constituent_gases': {'co2e_total': 54.59,\n",
" 'co2e_other': None,\n",
" 'co2': 54.59,\n",
" 'ch4': None,\n",
" 'n2o': None},\n",
" 'activity_data': {'activity_value': 100.0, 'activity_unit': 'kWh'},\n",
" 'audit_trail': 'selector',\n",
" 'notices': []}]}"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"parameters = {\n",
" \"energy\": 100,\n",
" \"energy_unit\": \"kWh\"\n",
" }\n",
"\n",
"# Notice that the JSON body here is an array, with each entry being an estimate\n",
"json_body = [\n",
"{\n",
" \"emission_factor\": {\n",
" # Using the same activity ID and region as before\n",
" \"activity_id\": activity_id,\n",
" \"region\": region,\n",
" \"data_version\": \"^1\"\n",
" },\n",
" \"parameters\": {\n",
" \"energy\": 10,\n",
" \"energy_unit\": \"kWh\"\n",
" }\n",
"},\n",
"{\n",
" \"emission_factor\": {\n",
" # Using the same activity ID and region as before\n",
" \"activity_id\": activity_id,\n",
" \"region\": region,\n",
" \"data_version\": \"^1\"\n",
" },\n",
" \"parameters\": {\n",
" \"energy\": 100,\n",
" \"energy_unit\": \"kWh\"\n",
" }\n",
"}\n",
"]\n",
"\n",
"# You must always specify your AUTH token in the \"Authorization\" header like this.\n",
"authorization_headers = {\"Authorization\": f\"Bearer {MY_API_KEY}\"}\n",
"\n",
"# We send a POST request to the /batch endpoint with a json body and the correct authorization headers\n",
"response = requests.post(\"https://api.climatiq.io/data/v1/estimate/batch\", json=json_body, headers=authorization_headers)\n",
"# The response is also json.\n",
"response.json()\n",
"\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# Industry classification estimate\n",
"\n",
"If your data comes with an industry specification code Climatiq API allows you to query emission factors, based on their NACE, MCC or UNSPSC industry classification codes. At the moment this endpoint works only with spend-based dataset- EXIOBASE.\n",
"[More details about the industry classification estimate endpoint here](https://www.climatiq.io/docs#classifications) \n",
"\n",
"**Note that access to this feature requires a special subscription**"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'error': 'forbidden',\n",
" 'error_code': None,\n",
" 'message': 'Your authentication is valid, but you do not have access to this '\n",
" 'feature. Contact Climatiq for access.'}\n",
"Pandas not installed, won't try to create dataframe\n"
]
}
],
"source": [
"url = \"https://api.climatiq.io/classifications/v1/estimate\"\n",
"\n",
"data = {\n",
" \"classification\": {\n",
" \"classification_type\": \"nace2\", # here add your classification type, at the momement it will be either nace2, isic4, mcc or unspsc\n",
" \"classification_code\": \"1.11\", # here add a code from your classification, e.g. for nace2 1.11 you would add 1.11 - note that the value has to be a string\n",
" \"source\": \"EXIOBASE\", # choose the desired source - at them momement, only EXIOBASE and GHG Protocol data are mapped to the industry classification codes\n",
" # You can also filter by year, region etc, like with regular selectors\n",
" },\n",
" \"parameters\": {\n",
" \"money\": 3000, # provide amount of money spend on the specific activity\n",
" \"money_unit\": \"usd\" # choose currency, currently we support more than 30 currencies - please check the documentation\n",
" }\n",
"}\n",
"response = requests.post(url,headers=authorization_headers,json=data) # this establishes connection to the API\n",
"response_data = json.loads(response.text) # this line queries the data\n",
"\n",
"pprint.pprint(response_data)\n",
"\n",
"try:\n",
" # You could create a pandas dataframe out of the API response if you have pandas installed\n",
" import pandas as pd\n",
" pd.json_normalize(response_data) # you could create a pandas library dataframe out of the API response \n",
"except ImportError:\n",
" print(\"Pandas not installed, won't try to create dataframe\") # Pandas is a heavy dependency, so if you don't already have it, we won't install it.\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"# Moving on\n",
"Climatiq has much more to offer, such as:\n",
"- Over 12.000 emission factors covering purchsaes, fuel, accomodation, different travel modes, waste processing [and more](https://docs.climatiq.io/#examples).\n",
"- Estimating based on [flight routes](https://docs.climatiq.io/#flights)\n",
"- Estimating the emissions of [cloud compute usage](https://docs.climatiq.io/#cloud-computing)\n",
"- Estimating by using industry classification codes such as ISIC or NAICS"
]
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.9"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}