Consumption Calculation Steps
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/vehicle_consumptions/{vehicle_consumption_id}/steps', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/vehicle_consumptions/{vehicle_consumption_id}/steps"
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>"
}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://api.dcycle.io/v1/vehicle_consumptions/{vehicle_consumption_id}/steps \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"total_co2e": 123,
"total_energy_kwh": {},
"periods": {},
"periods[].start_date": "<string>",
"periods[].end_date": "<string>",
"periods[].co2e_scope_1": 123,
"periods[].co2e_scope_3": 123,
"periods[].co2e": 123,
"periods[].sources": {},
"periods[].details": {}
}Consumption Calculation Steps
View the detailed emission calculation breakdown for a vehicle consumption
GET
/
v1
/
vehicle_consumptions
/
{vehicle_consumption_id}
/
steps
Consumption Calculation Steps
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/vehicle_consumptions/{vehicle_consumption_id}/steps', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/vehicle_consumptions/{vehicle_consumption_id}/steps"
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>"
}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://api.dcycle.io/v1/vehicle_consumptions/{vehicle_consumption_id}/steps \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"total_co2e": 123,
"total_energy_kwh": {},
"periods": {},
"periods[].start_date": "<string>",
"periods[].end_date": "<string>",
"periods[].co2e_scope_1": 123,
"periods[].co2e_scope_3": 123,
"periods[].co2e": 123,
"periods[].sources": {},
"periods[].details": {}
}← Vehicles API
Retrieve the full calculation chain showing how CO2e emissions were computed for a vehicle consumption record. The response breaks down each conversion step — from raw fuel quantity through emission factors to final CO2e — split by GHG scope and period.
Request
Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faPath Parameters
string
required
UUID of the vehicle consumption record
Response
number
Total CO2 equivalent emissions across all periods (kg)
number | null
Total energy across all periods (kWh)
array[object]
Breakdown by emission factor period
string
Period start date
string
Period end date
number
Scope 1 (direct combustion) emissions in kg CO2e
number
Scope 3 (upstream fuel generation) emissions in kg CO2e
number
Total emissions for this period in kg CO2e
array[object]
Emission factor sources used (name, version, reference year)
array[object]
Detailed conversion steps grouped by scope and category, showing the step-by-step calculation chain (raw value → conversion factor → calculated value)
Example
curl "https://api.dcycle.io/v1/vehicle_consumptions/${CONSUMPTION_ID}/steps" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}"
import requests
import os
response = requests.get(
f"https://api.dcycle.io/v1/vehicle_consumptions/{os.getenv('CONSUMPTION_ID')}/steps",
headers={
"x-api-key": os.getenv("DCYCLE_API_KEY"),
"x-organization-id": os.getenv("DCYCLE_ORG_ID"),
},
)
calc = response.json()
print(f"Total: {calc['total_co2e']} kg CO2e")
for period in calc["periods"]:
print(f" {period['start_date']}–{period['end_date']}: "
f"Scope 1: {period['co2e_scope_1']}, Scope 3: {period['co2e_scope_3']}")
for source in period["sources"]:
print(f" Source: {source['source_name']} {source['source_version']}")
const axios = require('axios');
const response = await axios.get(
`https://api.dcycle.io/v1/vehicle_consumptions/${process.env.CONSUMPTION_ID}/steps`,
{
headers: {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID,
},
}
);
const calc = response.data;
console.log(`Total: ${calc.total_co2e} kg CO2e`);
calc.periods.forEach(p => {
console.log(` ${p.start_date}–${p.end_date}: Scope 1: ${p.co2e_scope_1}, Scope 3: ${p.co2e_scope_3}`);
p.sources.forEach(s => console.log(` Source: ${s.source_name} ${s.source_version}`));
});
Successful Response
{
"total_co2e": 1170.0,
"total_energy_kwh": 4500.0,
"periods": [
{
"start_date": "2025-01-01",
"end_date": "2025-03-31",
"co2e_scope_1": 1053.0,
"co2e_scope_3": 117.0,
"co2e": 1170.0,
"total_energy_kwh": 4500.0,
"sources": [
{
"source_id": "source-uuid",
"source_name": "DEFRA",
"source_version": "2024",
"source_reference_year": 2024,
"scope": 1
}
],
"energy": [
{
"step": 1,
"raw_value": { "value": 450.0, "unit": { "unit_id": "l", "unit_name": "litre" } },
"conversion_factor": { "value": 10.0, "type": "multiplication" },
"calculated_value": { "value": 4500.0, "unit": { "unit_id": "kWh", "unit_name": "kilowatt-hour" } },
"source": { "source_id": "src-uuid", "source_name": "DEFRA", "source_version": "2024" },
"coincidence": "Diesel"
}
],
"details": [
{
"scope": "scope_1",
"category": "transport",
"co2e_from_ch4": [],
"co2e_from_n2o": [],
"co2e_from_co2": [
{
"step": 1,
"raw_value": { "value": 450.0, "unit": { "unit_id": "l", "unit_name": "litre" } },
"conversion_factor": { "value": 2.34, "type": "multiplication" },
"calculated_value": { "value": 1053.0, "unit": { "unit_id": "kgCO2e", "unit_name": "kg CO2e" } },
"source": { "source_id": "src-uuid", "source_name": "DEFRA", "source_version": "2024" },
"coincidence": "Cars - Large - Diesel"
}
],
"co2_biogenic": [],
"co2e": []
}
]
}
]
}
Common Errors
401 Unauthorized
Cause: Missing or invalid API key{"detail": "Invalid API key for organization", "code": "INVALID_API_KEY"}
403 Forbidden
Cause: The authenticated user is not a member of the organization{"detail": "Logged User is not Member of Organization", "code": "LOGGED_USER_NOT_MEMBER"}
404 Not Found
Cause: The vehicle consumption record does not exist or belongs to another organization{"detail": "Not Found"}
Related Endpoints
Get Consumption
View consumption record details
List Consumptions
Browse all consumptions for a vehicle
Was this page helpful?