Calculate Hotel Emissions
<span class="api-method api-method-get">GET</span> /v1/hotel/emissions
Calculate CO2e emissions for a hotel stay based on country-specific factors.
Request
Required Parameters
| Parameter |
Type |
Description |
country |
string |
Country code (ISO 3166-1 alpha-2, e.g., GB) |
nights |
integer |
Number of nights (1-365) |
Optional Parameters
| Parameter |
Type |
Default |
Description |
rooms |
integer |
1 |
Number of rooms (1-100) |
equivalents |
boolean |
false |
Include real-world equivalents |
Response
{
"data": {
"type": "hotel_emission",
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"attributes": {
"emissions": {
"co2e": 94.5,
"co2e_unit": "kg",
"co2e_calculation_method": "ipcc_ar6_gwp100",
"co2e_grams": 94500,
"per_night_kg": 31.5,
"per_night_g": 31500,
"per_room_night_kg": 31.5,
"per_room_night_g": 31500,
"breakdown": {
"energy": 75.6,
"water": 9.45,
"waste": 9.45
},
"equivalents": {
"trees_yearly": {
"value": 4.5,
"label": "trees needed to absorb this CO2 in a year"
},
"driving_km": {
"value": 556.2,
"label": "km driven in an average car"
}
},
"source_trail": [
{
"data_category": "emission_factor",
"name": "Hotel stay - United Kingdom",
"source": "DEFRA",
"source_dataset": "Greenhouse gas reporting: conversion factors 2025",
"original_data": "Cornell Hotel Sustainability Benchmarking Index",
"year": "2025",
"region": "GB",
"region_name": "United Kingdom"
}
]
},
"stay": {
"country_code": "GB",
"country_name": "United Kingdom",
"nights": 3,
"rooms": 1,
"total_room_nights": 3
},
"factor": {
"value": 31.5,
"unit": "kg CO2e per room per night",
"is_estimate": false,
"region": "Western Europe"
},
"notices": []
}
},
"meta": {
"methodology": "DEFRA 2025 / Cornell CHSB Index",
"emission_factors_year": 2025,
"standards_compliance": {
"GHG_Protocol": "Scope 3 Category 6 (Business Travel)"
},
"calculated_at": "2026-02-07T14:30:00Z"
}
}
Response Fields
emissions
| Field |
Type |
Description |
co2e |
number |
Total CO2 equivalent in kg |
co2e_unit |
string |
Always kg |
co2e_grams |
number |
Total CO2 equivalent in grams |
per_night_kg |
number |
Emissions per night (total) |
per_night_g |
number |
Emissions per night in grams |
per_room_night_kg |
number |
Emissions per room per night |
per_room_night_g |
number |
Emissions per room per night in grams |
breakdown |
object |
Emissions by category |
source_trail |
array |
Audit trail of factors used |
stay
| Field |
Type |
Description |
country_code |
string |
ISO country code |
country_name |
string |
Full country name |
nights |
integer |
Number of nights |
rooms |
integer |
Number of rooms |
total_room_nights |
integer |
nights x rooms |
factor
| Field |
Type |
Description |
value |
number |
Emission factor used |
unit |
string |
Always kg CO2e per room per night |
is_estimate |
boolean |
true if using regional average |
region |
string |
Geographic region |
notices
When using regional estimates, a notice is included:
{
"notices": [
{
"message": "Using Middle East regional average for United Arab Emirates. Country-specific data not available.",
"code": "regional_estimate",
"severity": "info"
}
]
}
Examples
Basic Stay
curl "https://api.emissions.dev/v1/hotel/emissions?\
country=GB&\
nights=3" \
-H "Authorization: Bearer em_live_xxxx"
Multiple Rooms
curl "https://api.emissions.dev/v1/hotel/emissions?\
country=US&\
nights=5&\
rooms=10" \
-H "Authorization: Bearer em_live_xxxx"
Week-long Holiday
curl "https://api.emissions.dev/v1/hotel/emissions?\
country=ES&\
nights=7&\
rooms=1&\
equivalents=true" \
-H "Authorization: Bearer em_live_xxxx"
Conference Booking
curl "https://api.emissions.dev/v1/hotel/emissions?\
country=DE&\
nights=3&\
rooms=50" \
-H "Authorization: Bearer em_live_xxxx"
Code Examples
JavaScript
const response = await fetch(
'https://api.emissions.dev/v1/hotel/emissions?' + new URLSearchParams({
country: 'GB',
nights: 3,
rooms: 1
}),
{
headers: {
'Authorization': `Bearer ${process.env.EMISSIONS_API_KEY}`
}
}
);
const data = await response.json();
const emissions = data.data.attributes.emissions;
console.log(`Total: ${emissions.co2e} kg CO2e`);
console.log(`Per night: ${emissions.per_room_night_kg} kg CO2e`);
Python
import requests
response = requests.get(
'https://api.emissions.dev/v1/hotel/emissions',
params={
'country': 'GB',
'nights': 3,
'rooms': 1
},
headers={
'Authorization': f'Bearer {api_key}'
}
)
data = response.json()
emissions = data['data']['attributes']['emissions']
print(f"Total: {emissions['co2e']} kg CO2e")
print(f"Per night: {emissions['per_room_night_kg']} kg CO2e")
PHP
$response = Http::withToken($apiKey)
->get('https://api.emissions.dev/v1/hotel/emissions', [
'country' => 'GB',
'nights' => 3,
'rooms' => 1,
]);
$data = $response->json();
$emissions = $data['data']['attributes']['emissions'];
echo "Total: {$emissions['co2e']} kg CO2e\n";
echo "Per night: {$emissions['per_room_night_kg']} kg CO2e\n";
Complete Trip Emissions
Combine with the Travel API for full business trip emissions. Both endpoints report GHG Protocol Scope 3 Category 6.
// Complete trip: London → Dubai, 4 nights
const [travel, hotel] = await Promise.all([
fetch('https://api.emissions.dev/v1/travel/emissions?' + new URLSearchParams({
origin_country: 'GB',
origin_location: 'London',
destination_country: 'AE',
destination_location: 'Dubai',
transport_mode: 'flight',
return_trip: true
}), { headers: { 'Authorization': `Bearer ${apiKey}` } }),
fetch('https://api.emissions.dev/v1/hotel/emissions?' + new URLSearchParams({
country: 'AE',
nights: 4
}), { headers: { 'Authorization': `Bearer ${apiKey}` } })
]);
const t = (await travel.json()).data.attributes.emissions;
const h = (await hotel.json()).data.attributes.emissions;
// Flights: 1,247 kg + Hotel: 290 kg = Total: 1,537 kg
console.log(`Total trip: ${t.co2e + h.co2e} kg CO2e`);
Errors
Invalid Country
{
"error": {
"code": "invalid_country",
"message": "Country code 'XX' not recognised. Use ISO 3166-1 alpha-2 codes (e.g., GB, US, FR).",
"status": 422
}
}
Invalid Nights
{
"error": {
"code": "validation_error",
"message": "The nights field must be between 1 and 365.",
"field": "nights",
"status": 422
}
}
Too Many Rooms
{
"error": {
"code": "validation_error",
"message": "The rooms field must not be greater than 100.",
"field": "rooms",
"status": 422
}
}