Rapidapi APIbooking-com.p.rapidapi.com ↗
Search Booking.com hotels by location and retrieve structured property details: amenities, ratings, reviews, images, and pricing via two simple endpoints.
What is the Rapidapi API?
The Booking.com API exposes 2 endpoints covering hotel search and property detail extraction, returning up to 9 structured fields per property including amenities, rating scores, review counts, and images. Use search_properties to find hotels by city or keyword, then pass any result URL to get_property_details to pull full structured data for a specific listing.
curl -X GET 'https://api.parse.bot/scraper/15bd80e1-56cd-4b5d-bb77-42d31d8b2067/search_properties?limit=3&query=Paris' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace booking-com-p-rapidapi-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""
Booking.com Scraper API Client
Get your API key from: https://parse.bot/settings
"""
import os
import requests
from typing import Any, Dict, List, Optional
class ParseClient:
"""Client for interacting with the Booking.com Scraper API."""
def __init__(self, api_key: Optional[str] = None):
"""
Initialize the ParseClient.
Args:
api_key: API key for Parse Bot. If not provided, reads from PARSE_API_KEY env var.
"""
self.base_url = "https://api.parse.bot"
self.scraper_id = "15bd80e1-56cd-4b5d-bb77-42d31d8b2067"
self.api_key = api_key or os.getenv("PARSE_API_KEY")
if not self.api_key:
raise ValueError("API key must be provided or set in PARSE_API_KEY environment variable")
def _call(self, endpoint: str, method: str = "POST", **params) -> Dict[str, Any]:
"""
Make an API call to the Parse Bot scraper.
Args:
endpoint: The endpoint name (e.g., "search_properties")
method: HTTP method ("GET" or "POST")
**params: Parameters to send with the request
Returns:
The API response as a dictionary
Raises:
requests.HTTPError: If the API request fails
"""
url = f"{self.base_url}/scraper/{self.scraper_id}/{endpoint}"
headers = {
"X-API-Key": self.api_key,
"Content-Type": "application/json"
}
if method == "GET":
response = requests.get(url, headers=headers, params=params, timeout=30)
elif method == "POST":
response = requests.post(url, headers=headers, json=params, timeout=30)
else:
raise ValueError(f"Unsupported HTTP method: {method}")
response.raise_for_status()
return response.json()
def search_properties(self, query: str, limit: int = 10) -> Dict[str, Any]:
"""
Search for hotel properties by location or keyword.
Args:
query: Search keyword such as city name, hotel name, or area.
limit: Maximum number of results to return (default: 10).
Returns:
Dictionary containing query, total_results, and results array with property data.
"""
return self._call("search_properties", method="GET", query=query, limit=limit)
def get_property_details(self, url: str) -> Dict[str, Any]:
"""
Extract detailed information for a specific Booking.com hotel property.
Args:
url: The full Booking.com property URL.
Returns:
Dictionary containing detailed property information including name, address,
rating, description, amenities, and images.
"""
return self._call("get_property_details", method="GET", url=url)
def format_rating(rating_str: str) -> str:
"""Parse and format rating string from search results."""
if not rating_str:
return "N/A"
return rating_str.strip()
def display_search_results(results: List[Dict[str, Any]]) -> None:
"""Display formatted search results."""
for i, hotel in enumerate(results, 1):
print(f"\n{i}. {hotel.get('name', 'N/A')}")
print(f" Rating: {format_rating(hotel.get('rating', 'N/A'))}")
print(f" Price: {hotel.get('price', 'N/A')}")
print(f" Address: {hotel.get('address', 'N/A')}")
print(f" URL: {hotel.get('url', 'N/A')}")
def display_property_details(details: Dict[str, Any]) -> None:
"""Display formatted property details."""
print(f"\n📋 Hotel: {details.get('name', 'N/A')}")
print(f"📍 Address: {details.get('address', 'N/A')}")
print(f"⭐ Rating: {details.get('rating_score', 'N/A')}/10 ({details.get('rating_category', 'N/A')})")
print(f"📝 Reviews: {details.get('review_count', 'N/A')} reviews")
print(f"💰 Price: {details.get('price', 'N/A')}")
# Display description
description = details.get('description_text', '')
if description:
truncated = description[:200] + "..." if len(description) > 200 else description
print(f"📄 Description: {truncated}")
# Display amenities
amenities = details.get('amenities', [])
if amenities:
print(f"🏨 Amenities ({len(amenities)} total):")
for amenity in amenities[:5]:
print(f" • {amenity}")
if len(amenities) > 5:
print(f" ... and {len(amenities) - 5} more")
# Display images
images = details.get('images', [])
if images:
print(f"📸 Images available: {len(images)}")
def main():
"""Practical workflow: search for hotels and retrieve detailed information."""
try:
# Initialize the client
client = ParseClient()
print("=" * 70)
print("BOOKING.COM HOTEL SEARCH & DETAILS RETRIEVAL")
print("=" * 70)
# Step 1: Search for properties
search_location = "Paris"
print(f"\n🔍 Searching for hotels in '{search_location}'...")
search_response = client.search_properties(query=search_location, limit=5)
if search_response.get('status') != 'success':
print(f"❌ Search failed: {search_response}")
return
search_data = search_response.get('data', {})
total_results = search_data.get('total_results', 0)
results = search_data.get('results', [])
print(f"\n✅ Found {total_results} total hotels")
print(f"📊 Showing {len(results)} results:")
display_search_results(results)
# Step 2: Get detailed information for each hotel
hotel_urls = [hotel.get('url') for hotel in results if hotel.get('url')]
if hotel_urls:
print("\n" + "=" * 70)
print("DETAILED HOTEL INFORMATION")
print("=" * 70)
for idx, hotel_url in enumerate(hotel_urls[:3], 1):
print(f"\n[{idx}/{min(3, len(hotel_urls))}] Fetching details...")
try:
details_response = client.get_property_details(url=hotel_url)
if details_response.get('status') != 'success':
print(f"⚠️ Could not fetch details for this property")
continue
details_data = details_response.get('data', {})
display_property_details(details_data)
print("-" * 70)
except requests.exceptions.RequestException as e:
print(f"❌ Error fetching property details: {e}")
except Exception as e:
print(f"❌ Unexpected error: {e}")
print("\n✅ Hotel search and details retrieval complete!")
except ValueError as e:
print(f"❌ Configuration error: {e}")
except requests.exceptions.RequestException as e:
print(f"❌ Network error: {e}")
except Exception as e:
print(f"❌ Unexpected error: {e}")
if __name__ == "__main__":
main()Search for hotel properties by location or keyword. Returns a list of properties with name, URL, price, and rating. Results do not include check-in/check-out date pricing unless dates are specified in the search query.
| Param | Type | Description |
|---|---|---|
| limit | integer | Maximum number of results to return. |
| queryrequired | string | Search keyword such as city name, hotel name, or area (e.g. 'London', 'Paris', 'New York'). |
{
"type": "object",
"fields": {
"query": "string - the search query used",
"results": "array of property objects with name, url, price, rating, address",
"total_results": "integer - number of results returned"
},
"sample": {
"data": {
"query": "London",
"results": [
{
"url": "https://www.booking.com/hotel/gb/merlyn-court-greater-london1.html",
"name": "The Barkston",
"price": null,
"rating": "Scored 8.98.9Excellent97 reviews",
"address": null
}
],
"total_results": 5
},
"status": "success"
}
}About the Rapidapi API
Endpoints
search_properties accepts a required query string — a city name, area, or hotel name — plus an optional limit integer to cap results. The response returns an array of property objects, each with name, url, price, rating, and address, along with a total_results count. Prices in search results reflect availability only when check-in and check-out dates are included in the query; otherwise the price field may be absent.
get_property_details takes a full Booking.com property URL and returns a richer dataset: name, address, rating_score (numeric, out of 10), rating_category (e.g. "Excellent", "Good"), review_count, description_text, an amenities array, and an images array of direct image URLs. The price field is present only when date parameters are embedded in the URL — passing a bare property URL without dates returns null for price.
Data Coverage
Rating data comes as both a numeric rating_score and a human-readable rating_category, which makes it straightforward to bucket properties without building your own thresholds. The amenities field is an array of facility strings (e.g. "Free WiFi", "Parking", "Swimming pool") as listed on the property page. Images are returned as an array of direct URLs, ready to use in any front-end display.
Limitations
Availability calendars, room-type breakdowns, and real-time inventory are not returned by either endpoint. Price data depends on dates being present in the URL or query — without dates, price is null. The API returns results in the default Booking.com locale and does not currently expose parameters for language or currency selection.
The Rapidapi API is a managed, monitored endpoint for booking-com.p.rapidapi.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when booking-com.p.rapidapi.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official booking-com.p.rapidapi.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Build a hotel comparison tool that ranks properties by
rating_scoreandreview_countacross multiple cities. - Aggregate
amenitiesarrays from dozens of listings to filter hotels that include specific facilities like parking or breakfast. - Populate a travel app's property cards using
name,address,images, andrating_categoryfromget_property_details. - Monitor price changes for a set of property URLs by polling
get_property_detailswith date-stamped URLs. - Create a destination guide that surfaces top-rated hotels per city using
search_propertieswith city names as queries. - Feed structured hotel metadata into a recommendation engine using
description_textandamenitiesfields.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Booking.com have an official developer API?+
When does `get_property_details` return a non-null price?+
price field is populated only when check-in and check-out dates are embedded in the property URL you supply. A bare property URL (e.g. https://www.booking.com/hotel/gb/stgileshotel.html) without date query parameters returns null for price. To get pricing, append checkin and checkout date parameters to the URL before passing it to the endpoint.Does the API return room-type breakdowns or availability calendars?+
Can I paginate through large search result sets?+
search_properties accepts a limit parameter to cap the number of results returned, but there is no offset or page parameter exposed. The API returns a single batch of results up to the specified limit. You can fork this API on Parse and revise it to add pagination support for deeper result sets.Does the API support filtering search results by amenity, star rating, or price range?+
search_properties endpoint accepts only a query string and an optional limit — there are no server-side filter parameters for amenity type, star rating, or price range. Filtering must be done client-side against the returned rating and property fields. You can fork this API on Parse and revise it to add filter parameters if the underlying search supports them.