Get Hotel Stay
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/hotel-stays/{hotel_stay_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/hotel-stays/{hotel_stay_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/hotel-stays/{hotel_stay_id} \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"id": "<string>",
"organization_id": "<string>",
"name": {},
"check_in_date": "<string>",
"check_out_date": "<string>",
"country": "<string>",
"address": {},
"hotel_name": {},
"rooms": 123,
"status": "<string>",
"source": {},
"co2e": {},
"file_id": {},
"file_name": {},
"created_at": {},
"updated_at": {},
"location_geocode": {
"country_code": "<string>",
"place_id": "<string>",
"address_formatted": "<string>",
"latitude": 123,
"longitude": 123
},
"uploaded_by": {
"id": "<string>",
"first_name": {},
"last_name": {},
"profile_img_url": {}
}
}Get Hotel Stay
Retrieve a specific hotel stay record by ID
GET
/
v1
/
hotel-stays
/
{hotel_stay_id}
Get Hotel Stay
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/hotel-stays/{hotel_stay_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/hotel-stays/{hotel_stay_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/hotel-stays/{hotel_stay_id} \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"id": "<string>",
"organization_id": "<string>",
"name": {},
"check_in_date": "<string>",
"check_out_date": "<string>",
"country": "<string>",
"address": {},
"hotel_name": {},
"rooms": 123,
"status": "<string>",
"source": {},
"co2e": {},
"file_id": {},
"file_name": {},
"created_at": {},
"updated_at": {},
"location_geocode": {
"country_code": "<string>",
"place_id": "<string>",
"address_formatted": "<string>",
"latitude": 123,
"longitude": 123
},
"uploaded_by": {
"id": "<string>",
"first_name": {},
"last_name": {},
"profile_img_url": {}
}
}← Hotel Stays API
Retrieve detailed information about a specific hotel stay record by its unique identifier.
Request
Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faPath Parameters
string
required
The unique identifier (UUID) of the hotel stay recordExample:
550e8400-e29b-41d4-a716-446655440000Response
string
Unique identifier (UUID)
string
Organization UUID this stay belongs to
string | null
Free-text description of the stay
date
Check-in date
date
Check-out date
string
ISO-3166 alpha-2 country code (e.g.
ES, GB, US)string | null
Plain-text address for geocoding
string | null
Hotel name
integer
Number of rooms booked
string
active, pending, or errorstring | null
How the record was created (
manual, bulk_upload, etc.)number | null
Calculated CO2e in kg (sourced from total_impacts, not stored on the record)
string | null
UUID of the source bulk-upload file, if any
string | null
Name of the source file, if any
datetime
Record creation timestamp
datetime | null
Last update timestamp
object | null
object | null
Example
curl -X GET "https://api.dcycle.io/v1/hotel-stays/550e8400-e29b-41d4-a716-446655440000" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}"
import requests
import os
response = requests.get(
"https://api.dcycle.io/v1/hotel-stays/550e8400-e29b-41d4-a716-446655440000",
headers={
"x-api-key": os.getenv("DCYCLE_API_KEY"),
"x-organization-id": os.getenv("DCYCLE_ORG_ID")
}
)
stay = response.json()
print(f"{stay['hotel_name']} ({stay['country']}): {stay['co2e']} kg CO2e")
const axios = require('axios');
axios.get(
'https://api.dcycle.io/v1/hotel-stays/550e8400-e29b-41d4-a716-446655440000',
{
headers: {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID
}
}
)
.then(r => console.log(r.data))
.catch(error => console.error(error));
Successful Response
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"organization_id": "a8315ef3-dd50-43f8-b7ce-d839e68d51fa",
"name": "Team offsite — Madrid",
"check_in_date": "2024-11-04",
"check_out_date": "2024-11-07",
"country": "ES",
"address": "Calle Gran Vía 28, Madrid",
"hotel_name": "Hotel Gran Vía",
"rooms": 3,
"status": "active",
"source": "manual",
"co2e": 18.54,
"file_id": null,
"file_name": null,
"created_at": "2024-11-01T09:00:00Z",
"updated_at": "2024-11-01T09:00:00Z",
"uploaded_by": {
"id": "b9f1e2d3-0000-0000-0000-000000000001",
"first_name": "Ana",
"last_name": "García",
"profile_img_url": null
},
"location_geocode": {
"country_code": "ES",
"place_id": "ChIJgTwKgJcpQg0RaSKMYcHeNsQ",
"address_formatted": "Calle Gran Vía 28, 28013 Madrid, Spain",
"latitude": 40.4203,
"longitude": -3.7059
}
}
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: The hotel stay ID does not exist or belongs to a different organization.{
"detail": "Hotel stay not found",
"code": "HOTEL_STAY_NOT_FOUND"
}
Related Endpoints
List Hotel Stays
Get all hotel stays with filtering
Calculation Steps
Step-by-step CO2e breakdown
Delete Hotel Stay
Remove this record
Was this page helpful?