Hotel Rooms API
Extract comprehensive room details with photos, amenities, and configurations from Booking.com hotels.
Overview
Complete Room Information
Get detailed room types, photos, sizes, bed configurations, and amenities for any Booking.com hotel.
The Hotel Rooms endpoint provides comprehensive room information including names, descriptions, photos, sizes, bed configurations, and facilities for all room types available at a hotel.
Endpoint URL
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| url | string | Required | Full Booking.com hotel URL (https://www.booking.com/hotel/{cc}/{slug}.html) |
| adults | integer | Optional | Number of adults (1-30, default: 2) |
| children | integer | Optional | Number of children (0-10, default: 0) |
| rooms | integer | Optional | Number of rooms (1-8, default: 1) |
Response Structure
Room Information
room_id- Unique room identifiername- Room type namedescription- Detailed room descriptionphotos- Array of room photos with URLssize_sqm- Room size in square metersmax_occupancy- Maximum number of guests
Bed Configuration
- Bed types and counts
- Alternative bed arrangements
- Extra bed availability
Room Facilities
- Private facilities (bathroom, balcony, etc.)
- In-room amenities
- Entertainment options
- Special features
Best Practices
Guest Configuration
Specify the correct number of adults and children to get accurate room availability and configurations.
Implementation Tips
- Cache room data as it doesn't change frequently
- Use room photos for visual room selection interfaces
- Display bed configurations clearly for guest clarity
- Highlight key facilities that matter to guests
Error handling and status codes
Status codes: 200 on success; errors use non-2xx (400, 404, 500, 502, 503, 504) with Problem Details.
- 400
INVALID_URL: Input validation failed (requires full canonical URL). - 404 Not Found: Upstream indicates the hotel is missing.
- 502
UPSTREAM_ERROR: Upstream non-2xx or GraphQL errors. - 503 Service Unavailable: Upstream rate-limited/maintenance (may include
Retry-After). - 504 Upstream Timeout: The provider timed out.
- 500
CONTENT_EXTRACTION_FAILEDorINTERNAL_ERROR: Unexpected parsing/processing errors.
Error responses (Problem Details)
All Booking.com hotel endpoints return errors using RFC 7807 Problem Details.
{
"type": "https://api.stayapi.com/errors/invalid-url",
"title": "Invalid URL",
"status": 400,
"detail": "Parameter 'url' must be a full Booking.com hotel URL of the form https://www.booking.com/hotel/{cc}/{slug}.html.",
"error_code": "INVALID_URL",
"provided": "baan-coconut"
}
Media type: application/problem+json
Standard fields: type, title, status, detail
Extensions: error_code and any endpoint-specific fields
2xx policy: 2xx is returned only when data extraction succeeds.
curl -X GET "https://api.stayapi.com/v1/booking/hotel/rooms?url=https://www.booking.com/hotel/th/banyan-tree-phuket.html&adults=2&rooms=1" \ -H "x-api-key: YOUR_API_KEY"
const params = new URLSearchParams({ url: "https://www.booking.com/hotel/th/banyan-tree-phuket.html", adults: "2", children: "0", rooms: "1" }); const response = await fetch( `https://api.stayapi.com/v1/booking/hotel/rooms?${params}`, { headers: { "x-api-key": "YOUR_API_KEY" } } ); const data = await response.json(); // Display room information data.data.rooms.forEach(room => { console.log(`${room.name} - ${room.size_sqm}m²`); console.log(`Max occupancy: ${room.max_occupancy} guests`); console.log(`Beds: ${room.bed_configuration.primary_configuration}`); });
import requests url = "https://api.stayapi.com/v1/booking/hotel/rooms" headers = {"x-api-key": "YOUR_API_KEY"} params = { "url": "https://www.booking.com/hotel/th/banyan-tree-phuket.html", "adults": 2, "children": 0, "rooms": 1 } response = requests.get(url, headers=headers, params=params) data = response.json() # Display room information for room in data["data"]["rooms"]: print(f"{room['name']} - {room['size_sqm']}m²") print(f"Max occupancy: {room['max_occupancy']} guests") print(f"Photos: {len(room['photos'])} available") # List key facilities facilities = room["facilities"] print(f"Key facilities: {", ".join(facilities[:5])}") print("-" * 50)
{ "success": true, "data": { "hotel_id": 302297, "hotel_name": "Banyan Tree Phuket", "rooms": [ { "room_id": "30229701", "name": "One-Bedroom Pool Villa", "description": "Featuring a private pool and tropical garden views, this spacious villa includes a separate living area, luxurious bathroom with deep soaking tub, and outdoor rain shower.", "photos": [ { "url": "https://cf.bstatic.com/xdata/images/hotel/max1024x768/123456789.jpg", "caption": "Villa exterior with pool" }, { "url": "https://cf.bstatic.com/xdata/images/hotel/max1024x768/123456790.jpg", "caption": "Bedroom with ocean view" } ], "size_sqm": 170, "size_sqft": 1830, "max_occupancy": 3, "bed_configuration": { "primary_configuration": "1 king bed", "alternative_configurations": [], "extra_beds_available": true }, "private_bathroom": true, "facilities": [ "Private pool", "Air conditioning", "Free WiFi", "Flat-screen TV", "Minibar", "Safe", "Coffee machine", "Bathrobe", "Slippers", "Hairdryer", "Toiletries", "Balcony", "Garden view", "Pool view", "Outdoor furniture", "Outdoor dining area" ], "room_highlights": [ "Private pool", "Garden view", "170 m²" ] }, { "room_id": "30229702", "name": "Two-Bedroom Pool Villa", "description": "Perfect for families or groups, this expansive villa features two bedrooms, a private pool, full kitchen, and spacious outdoor living areas with stunning lagoon views.", "photos": [ { "url": "https://cf.bstatic.com/xdata/images/hotel/max1024x768/234567891.jpg", "caption": "Two-bedroom villa pool area" } ], "size_sqm": 320, "size_sqft": 3444, "max_occupancy": 6, "bed_configuration": { "primary_configuration": "2 king beds", "alternative_configurations": [ "1 king bed and 2 single beds" ], "extra_beds_available": true }, "private_bathroom": true, "facilities": [ "Private pool", "Kitchen", "Living room", "Dining area", "2 bathrooms", "Air conditioning", "Free WiFi", "2 flat-screen TVs", "Wine cooler", "Dishwasher", "Washing machine", "Terrace", "BBQ facilities" ], "room_highlights": [ "Private pool", "Full kitchen", "320 m²", "2 bedrooms" ] } ], "total_room_types": 5 }, "message": "Successfully retrieved room details", "retrieved_at": "2024-01-15T10:30:00Z" }
{ "error": "Invalid request", "detail": "Number of adults must be between 1 and 30", "status_code": 400 }