Skip to main content
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));
{
  "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

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

x-api-key
string
required
Your API key for authenticationExample: sk_live_1234567890abcdef
x-organization-id
string
required
Your organization UUIDExample: a8315ef3-dd50-43f8-b7ce-d839e68d51fa

Path Parameters

vehicle_consumption_id
string
required
UUID of the vehicle consumption record

Response

total_co2e
number
Total CO2 equivalent emissions across all periods (kg)
total_energy_kwh
number | null
Total energy across all periods (kWh)
periods
array[object]
Breakdown by emission factor period
periods[].start_date
string
Period start date
periods[].end_date
string
Period end date
periods[].co2e_scope_1
number
Scope 1 (direct combustion) emissions in kg CO2e
periods[].co2e_scope_3
number
Scope 3 (upstream fuel generation) emissions in kg CO2e
periods[].co2e
number
Total emissions for this period in kg CO2e
periods[].sources
array[object]
Emission factor sources used (name, version, reference year)
periods[].details
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}"

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"}

Get Consumption

View consumption record details

List Consumptions

Browse all consumptions for a vehicle