Travel
Calculate the carbon emissions of a whole journey, such as flights, car rides and hotel stays, in a single request.
From flights and car rentals to accommodation, each step of a journey leaves an environmental footprint. SQUAKE calculates carbon emissions across travel-related activities, whether you fly internationally, rent a car, stay at a hotel or take a ferry. Knowing the emissions of each activity brings transparency and encourages travelers to offset their emissions or choose greener alternatives.
Perform a calculation
POST /v2/calculations requires bearer authentication. It calculates carbon emissions for one or more activities. For example, to compute the footprint of a journey with a return flight, two cab rides and a hotel stay, pass all activities in the items array. Include "items" in the expand array to get the emissions for each item in addition to the total carbon quantity.
For multi-leg flight items that use routing instead of origin and destination, you can also include "legs" in expand to get per-leg emissions and distances on the flight item. See Flight: Routing (multi-leg).
No calculation IDs
This is a low-latency endpoint. SQUAKE doesn't return a unique identifier for calculation results through it. To buy compensation for your carbon emissions, quote a price on the pricing endpoint.
Some data sets are extensive and are documented separately.
Request body
The body is application/json.
expandarray[string]items, legs, or both. With items, SQUAKE returns emissions for each item separately, in addition to a total value. legs adds a per-leg breakdown for flight items that use routing (multi-leg itineraries); use it with routed flights when you need leg-level detail. See Flight: Routing (multi-leg).
carbon_unitstringtonne, kilogram or gram. SQUAKE uses the International System of Units (SI), commonly called the metric system.
distance_unitstringmeter, kilometer, feet, mile or nautical_mile. Defaults to kilometer.
POST /v2/calculations in the API referenceSample request
{
"expand": ["items"],
"carbon_unit": "tonne",
"distance_unit": "kilometer",
"items": [
{
"type": "car",
"methodology": "ACRISS",
"external_reference": "Taxi",
"origin": "Alexanderplatz, Berlin, Germany",
"destination": "Berlin Brandenburg Airport, Schönefeld, Brandenburg, Germany",
"fuel_type": "diesel",
"acriss_car_type": "C"
},
{
"type": "flight",
"methodology": "TIM",
"origin": "BER",
"destination": "LHR",
"number_of_travelers": 1,
"booking_class": "business",
"airline": "BA",
"flight_number": "BA995",
"external_reference": "Flight"
},
{
"type": "car",
"methodology": "ACRISS",
"external_reference": "Taxi",
"origin": "Hounslow TW6 1QG, United Kingdom",
"destination": "150 Piccadilly, St. James's, London W1J 9BR, United Kingdom",
"fuel_type": "petrol",
"acriss_car_type": "S"
},
{
"type": "hotel",
"methodology": "HCMI",
"external_reference": "Hotel",
"country": "GB",
"city": "London",
"stars": 5,
"hcmi_member": false,
"number_of_nights": 3
},
{
"type": "car",
"methodology": "ACRISS",
"external_reference": "Taxi",
"origin": "150 Piccadilly, St. James's, London W1J 9BR, United Kingdom",
"destination": "Horley, Gatwick RH6 0NP, United Kingdom",
"fuel_type": "hev",
"acriss_car_type": "D"
},
{
"type": "flight",
"methodology": "TIM",
"origin": "LGW",
"destination": "BER",
"number_of_travelers": 1,
"booking_class": "business",
"airline": "U2",
"flight_number": "U28629",
"external_reference": "Flight"
},
{
"type": "car",
"methodology": "ACRISS",
"external_reference": "Taxi",
"origin": "Berlin Brandenburg Airport, Schönefeld, Brandenburg, Germany",
"destination": "Alexanderplatz, Berlin, Germany",
"fuel_type": "EV",
"acriss_car_type": "G"
}
]
}Sample response
{
"carbon_quantity": 0.525911,
"carbon_unit": "tonne",
"items": [
{
"carbon_quantity": 0.002928,
"carbon_unit": "tonne",
"external_reference": "Taxi",
"type": "car",
"methodology": "ACRISS",
"distance": 24.0,
"distance_unit": "kilometer"
},
{
"carbon_quantity": 0.181885,
"carbon_unit": "tonne",
"external_reference": "Flight",
"type": "flight",
"methodology": "TIM",
"distance": 1065.0,
"distance_unit": "kilometer"
},
{
"carbon_quantity": 0.004396,
"carbon_unit": "tonne",
"external_reference": "Taxi",
"type": "car",
"methodology": "ACRISS",
"distance": 28.0,
"distance_unit": "kilometer"
},
{
"carbon_quantity": 0.175022,
"carbon_unit": "tonne",
"external_reference": "Hotel",
"type": "hotel",
"methodology": "HCMI"
},
{
"carbon_quantity": 0.005292,
"carbon_unit": "tonne",
"external_reference": "Taxi",
"type": "car",
"methodology": "ACRISS",
"distance": 49.0,
"distance_unit": "kilometer"
},
{
"carbon_quantity": 0.156388,
"carbon_unit": "tonne",
"external_reference": "Flight",
"type": "flight",
"methodology": "TIM",
"distance": 1054.0,
"distance_unit": "kilometer"
},
{
"carbon_quantity": 0.0,
"carbon_unit": "tonne",
"external_reference": "Taxi",
"type": "car",
"methodology": "ACRISS",
"distance": 24.0,
"distance_unit": "kilometer"
}
]
}