🆕 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/{id}', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err));
Retrieve detailed information about a specific custom emission factor
sk_live_1234567890abcdef
ff4adcc7-8172-45fe-9cf1-e90a6de53aa9
a1b2c3d4-e5f6-7890-abcd-ef1234567890
"factor-uuid-here"
{ "id": "factor-uuid", "factor_id": "factor-uuid", "ef_name": "Recycled Aluminum - Supplier ABC", "unit_id": "kg-unit-uuid", "unit": { "id": "kg-unit-uuid", "name": "kilogram", "abbreviation": "kg", "type": "mass" }, "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 }, { "gas_type": "N2O", "value": 0.002 } ], "recycled": true, "renewable_percentage": null, "hazardous": null, "low_code": null, "rd_code": null }
curl "https://api.dcycle.io/api/v1/custom_emission_factors/factor-uuid" \ -H "Authorization: Bearer ${DCYCLE_API_KEY}" \ -H "x-organization-id: ${DCYCLE_ORG_ID}" \ -H "x-user-id: ${DCYCLE_USER_ID}"
factor = requests.get( f"https://api.dcycle.io/api/v1/custom_emission_factors/{factor_id}", headers=headers ).json() print(f"Factor: {factor['ef_name']}") print(f"Source: {factor['additional_docs']}") print(f"Uploaded by: {factor['factor_uploaded_by']}") print(f"Valid: {factor['factor_start_date']} to {factor['factor_end_date']}")
const factor = await axios.get( `https://api.dcycle.io/api/v1/custom_emission_factors/${factorId}`, { headers } ).then(res => res.data); // Display in UI document.getElementById('factor-name').textContent = factor.ef_name; document.getElementById('factor-unit').textContent = factor.unit.name; document.getElementById('factor-uncertainty').textContent = `${factor.uncertainty_grade}%`;
{ "detail": "Custom emission factor not found", "code": "NOT_FOUND" }