Get Historical Emission
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/historical-emissions/{historical_emission_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/historical-emissions/{historical_emission_id}"
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/historical-emissions/{historical_emission_id} \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"id": "<string>",
"organization_id": "<string>",
"start_date": "<string>",
"end_date": "<string>",
"scope": 123,
"category": "<string>",
"total_co2e": 123,
"description": {},
"ghg_gas": "<string>",
"ghg_type": 123,
"enabled": true,
"file_id": {},
"file_url": {},
"file_name": {},
"source": {},
"source_file_id": {},
"created_at": {},
"updated_at": {}
}Get Historical Emission
Retrieve a single historical emission entry by ID
GET
/
v1
/
historical-emissions
/
{historical_emission_id}
Get Historical Emission
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/historical-emissions/{historical_emission_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/historical-emissions/{historical_emission_id}"
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/historical-emissions/{historical_emission_id} \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"id": "<string>",
"organization_id": "<string>",
"start_date": "<string>",
"end_date": "<string>",
"scope": 123,
"category": "<string>",
"total_co2e": 123,
"description": {},
"ghg_gas": "<string>",
"ghg_type": 123,
"enabled": true,
"file_id": {},
"file_url": {},
"file_name": {},
"source": {},
"source_file_id": {},
"created_at": {},
"updated_at": {}
}← Historical Emissions
Retrieve a single historical emission entry by its UUID: one of your organization or of a company of its group.
Request
Headers
Path Parameters
Response
Returns the historical emission object with HTTP 200.How the entry was created:
manual (the app’s form or this API), bulk_file (a spreadsheet import in the app; source_file_id is that spreadsheet) or estimation (an employee commuting estimation). Null on entries created before 2026-10-23.UUID of the spreadsheet a
bulk_file entry was imported from. Apart from file_id, which is only the evidence attached to the entry. Null on every other entry.Example
curl -X GET "https://api.dcycle.io/v1/historical-emissions/a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}"
import requests
import os
headers = {
"x-api-key": os.getenv("DCYCLE_API_KEY"),
"x-organization-id": os.getenv("DCYCLE_ORG_ID"),
}
emission_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
response = requests.get(
f"https://api.dcycle.io/v1/historical-emissions/{emission_id}",
headers=headers,
)
entry = response.json()
print(f"[{entry['category']}] {entry['start_date']} → {entry['end_date']}: {entry['total_co2e']} kg CO2e")
const axios = require('axios');
const headers = {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID,
};
const id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890';
axios.get(`https://api.dcycle.io/v1/historical-emissions/${id}`, { headers })
.then(response => {
const e = response.data;
console.log(`[${e.category}] ${e.total_co2e} kg CO2e`);
});
Successful Response
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"organization_id": "a8315ef3-dd50-43f8-b7ce-d839e68d51fa",
"start_date": "2023-01-01",
"end_date": "2023-12-31",
"scope": 2,
"category": "electricity",
"total_co2e": 45200.0,
"description": "2023 electricity emissions from utility invoices",
"file_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"file_url": "https://storage.dcycle.io/historical/electricity-2023.pdf",
"file_name": "electricity-2023.pdf",
"ghg_gas": "co2e",
"ghg_type": 0,
"enabled": true,
"created_at": "2024-02-15T10:00:00Z",
"updated_at": null
}
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: Historical emission not found, deleted, or outside your organization and its group{
"detail": "Historical emission not found"
}
Related Endpoints
Update
Modify this entry
Delete
Remove this entry
Was this page helpful?