Compare Carbon Usage
This endpoint allows you to compare carbon quantities to more recognizable items such as cars, light bulbs, or kettles.
Our list of metrics and comparison units are quite extensive so a list of accepted combinations has been compiled and is available here
Body
-
Minimum value is
1
. -
SQUAKE uses The International System of Units (SI), commonly referred to as "metric system".
Values are
tonne
,kilogram
, orgram
. -
You can define one or more metrics you want to compare your carbon quantity to.
POST /v2/carbon-comparison
curl \
-X POST https://api.sandbox.squake.earth/v2/carbon-comparison \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"carbon_quantity":2000,"carbon_unit":"tonne","items":[{"metric":"annual_usage","comparison_unit":"cars"}]}'
Request examples
{
"carbon_quantity": 2000,
"carbon_unit": "tonne",
"items": [
{
"metric": "annual_usage",
"comparison_unit": "cars"
}
]
}
Response examples (200)
# Headers
SQUAKE-Request-Id: string
# Payload
{
"carbon_quantity": 5000,
"carbon_unit": "tonne",
"items": [
{
"comparison_unit": "cars",
"metric": "annual_usage",
"amount": 42.0
}
]
}
Response examples (400)
# Headers
SQUAKE-Request-Id: req_70394c00-728e-4d70-90bc-2b589c9ebdf8
# Payload
[
{
"code": "field_validation_error",
"detail": "string",
"source": {
"id": "string",
"attribute": "string",
"model": "string"
}
}
]