List Historical Emissions
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/', 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/"
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/ \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"items": {
"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,
"co2e": {},
"file_id": {},
"created_at": {},
"updated_at": {}
},
"total": 123
}List Historical Emissions
Get all historical emission entries for your organization
GET
/
v1
/
historical-emissions
/
List Historical Emissions
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/', 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/"
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/ \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"items": {
"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,
"co2e": {},
"file_id": {},
"created_at": {},
"updated_at": {}
},
"total": 123
}← Historical Emissions
Retrieve all historical emission entries for your organization, including the calculated CO2e from total impacts when available.
Request
Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faResponse
array[object]
List of historical emission entries
Show Historical Emission Object
Show Historical Emission Object
string
UUID of the entry
string
Organization UUID
date
Start date (ISO 8601)
date
End date (ISO 8601)
integer
GHG scope (1, 2, or 3) — derived from category
string
Emission category (e.g.
electricity, transport)number
Total CO2e in kilograms
string | null
Free text description
string
GHG gas type
integer
0 = fossil, 1 = biomass
boolean
Whether this entry is enabled
number | null
Calculated CO2e from total impacts (null if not yet calculated)
string | null
UUID of attached evidence file
datetime
Creation timestamp
string | null
Last update timestamp
integer
Total number of entries
Example
curl -X GET "https://api.dcycle.io/v1/historical-emissions/" \
-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"),
}
response = requests.get(
"https://api.dcycle.io/v1/historical-emissions/",
headers=headers,
)
data = response.json()
print(f"Total entries: {data['total']}")
for item in data["items"]:
print(f" [{item['category']}] {item['start_date']} → {item['end_date']}: {item['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,
};
axios.get('https://api.dcycle.io/v1/historical-emissions/', { headers })
.then(response => {
const { items, total } = response.data;
console.log(`Total: ${total}`);
items.forEach(i => console.log(` [${i.category}] ${i.total_co2e} kg CO2e`));
});
Successful Response
{
"items": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"organization_id": "a8315ef3-dd50-43f8-b7ce-d839e68d51fa",
"start_date": "2022-01-01",
"end_date": "2022-12-31",
"scope": 2,
"category": "electricity",
"total_co2e": 45200.5,
"description": "2022 electricity consumption from utility bills",
"ghg_gas": "co2e",
"ghg_type": 0,
"enabled": true,
"co2e": 45200.5,
"file_id": null,
"file_url": null,
"file_name": null,
"created_at": "2024-03-15T10:30:00Z",
"updated_at": null
}
],
"total": 1
}
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"}
Related Endpoints
This endpoint takes no query parameters and is not paginated: it returns every historical
emission recorded for the organization in
x-organization-id.Create
Add a new historical emission entry
Emissions Summary
View calculated emissions across all sources
Was this page helpful?