🆕 New API Available! We're launching a new API architecture. Check out the New API endpoints for improved design and simpler authentication.
JavaScript
const options = { method: 'GET', headers: { 'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>', 'x-user-id': '<x-user-id>' } }; fetch('https://api.dcycle.io/api/v1/custom_emission_factors/list/{id}', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err));
Get paginated list of custom emission factors in a group
sk_live_1234567890abcdef
ff4adcc7-8172-45fe-9cf1-e90a6de53aa9
a1b2c3d4-e5f6-7890-abcd-ef1234567890
{ "page": 1, "size": 50, "total": 15, "items": [ { "id": "factor-uuid", "ef_name": "Recycled Aluminum - Supplier ABC", "unit_id": "kg-unit-uuid", "factor_uploaded_by": "[email protected]", "tag": "advanced", "uncertainty_grade": 15.0, "factor_start_date": "2024-01-01", "factor_end_date": "2024-12-31", "additional_docs": "EPD No. ABC-2024-001", "emission_factor_values": [ {"gas_type": "CO2", "value": 2.15}, {"gas_type": "CH4", "value": 0.008} ], "recycled": true } ] }
import requests import os headers = { "Authorization": f"Bearer {os.getenv('DCYCLE_API_KEY')}", "x-organization-id": os.getenv("DCYCLE_ORG_ID"), "x-user-id": os.getenv("DCYCLE_USER_ID") } group_id = "group-uuid" response = requests.get( f"https://api.dcycle.io/api/v1/custom_emission_factors/list/{group_id}", headers=headers, params={"page": 1, "size": 50} ) factors = response.json() print(f"Total factors: {factors['total']}") for factor in factors['items']: co2_value = next(v['value'] for v in factor['emission_factor_values'] if v['gas_type'] == 'CO2') print(f"- {factor['ef_name']}: {co2_value} kg CO2/{factor['unit_id']}")