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 using Booking.com's GraphQL API.
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 | Booking.com hotel URL or hotel slug (e.g., "banyan-tree-phuket" or "https://www.booking.com/hotel/th/banyan-tree-phuket.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
Supported URL Formats
This endpoint accepts both hotel slugs and full Booking.com URLs, providing flexibility in how you reference hotels.
Hotel Slug Format
Use just the hotel identifier from the URL:
Full URL Format
Use the complete Booking.com hotel URL:
Automatic Detection
The API automatically detects and handles both formats. Use whichever format is most convenient for your application.
# Using hotel slug curl -X GET "https://api.stayapi.com/v1/booking/hotel/rooms?url=banyan-tree-phuket&adults=2&rooms=1" \ -H "x-api-key: YOUR_API_KEY" # Using full URL 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"
// Using hotel slug const params = new URLSearchParams({ url: "banyan-tree-phuket", adults: "2", children: "0", rooms: "1" }); // Or using full URL const paramsFullUrl = 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"} # Using hotel slug params = { "url": "banyan-tree-phuket", "adults": 2, "children": 0, "rooms": 1 } # Or using full URL params_full_url = { "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 }