Skip to content

Booking API - Complete Tutorial ​

Table of Contents ​

  1. Introduction
  2. Getting Started
  3. API Reference
  4. Enumerations & Schemas
  5. Workflow Examples
  6. FAQ

Introduction ​

Booking com API provides access to a vast database of accommodation listings, including over 28 million reported properties worldwide. This API allows you to:

  • Search for hotels, apartments, and unique accommodations
  • View prices, photos, and reviews
  • Find car rental deals
  • Build travel applications similar to hotels.com, booking.com, or agoda.com

Base URL: https://booking-com.p.rapidapi.com

Support: [email protected] | https://t.me/api_tipsters

Other Travel APIs: https://rapi.one/travel/


Getting Started ​

What is RapidAPI? ​

RapidAPI is the world's largest API hub where over three million developers find, test, and connect to thousands of APIs — all with a single account and API key.

Quick Start Steps ​

  1. Sign Up - Create an account at RapidAPI
  2. Subscribe - Subscribe to the Booking API
  3. Test - Test endpoints directly from the browser
  4. Integrate - Add the API to your application
  5. Build - Create your travel application!

Documentation:

Pricing ​

The API offers a free tier with monthly request limits. For higher limits or custom plans, contact support at [email protected].

RapidAPI Consumer Quick Start Guide


Connect and get an API key ​

API Reference ​

Metadata Endpoints ​

Exchange Rates ​

GET /v1/metadata/exchange-rates

Get currency exchange rates.

ParameterTypeRequiredDescription
localeLocaleYesLanguage locale (e.g., en-gb)
currencyCurrencyYesTarget currency code (e.g., USD)

Hotels Endpoints (v1) ​

Search Locations ​

GET /v1/hotels/locations

Search locations or hotels by name. Returns destination IDs needed for hotel searches.

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
namestringYesLocation or hotel nameBerlin

Response Example:

json
[
  {
    "name": "London",
    "dest_type": "city",
    "dest_id": "-2601889",
    "country": "United Kingdom",
    "label": "London, Greater London, United Kingdom",
    "latitude": 51.507391,
    "longitude": -0.127634,
    "nr_hotels": 14510
  }
]

Search Hotels ​

GET /v1/hotels/search

Get available hotels by destination, dates, and guest count. Use page_number for pagination.

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
dest_typeDestTypeYesDestination typecity
dest_idintegerYesDestination ID from Search Locations-553173
checkin_datestringYesCheck-in date (YYYY-MM-DD)2027-01-11
checkout_datestringYesCheck-out date (YYYY-MM-DD)2027-01-12
room_numberintegerYesNumber of rooms1
adults_numberintegerYesNumber of adults2
filter_by_currencyCurrencyYesCurrency for pricesUSD
order_byHotelsSearchOrderByYesSort orderpopularity
unitsHotelsSearchUnitsYesUnit systemmetric
children_numberintegerNoNumber of children2
children_agesstringNoAges of children (comma-separated, 0=infant)5,0
page_numberintegerNoPage number for pagination0
categories_filter_idsstringNoFilter IDs (use Search Filters endpoint)class::2,class::4
include_adjacencybooleanNoInclude nearby locationstrue

Search Filters ​

GET /v1/hotels/search-filters

Get available filters for hotel search (star rating, amenities, price ranges, etc.).

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
dest_typeDestTypeYesDestination typecity
dest_idintegerYesDestination ID-553173
checkin_datestringYesCheck-in date2027-01-11
checkout_datestringYesCheck-out date2027-01-12
room_numberintegerYesNumber of rooms1
adults_numberintegerYesNumber of adults2
filter_by_currencyCurrencyYesCurrencyUSD
order_byHotelsSearchOrderByYesSort orderpopularity
unitsHotelsSearchUnitsYesUnit systemmetric

Hotel Data ​

GET /v1/hotels/data

Get basic hotel information by hotel_id.

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
hotel_idintegerYesHotel ID1377073

Hotel Photos ​

GET /v1/hotels/photos

Get all photos of a hotel.

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
hotel_idintegerYesHotel ID1377073

Hotel Review Scores ​

GET /v1/hotels/review-scores

Get review scores and ratings breakdown.

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
hotel_idintegerYesHotel ID1377073

Hotel Location Highlights ​

GET /v1/hotels/location-highlights

Get nearby transportation and landmarks (metro, rail, etc.).

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
hotel_idintegerYesHotel ID1377073

Hotel Description ​

GET /v1/hotels/description

Get full hotel description.

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
hotel_idintegerYesHotel ID1377073

Hotel Questions ​

GET /v1/hotels/questions

Get Q&A between guests and hotel staff.

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
hotel_idintegerYesHotel ID1676161

Hotel Payment Features ​

GET /v1/hotels/payment-features

Get accepted payment methods and features.

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
hotel_idintegerYesHotel ID1676161

Hotel Policies ​

GET /v1/hotels/policies

Get hotel policies (check-in/out times, cancellation, etc.).

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
hotel_idintegerYesHotel ID1676161

Hotel Facilities ​

GET /v1/hotels/facilities

Get hotel amenities (Restaurant, Room service, Breakfast, etc.).

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
hotel_idintegerYesHotel ID1676161

Hotel Map Markers ​

GET /v1/hotels/map-markers

Get geographic coordinates and nearby landmarks.

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
hotel_idintegerYesHotel ID1676161

Hotel Nearby Places ​

GET /v1/hotels/nearby-places

Get nearby points of interest (airports, shopping centers, etc.).

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
hotel_idintegerYesHotel ID1676161

Hotel Children Policy ​

GET /v1/hotels/children-policies

Get policies regarding children.

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
hotel_idintegerYesHotel ID1676161
children_ageintegerNoChild age to check5

Hotel Reviews ​

GET /v1/hotels/reviews

Retrieve hotel reviews using the hotel_id. The maximum value of average_score is 4, which corresponds to a score of 10 on the site.

Example: average_score=3.6. Conversion: 3.6 ÷ 4 * 10 = 9 (on site).

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
hotel_idintegerYesHotel ID1676161
sort_typeHotelsReviewsSortTypeYesSort orderSORT_MOST_RELEVANT
page_numberintegerNoPage number0
customer_typestringNoFilter by traveler typesolo_traveller
language_filterstringNoFilter by review languageen-gb,de,fr

Hotel Tips ​

GET /v1/hotels/tips

Get guest tips and recommendations.

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
hotel_idintegerYesHotel ID1676161
sort_typeHotelsReviewsSortTypeYesSort orderSORT_MOST_RELEVANT
page_numberintegerNoPage number0
customer_typestringNoFilter by traveler typesolo_traveller
language_filterstringNoFilter by review languageen-gb,de,fr

Hotel Reviews Metadata ​

GET /v1/hotels/reviews-filter-metadata

Get metadata for review filtering (available languages, traveler types, etc.).

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
hotel_idintegerYesHotel ID1676161

Hotel Room List ​

GET /v1/hotels/room-list

Get available rooms with prices, photos, and descriptions.

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
currencyCurrencyYesCurrencyUSD
unitsHotelsSearchUnitsYesUnit systemmetric
hotel_idintegerYesHotel ID1676161
checkin_datestringYesCheck-in date2027-01-11
checkout_datestringYesCheck-out date2027-01-12
adults_number_by_roomsstringYesAdults per room (comma-separated)3,1
children_number_by_roomsstringNoChildren per room (comma-separated)2,1
children_agesstringNoAges of all children5,0,9

Nearby Cities ​

GET /v1/hotels/nearby-cities

Get cities near specified coordinates.

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
latitudenumberYesLatitude65.9667
longitudenumberYesLongitude-18.5333

Search Hotels by Coordinates ​

GET /v1/hotels/search-by-coordinates

Find hotels near specific coordinates (latitude/longitude).

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
latitudenumberYesLatitude65.9667
longitudenumberYesLongitude-18.5333
checkin_datestringYesCheck-in date2027-01-11
checkout_datestringYesCheck-out date2027-01-12
room_numberintegerYesNumber of rooms1
adults_numberintegerYesNumber of adults2
filter_by_currencyCurrencyYesCurrencyUSD
order_byHotelsSearchOrderByYesSort orderpopularity
unitsHotelsSearchUnitsYesUnit systemmetric
children_numberintegerNoNumber of children2
children_agesstringNoAges of children5,0
page_numberintegerNoPage number0
categories_filter_idsstringNoFilter IDsclass::2,class::4
include_adjacencybooleanNoInclude nearby locationstrue

Hotels Endpoints (v2) ​

Version 2 endpoints provide enhanced functionality.

Search Filters (v2) ​

GET /v2/hotels/search-filters

Enhanced search filters with price range support.

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
dest_typeDestTypeYesDestination typecity
dest_idintegerYesDestination ID-553173
checkin_datestringYesCheck-in date2027-01-11
checkout_datestringYesCheck-out date2027-01-12
room_numberintegerYesNumber of rooms1
adults_numberintegerYesNumber of adults2
filter_by_currencyCurrencyYesCurrencyUSD
order_byHotelsSearchOrderByYesSort orderpopularity
unitsHotelsSearchUnitsYesUnit systemmetric
categories_filter_idsstringNoFilters including price rangesprice::USD-140-190

Price Filter Formats:

  • Range: price::USD-140-190
  • Minimum: price::USD-150-min
  • Maximum: price::USD-150-max

Hotels Search (v2) ​

GET /v2/hotels/search

Enhanced hotel search with additional filtering options.

Same parameters as v1, with enhanced categories_filter_ids supporting price ranges.


Hotels Details (v2) ​

GET /v2/hotels/details

Get comprehensive hotel details.

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
currencyCurrencyYesCurrencyUSD
hotel_idintegerYesHotel ID1676161
checkin_datestringYesCheck-in date2027-01-11
checkout_datestringYesCheck-out date2027-01-12

Hotel Description (v2) ​

GET /v2/hotels/description

Get hotel description.

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
hotel_idintegerYesHotel ID1377073

Meta Properties ​

GET /v2/hotels/meta-properties

Get meta properties description for SEO and display purposes.


Car Rental Endpoints ​

Search Car Locations ​

GET /v1/car-rental/locations

Search car rental pickup/dropoff locations by name.

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
namestringYesLocation nameBerlin

Search Car Rental ​

GET /v1/car-rental/search

Search available rental cars.

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
currencyCurrencyYesCurrencyUSD
sort_byCarsSortByYesSort orderrecommended
from_countryCarsCorYesCountry codede
pick_up_datetimestringYesPickup date/time2027-01-12 09:00:00
drop_off_datetimestringYesDropoff date/time2027-01-13 09:00:00
pick_up_latitudenumberYesPickup latitude50.08773
pick_up_longitudenumberYesPickup longitude14.421133
drop_off_latitudenumberYesDropoff latitude50.08773
drop_off_longitudenumberYesDropoff longitude14.421133

Car Rental Details ​

GET /v1/car-rental/detail

Get details for a specific vehicle.

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
currencyCurrencyYesCurrencyUSD
from_countryCarsCorYesCountry codede
vehicle_idintegerYesVehicle ID from search699544941
search_keystringYesSearch key from search results(encoded string)

Rental Terms ​

GET /v1/car-rental/terms-conditions

Get rental terms and conditions.

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
from_countryCarsCorYesCountry codede
pick_up_location_idintegerYesPickup location ID4516789

Important Information ​

GET /v1/car-rental/important-info

Get important vehicle information.

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
from_countryCarsCorYesCountry codede
vehicle_idintegerYesVehicle ID663317713
driver_ageintegerYesDriver age30
pick_up_location_idintegerYesPickup location ID4123205
drop_off_location_idintegerYesDropoff location ID4123205
pick_up_datetimestringYesPickup date/time2027-01-11 09:00:00
drop_off_datetimestringYesDropoff date/time2027-01-12 09:00:00

Rental Extras ​

GET /v1/car-rental/extras

Get additional services (insurance, GPS, etc.).

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
from_countryCarsCorYesCountry codede
currencyCurrencyYesCurrencyUSD
vehicle_idintegerYesVehicle ID663317713
pricenumberYesBase price2860.87
driver_ageintegerYesDriver age30
pick_up_datetimestringYesPickup date/time2027-01-11 09:00:00
drop_off_datetimestringYesDropoff date/time2027-01-12 09:00:00

Vehicle Supplier Details ​

GET /v1/car-rental/supplier/details

Get rental company details.

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
from_countryCarsCorYesCountry codede
vehicle_idintegerYesVehicle ID699544941

Supplier Reviews ​

GET /v1/car-rental/supplier/reviews

Get reviews for rental suppliers.

ParameterTypeRequiredDescriptionExample
localeLocaleYesLanguage localeen-gb
from_countryCarsCorYesCountry codede
location_idintegerYesLocation ID4123205

Static Data Endpoints ​

These endpoints provide reference data for filtering and display.

Cities List ​

GET /v1/static/cities

ParameterTypeRequiredDescriptionExample
namestringNoCity nameParis
city_idintegerNoCity ID
countrystringNoCountry codefr
latitudestringNoLatitude
longitudestringNoLongitude
pageintegerNoPage number0

Countries List ​

GET /v1/static/country

ParameterTypeRequiredDescriptionExample
countrystringNoCountry codeus

Hotel Chains ​

GET /v1/static/chain-types

ParameterTypeRequiredDescriptionExample
chain_idstringNoChain ID
namestringNoChain nameHilton

Districts ​

GET /v1/static/districts

ParameterTypeRequiredDescriptionExample
namestringNoDistrict name
city_idstringNoCity ID
district_idstringNoDistrict ID
countrystringNoCountry code
pageintegerNoPage number0

Facility Types ​

GET /v1/static/facility-types

ParameterTypeRequiredDescriptionExample
facility_idintegerNoFacility ID

Hotel Facility Types ​

GET /v1/static/hotel-facility-types

ParameterTypeRequiredDescriptionExample
facility_type_idstringNoFacility type ID
hotel_facility_type_idstringNoHotel facility type ID

Hotel Types ​

GET /v1/static/hotel-types

ParameterTypeRequiredDescriptionExample
hotel_type_idstringNoHotel type ID

Payment Types ​

GET /v1/static/payment-types

ParameterTypeRequiredDescriptionExample
payment_idstringNoPayment ID

Regions ​

GET /v1/static/regions

ParameterTypeRequiredDescriptionExample
namestringNoRegion name
countrystringNoCountry code
region_idstringNoRegion ID
region_typestringNoRegion type
pageintegerNoPage number0

Hotels List ​

GET /v1/static/hotels

ParameterTypeRequiredDescriptionExample
namestringNoHotel name
slugstringNoURL slugad/plaza
hotel_idintegerNoHotel ID
city_idintegerNoCity ID
countrystringNoCountry code
region_idintegerNoRegion ID
district_idintegerNoDistrict ID
hotel_type_idintegerNoHotel type ID
zip_codestringNoZIP code
exact_classintegerNoStar rating
pageintegerNoPage number0

Room Facility Types ​

GET /v1/static/room-facility-types

ParameterTypeRequiredDescriptionExample
room_facility_type_idstringNoRoom facility type ID
facility_type_idstringNoFacility type ID

Room Types ​

GET /v1/static/room-types

ParameterTypeRequiredDescriptionExample
room_type_idstringNoRoom type ID

Enumerations & Schemas ​

Locale ​

Supported language locales:

ValueLanguage
en-gbEnglish (UK)
en-usEnglish (US)
deGerman
nlDutch
frFrench
esSpanish
es-arSpanish (Argentina)
es-mxSpanish (Mexico)
caCatalan
itItalian
pt-ptPortuguese (Portugal)
pt-brPortuguese (Brazil)
noNorwegian
fiFinnish
svSwedish
daDanish
csCzech
huHungarian
roRomanian
jaJapanese
zh-cnChinese (Simplified)
zh-twChinese (Traditional)
plPolish
elGreek
ruRussian
trTurkish
bgBulgarian
arArabic
koKorean
heHebrew
lvLatvian
ukUkrainian
idIndonesian
msMalay
thThai
etEstonian
hrCroatian
ltLithuanian
skSlovak
srSerbian
slSlovenian
viVietnamese
tlFilipino
isIcelandic

Currency ​

Supported currency codes:

AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BYR, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CUP, CVE, CYP, CZK, DJF, DKK, DOP, DZD, EEK, EUR, EGP, ETB, FJD, GBP, GEL, GHS, GMD, GNF, GRD, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRO, MTL, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, ROL, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SIT, SKK, SLL, SOS, SRD, STD, SVC, SYP, SZL, THB, TJS, TMM, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VEB, VEF, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMK, ZMW


DestType (Destination Type) ​

ValueDescription
cityCity
regionRegion/State
landmarkLandmark
districtDistrict/Neighborhood
hotelSpecific hotel
countryCountry
airportAirport
latlongGPS coordinates

HotelsSearchOrderBy (Sort Options) ​

ValueDescription
popularityMost popular first
class_ascendingStar rating (low to high)
class_descendingStar rating (high to low)
distanceDistance from center
upsort_bhBooking recommendation
review_scoreGuest rating
pricePrice (low to high)

HotelsSearchUnits ​

ValueDescription
metricKilometers
imperialMiles

HotelsReviewsSortType ​

ValueDescription
SORT_MOST_RELEVANTMost relevant reviews
SORT_RECENT_DESCNewest first
SORT_RECENT_ASCOldest first
SORT_SCORE_DESCHighest score first
SORT_SCORE_ASCLowest score first

CarsSortBy ​

ValueDescription
recommendedRecommended cars
price_low_to_highPrice (low to high)

CarsCor (Car Rental Countries) ​

Supported country codes for car rental:

it, de, nl, fr, es, ca, no, fi, sv, da, cs, hu, ro, ja, pl, el, ru, tr, bg, ar, ko, he, lv, uk, id, ms, th, et, hr, lt, sk, sr, sl, vi, tl


Customer Type (Reviews) ​

Filter reviews by traveler type:

  • total - All reviews
  • solo_traveller - Solo travelers
  • young_couple - Young couples
  • mature_couple - Mature couples
  • family_with_young_children - Families with young children
  • family_with_older_children - Families with older children
  • with_friends - Friends traveling together
  • group - Groups
  • review_category_couples - All couples
  • review_category_families - All families
  • review_category_group_of_friends - Groups of friends

Charge Types ​

  • CITYTAX - City/tourist tax
  • SERVICECHARGE - Service charge
  • VAT - Value added tax

Facility Fee Types ​

Types of facilities that may have additional fees:

SPA, SAUNA, HOTTUB, FITNESSCENTER, BICYCLERENTAL, MASSAGE, TENNISCOURT, LAUNDRY, VALETPARKING, SOLARIUM, TURKISHSTEAMBATH, PRIVATECHEF, HOTSPRINGBATH, LOCKERSAFE, EXCURSION, BBQFACILITIES, IRONING, UMBRELLA, WATERPARK, GOLFCOURSE, SUNBED, HIKING, BEAUTYSALON, DIVING, POOL, PRIVATEBEACHAREA, HIGHCHAIR, CARRENTAL, BABYSITTING


Workflow Examples ​

Prerequisites ​

Replace YOUR_RAPIDAPI_KEY with your actual RapidAPI key in all examples below.


Step-by-Step Flow ​

Step 1: Search for destination
GET /v1/hotels/locations?name=London&locale=en-gb
Response: dest_id = "-2601889", dest_type = "city"

Step 2: Get available filters (optional)
GET /v1/hotels/search-filters?dest_id=-2601889&dest_type=city&...

Step 3: Search hotels
GET /v1/hotels/search?dest_id=-2601889&dest_type=city&checkin_date=2027-01-11&checkout_date=2027-01-12&adults_number=2&room_number=1&...

Step 4: Get hotel details
GET /v1/hotels/data?hotel_id=1377073&locale=en-gb
GET /v1/hotels/photos?hotel_id=1377073&locale=en-gb
GET /v1/hotels/reviews?hotel_id=1377073&...

Python Example ​

python
import requests
import json

# Configuration
RAPIDAPI_KEY = "YOUR_RAPIDAPI_KEY"
BASE_URL = "https://booking-com.p.rapidapi.com"

headers = {
    "X-RapidAPI-Key": RAPIDAPI_KEY,
    "X-RapidAPI-Host": "booking-com.p.rapidapi.com"
}

def search_locations(name, locale="en-gb"):
    """Search for destinations by name"""
    url = f"{BASE_URL}/v1/hotels/locations"
    params = {"name": name, "locale": locale}
    response = requests.get(url, headers=headers, params=params)
    return response.json()

def search_hotels(dest_id, dest_type, checkin_date, checkout_date,
                  adults_number=2, room_number=1, page_number=0):
    """Search for available hotels"""
    url = f"{BASE_URL}/v1/hotels/search"
    params = {
        "locale": "en-gb",
        "dest_id": dest_id,
        "dest_type": dest_type,
        "checkin_date": checkin_date,
        "checkout_date": checkout_date,
        "adults_number": adults_number,
        "room_number": room_number,
        "page_number": page_number,
        "filter_by_currency": "USD",
        "order_by": "popularity",
        "units": "metric"
    }
    response = requests.get(url, headers=headers, params=params)
    return response.json()

def get_hotel_details(hotel_id):
    """Get detailed hotel information"""
    url = f"{BASE_URL}/v1/hotels/data"
    params = {"locale": "en-gb", "hotel_id": hotel_id}
    response = requests.get(url, headers=headers, params=params)
    return response.json()

def get_hotel_photos(hotel_id):
    """Get hotel photos"""
    url = f"{BASE_URL}/v1/hotels/photos"
    params = {"locale": "en-gb", "hotel_id": hotel_id}
    response = requests.get(url, headers=headers, params=params)
    return response.json()

def get_hotel_reviews(hotel_id, sort_type="SORT_MOST_RELEVANT"):
    """Get hotel reviews"""
    url = f"{BASE_URL}/v1/hotels/reviews"
    params = {
        "locale": "en-gb",
        "hotel_id": hotel_id,
        "sort_type": sort_type
    }
    response = requests.get(url, headers=headers, params=params)
    return response.json()

# ============ Main Workflow ============
if __name__ == "__main__":
    # Step 1: Search for London
    print("🔍 Searching for London...")
    locations = search_locations("London")
    london = locations[0]
    print(f"   Found: {london['label']}")
    print(f"   dest_id: {london['dest_id']}, dest_type: {london['dest_type']}")

    # Step 2: Search hotels in London
    print("\n🏨 Searching hotels in London...")
    hotels = search_hotels(
        dest_id=london['dest_id'],
        dest_type=london['dest_type'],
        checkin_date="2027-01-15",
        checkout_date="2027-01-16"
    )

    # Display first 5 hotels
    print(f"   Found {hotels.get('count', 0)} hotels")
    for hotel in hotels.get('result', [])[:5]:
        print(f"   - {hotel.get('hotel_name')} - ${hotel.get('min_total_price', 'N/A')}")

    # Step 3: Get details for first hotel
    if hotels.get('result'):
        hotel_id = hotels['result'][0]['hotel_id']
        print(f"\n📋 Getting details for hotel {hotel_id}...")

        details = get_hotel_details(hotel_id)
        print(f"   Name: {details.get('name', 'N/A')}")

        photos = get_hotel_photos(hotel_id)
        print(f"   Photos: {len(photos)} available")

        reviews = get_hotel_reviews(hotel_id)
        print(f"   Reviews: {len(reviews.get('result', []))} fetched")

JavaScript (Node.js) Example ​

javascript
const axios = require('axios');

// Configuration
const RAPIDAPI_KEY = 'YOUR_RAPIDAPI_KEY';
const BASE_URL = 'https://booking-com.p.rapidapi.com';

const headers = {
    'X-RapidAPI-Key': RAPIDAPI_KEY,
    'X-RapidAPI-Host': 'booking-com.p.rapidapi.com'
};

/**
 * Search for destinations by name
 */
async function searchLocations(name, locale = 'en-gb') {
    const response = await axios.get(`${BASE_URL}/v1/hotels/locations`, {
        headers,
        params: { name, locale }
    });
    return response.data;
}

/**
 * Search for available hotels
 */
async function searchHotels(destId, destType, checkinDate, checkoutDate,
                           adultsNumber = 2, roomNumber = 1, pageNumber = 0) {
    const response = await axios.get(`${BASE_URL}/v1/hotels/search`, {
        headers,
        params: {
            locale: 'en-gb',
            dest_id: destId,
            dest_type: destType,
            checkin_date: checkinDate,
            checkout_date: checkoutDate,
            adults_number: adultsNumber,
            room_number: roomNumber,
            page_number: pageNumber,
            filter_by_currency: 'USD',
            order_by: 'popularity',
            units: 'metric'
        }
    });
    return response.data;
}

/**
 * Get detailed hotel information
 */
async function getHotelDetails(hotelId) {
    const response = await axios.get(`${BASE_URL}/v1/hotels/data`, {
        headers,
        params: { locale: 'en-gb', hotel_id: hotelId }
    });
    return response.data;
}

/**
 * Get hotel photos
 */
async function getHotelPhotos(hotelId) {
    const response = await axios.get(`${BASE_URL}/v1/hotels/photos`, {
        headers,
        params: { locale: 'en-gb', hotel_id: hotelId }
    });
    return response.data;
}

/**
 * Get hotel reviews
 */
async function getHotelReviews(hotelId, sortType = 'SORT_MOST_RELEVANT') {
    const response = await axios.get(`${BASE_URL}/v1/hotels/reviews`, {
        headers,
        params: {
            locale: 'en-gb',
            hotel_id: hotelId,
            sort_type: sortType
        }
    });
    return response.data;
}

// ============ Main Workflow ============
async function main() {
    try {
        // Step 1: Search for London
        console.log('🔍 Searching for London...');
        const locations = await searchLocations('London');
        const london = locations[0];
        console.log(`   Found: ${london.label}`);
        console.log(`   dest_id: ${london.dest_id}, dest_type: ${london.dest_type}`);

        // Step 2: Search hotels in London
        console.log('\n🏨 Searching hotels in London...');
        const hotels = await searchHotels(
            london.dest_id,
            london.dest_type,
            '2027-01-15',
            '2027-01-16'
        );

        // Display first 5 hotels
        console.log(`   Found ${hotels.count || 0} hotels`);
        (hotels.result || []).slice(0, 5).forEach(hotel => {
            console.log(`   - ${hotel.hotel_name} - $${hotel.min_total_price || 'N/A'}`);
        });

        // Step 3: Get details for first hotel
        if (hotels.result && hotels.result.length > 0) {
            const hotelId = hotels.result[0].hotel_id;
            console.log(`\n📋 Getting details for hotel ${hotelId}...`);

            const details = await getHotelDetails(hotelId);
            console.log(`   Name: ${details.name || 'N/A'}`);

            const photos = await getHotelPhotos(hotelId);
            console.log(`   Photos: ${photos.length} available`);

            const reviews = await getHotelReviews(hotelId);
            console.log(`   Reviews: ${(reviews.result || []).length} fetched`);
        }
    } catch (error) {
        console.error('Error:', error.response?.data || error.message);
    }
}

main();

JavaScript (Browser/Fetch) Example ​

javascript
// Configuration
const RAPIDAPI_KEY = 'YOUR_RAPIDAPI_KEY';
const BASE_URL = 'https://booking-com.p.rapidapi.com';

/**
 * Make API request
 */
async function apiRequest(endpoint, params) {
    const queryString = new URLSearchParams(params).toString();
    const response = await fetch(`${BASE_URL}${endpoint}?${queryString}`, {
        method: 'GET',
        headers: {
            'X-RapidAPI-Key': RAPIDAPI_KEY,
            'X-RapidAPI-Host': 'booking-com.p.rapidapi.com'
        }
    });

    if (!response.ok) {
        throw new Error(`HTTP error! status: ${response.status}`);
    }

    return response.json();
}

/**
 * Complete hotel search workflow
 */
async function searchAndDisplayHotels(cityName, checkin, checkout) {
    try {
        // Step 1: Find destination
        console.log(`Searching for ${cityName}...`);
        const locations = await apiRequest('/v1/hotels/locations', {
            name: cityName,
            locale: 'en-gb'
        });

        if (!locations.length) {
            console.log('Location not found');
            return;
        }

        const destination = locations[0];
        console.log(`Found: ${destination.label}`);

        // Step 2: Search hotels
        const hotels = await apiRequest('/v1/hotels/search', {
            locale: 'en-gb',
            dest_id: destination.dest_id,
            dest_type: destination.dest_type,
            checkin_date: checkin,
            checkout_date: checkout,
            adults_number: 2,
            room_number: 1,
            filter_by_currency: 'USD',
            order_by: 'popularity',
            units: 'metric'
        });

        // Display results
        console.log(`\nFound ${hotels.count} hotels:`);
        hotels.result.slice(0, 10).forEach((hotel, index) => {
            console.log(`${index + 1}. ${hotel.hotel_name}`);
            console.log(`   Price: $${hotel.min_total_price}`);
            console.log(`   Rating: ${hotel.review_score}/10`);
            console.log(`   Distance: ${hotel.distance_to_cc} km from center`);
        });

        return hotels;
    } catch (error) {
        console.error('Error:', error);
    }
}

// Usage
searchAndDisplayHotels('Paris', '2027-01-01', '2027-01-03');

Example 2: Search Hotels by Coordinates ​

Python Example ​

python
import requests

RAPIDAPI_KEY = "YOUR_RAPIDAPI_KEY"
BASE_URL = "https://booking-com.p.rapidapi.com"

headers = {
    "X-RapidAPI-Key": RAPIDAPI_KEY,
    "X-RapidAPI-Host": "booking-com.p.rapidapi.com"
}

def search_hotels_by_coordinates(latitude, longitude, checkin_date, checkout_date,
                                  adults_number=2, room_number=1):
    """Search hotels near specific coordinates"""
    url = f"{BASE_URL}/v1/hotels/search-by-coordinates"
    params = {
        "locale": "en-gb",
        "latitude": latitude,
        "longitude": longitude,
        "checkin_date": checkin_date,
        "checkout_date": checkout_date,
        "adults_number": adults_number,
        "room_number": room_number,
        "filter_by_currency": "USD",
        "order_by": "distance",
        "units": "metric"
    }
    response = requests.get(url, headers=headers, params=params)
    return response.json()

# ============ Main ============
if __name__ == "__main__":
    # Search hotels near Eiffel Tower, Paris
    print("🏨 Searching hotels near Eiffel Tower, Paris...")

    hotels = search_hotels_by_coordinates(
        latitude=48.8584,
        longitude=2.2945,
        checkin_date="2027-01-15",
        checkout_date="2027-01-16"
    )

    print(f"Found {hotels.get('count', 0)} hotels nearby:")
    for hotel in hotels.get('result', [])[:5]:
        print(f"  - {hotel.get('hotel_name')}")
        print(f"    Distance: {hotel.get('distance_to_cc')} km")
        print(f"    Price: ${hotel.get('min_total_price')}")

JavaScript Example ​

javascript
const axios = require('axios');

const RAPIDAPI_KEY = 'YOUR_RAPIDAPI_KEY';
const BASE_URL = 'https://booking-com.p.rapidapi.com';

/**
 * Search hotels near specific coordinates
 */
async function searchHotelsByCoordinates(latitude, longitude, checkinDate, checkoutDate,
                                         adultsNumber = 2, roomNumber = 1) {
    const response = await axios.get(`${BASE_URL}/v1/hotels/search-by-coordinates`, {
        headers: {
            'X-RapidAPI-Key': RAPIDAPI_KEY,
            'X-RapidAPI-Host': 'booking-com.p.rapidapi.com'
        },
        params: {
            locale: 'en-gb',
            latitude,
            longitude,
            checkin_date: checkinDate,
            checkout_date: checkoutDate,
            adults_number: adultsNumber,
            room_number: roomNumber,
            filter_by_currency: 'USD',
            order_by: 'distance',
            units: 'metric'
        }
    });
    return response.data;
}

// ============ Main ============
async function main() {
    // Search hotels near Times Square, New York
    console.log('🏨 Searching hotels near Times Square, New York...');

    const hotels = await searchHotelsByCoordinates(
        40.7580,  // Latitude
        -73.9855, // Longitude
        '2027-01-15',
        '2027-01-16'
    );

    console.log(`Found ${hotels.count || 0} hotels nearby:`);
    (hotels.result || []).slice(0, 5).forEach(hotel => {
        console.log(`  - ${hotel.hotel_name}`);
        console.log(`    Distance: ${hotel.distance_to_cc} km`);
        console.log(`    Price: $${hotel.min_total_price}`);
    });
}

main().catch(console.error);

Python Example ​

python
import requests

RAPIDAPI_KEY = "YOUR_RAPIDAPI_KEY"
BASE_URL = "https://booking-com.p.rapidapi.com"

headers = {
    "X-RapidAPI-Key": RAPIDAPI_KEY,
    "X-RapidAPI-Host": "booking-com.p.rapidapi.com"
}

def search_car_locations(name):
    """Search car rental locations"""
    url = f"{BASE_URL}/v1/car-rental/locations"
    params = {"locale": "en-gb", "name": name}
    response = requests.get(url, headers=headers, params=params)
    return response.json()

def search_car_rental(pickup_lat, pickup_lng, pickup_datetime,
                      dropoff_lat, dropoff_lng, dropoff_datetime,
                      from_country="de"):
    """Search available rental cars"""
    url = f"{BASE_URL}/v1/car-rental/search"
    params = {
        "locale": "en-gb",
        "currency": "USD",
        "sort_by": "price_low_to_high",
        "from_country": from_country,
        "pick_up_latitude": pickup_lat,
        "pick_up_longitude": pickup_lng,
        "pick_up_datetime": pickup_datetime,
        "drop_off_latitude": dropoff_lat,
        "drop_off_longitude": dropoff_lng,
        "drop_off_datetime": dropoff_datetime
    }
    response = requests.get(url, headers=headers, params=params)
    return response.json()

def get_car_details(vehicle_id, search_key, from_country="de"):
    """Get car rental details"""
    url = f"{BASE_URL}/v1/car-rental/detail"
    params = {
        "locale": "en-gb",
        "currency": "USD",
        "from_country": from_country,
        "vehicle_id": vehicle_id,
        "search_key": search_key
    }
    response = requests.get(url, headers=headers, params=params)
    return response.json()

# ============ Main ============
if __name__ == "__main__":
    # Step 1: Find location
    print("🚗 Searching car rental locations in Berlin...")
    locations = search_car_locations("Berlin")
    if locations:
        print(f"   Found: {locations[0].get('label', 'N/A')}")

    # Step 2: Search available cars
    print("\n🚙 Searching available cars...")
    cars = search_car_rental(
        pickup_lat=52.52,
        pickup_lng=13.405,
        pickup_datetime="2027-01-15 10:00:00",
        dropoff_lat=52.52,
        dropoff_lng=13.405,
        dropoff_datetime="2027-01-16 10:00:00",
        from_country="de"
    )

    print(f"   Found {len(cars.get('result', []))} cars:")
    for car in cars.get('result', [])[:5]:
        print(f"   - {car.get('vehicle_type', {}).get('name', 'Unknown')}")
        print(f"     Price: ${car.get('price', 'N/A')}")
        print(f"     Supplier: {car.get('supplier', {}).get('name', 'N/A')}")

JavaScript Example ​

javascript
const axios = require('axios');

const RAPIDAPI_KEY = 'YOUR_RAPIDAPI_KEY';
const BASE_URL = 'https://booking-com.p.rapidapi.com';

/**
 * Search car rental locations
 */
async function searchCarLocations(name) {
    const response = await axios.get(`${BASE_URL}/v1/car-rental/locations`, {
        headers: {
            'X-RapidAPI-Key': RAPIDAPI_KEY,
            'X-RapidAPI-Host': 'booking-com.p.rapidapi.com'
        },
        params: { locale: 'en-gb', name }
    });
    return response.data;
}

/**
 * Search available rental cars
 */
async function searchCarRental(pickupLat, pickupLng, pickupDatetime,
                               dropoffLat, dropoffLng, dropoffDatetime,
                               fromCountry = 'de') {
    const response = await axios.get(`${BASE_URL}/v1/car-rental/search`, {
        headers: {
            'X-RapidAPI-Key': RAPIDAPI_KEY,
            'X-RapidAPI-Host': 'booking-com.p.rapidapi.com'
        },
        params: {
            locale: 'en-gb',
            currency: 'USD',
            sort_by: 'price_low_to_high',
            from_country: fromCountry,
            pick_up_latitude: pickupLat,
            pick_up_longitude: pickupLng,
            pick_up_datetime: pickupDatetime,
            drop_off_latitude: dropoffLat,
            drop_off_longitude: dropoffLng,
            drop_off_datetime: dropoffDatetime
        }
    });
    return response.data;
}

// ============ Main ============
async function main() {
    // Step 1: Find location
    console.log('🚗 Searching car rental locations in Berlin...');
    const locations = await searchCarLocations('Berlin');
    if (locations.length > 0) {
        console.log(`   Found: ${locations[0].label || 'N/A'}`);
    }

    // Step 2: Search available cars
    console.log('\n🚙 Searching available cars...');
    const cars = await searchCarRental(
        52.52, 13.405,              // Berlin coordinates
        '2027-01-15 10:00:00',       // Pickup
        52.52, 13.405,              // Same drop-off
        '2027-01-16 10:00:00',       // Dropoff
        'de'
    );

    console.log(`   Found ${(cars.result || []).length} cars:`);
    (cars.result || []).slice(0, 5).forEach(car => {
        console.log(`   - ${car.vehicle_type?.name || 'Unknown'}`);
        console.log(`     Price: $${car.price || 'N/A'}`);
        console.log(`     Supplier: ${car.supplier?.name || 'N/A'}`);
    });
}

main().catch(console.error);

Example 4: Complete Hotel Information with Filters ​

Python Example ​

python
import requests

RAPIDAPI_KEY = "YOUR_RAPIDAPI_KEY"
BASE_URL = "https://booking-com.p.rapidapi.com"

headers = {
    "X-RapidAPI-Key": RAPIDAPI_KEY,
    "X-RapidAPI-Host": "booking-com.p.rapidapi.com"
}

class BookingAPI:
    def __init__(self, api_key):
        self.api_key = api_key
        self.base_url = "https://booking-com.p.rapidapi.com"
        self.headers = {
            "X-RapidAPI-Key": api_key,
            "X-RapidAPI-Host": "booking-com.p.rapidapi.com"
        }

    def _get(self, endpoint, params):
        """Make GET request"""
        url = f"{self.base_url}{endpoint}"
        response = requests.get(url, headers=self.headers, params=params)
        response.raise_for_status()
        return response.json()

    def search_locations(self, name, locale="en-gb"):
        return self._get("/v1/hotels/locations", {"name": name, "locale": locale})

    def get_search_filters(self, dest_id, dest_type, checkin, checkout):
        return self._get("/v1/hotels/search-filters", {
            "locale": "en-gb",
            "dest_id": dest_id,
            "dest_type": dest_type,
            "checkin_date": checkin,
            "checkout_date": checkout,
            "room_number": 1,
            "adults_number": 2,
            "filter_by_currency": "USD",
            "order_by": "popularity",
            "units": "metric"
        })

    def search_hotels(self, dest_id, dest_type, checkin, checkout,
                      filters=None, page=0):
        params = {
            "locale": "en-gb",
            "dest_id": dest_id,
            "dest_type": dest_type,
            "checkin_date": checkin,
            "checkout_date": checkout,
            "room_number": 1,
            "adults_number": 2,
            "page_number": page,
            "filter_by_currency": "USD",
            "order_by": "review_score",
            "units": "metric"
        }
        if filters:
            params["categories_filter_ids"] = filters
        return self._get("/v1/hotels/search", params)

    def get_hotel_full_info(self, hotel_id):
        """Get comprehensive hotel information"""
        info = {}

        # Basic data
        info['data'] = self._get("/v1/hotels/data",
                                  {"locale": "en-gb", "hotel_id": hotel_id})

        # Photos
        info['photos'] = self._get("/v1/hotels/photos",
                                    {"locale": "en-gb", "hotel_id": hotel_id})

        # Facilities
        info['facilities'] = self._get("/v1/hotels/facilities",
                                        {"locale": "en-gb", "hotel_id": hotel_id})

        # Reviews
        info['reviews'] = self._get("/v1/hotels/reviews", {
            "locale": "en-gb",
            "hotel_id": hotel_id,
            "sort_type": "SORT_MOST_RELEVANT"
        })

        # Policies
        info['policies'] = self._get("/v1/hotels/policies",
                                      {"locale": "en-gb", "hotel_id": hotel_id})

        return info

# ============ Main ============
if __name__ == "__main__":
    api = BookingAPI(RAPIDAPI_KEY)

    # Search destination
    print("🔍 Searching for Barcelona...")
    locations = api.search_locations("Barcelona")
    dest = locations[0]
    print(f"   Found: {dest['label']}")

    # Get available filters
    print("\n📊 Getting search filters...")
    filters = api.get_search_filters(
        dest['dest_id'], dest['dest_type'],
        "2027-01-01", "2027-01-03"
    )
    print(f"   Available filter categories: {len(filters)}")

    # Search with filters (4-star hotels with free cancellation)
    print("\n🏨 Searching 4-star hotels with free cancellation...")
    hotels = api.search_hotels(
        dest['dest_id'], dest['dest_type'],
        "2027-01-01", "2027-01-03",
        filters="class::4,free_cancellation::1"
    )

    print(f"   Found {hotels.get('count', 0)} hotels")
    for h in hotels.get('result', [])[:3]:
        print(f"   - {h.get('hotel_name')} (Rating: {h.get('review_score')})")

    # Get full info for top hotel
    if hotels.get('result'):
        hotel_id = hotels['result'][0]['hotel_id']
        print(f"\n📋 Getting full info for hotel {hotel_id}...")
        full_info = api.get_hotel_full_info(hotel_id)

        print(f"   Name: {full_info['data'].get('name')}")
        print(f"   Photos: {len(full_info['photos'])}")
        print(f"   Facilities: {len(full_info['facilities'])}")
        print(f"   Reviews: {len(full_info['reviews'].get('result', []))}")

Example 5: Pagination Helper ​

Python Example ​

python
import requests
from typing import List, Dict, Any

RAPIDAPI_KEY = "YOUR_RAPIDAPI_KEY"
BASE_URL = "https://booking-com.p.rapidapi.com"

headers = {
    "X-RapidAPI-Key": RAPIDAPI_KEY,
    "X-RapidAPI-Host": "booking-com.p.rapidapi.com"
}

def get_all_hotels(dest_id, dest_type, checkin, checkout,
                   max_pages=10) -> List[Dict[str, Any]]:
    """Fetch all hotels using pagination"""
    all_hotels = []
    page = 0

    while page < max_pages:
        url = f"{BASE_URL}/v1/hotels/search"
        params = {
            "locale": "en-gb",
            "dest_id": dest_id,
            "dest_type": dest_type,
            "checkin_date": checkin,
            "checkout_date": checkout,
            "room_number": 1,
            "adults_number": 2,
            "page_number": page,
            "filter_by_currency": "USD",
            "order_by": "popularity",
            "units": "metric"
        }

        response = requests.get(url, headers=headers, params=params)
        data = response.json()

        hotels = data.get('result', [])
        if not hotels:
            break

        all_hotels.extend(hotels)
        print(f"Page {page}: {len(hotels)} hotels (Total: {len(all_hotels)})")
        page += 1

    return all_hotels

# Usage
if __name__ == "__main__":
    # Get all hotels in Amsterdam (first 5 pages)
    hotels = get_all_hotels(
        dest_id="-2140479",  # Amsterdam
        dest_type="city",
        checkin="2027-01-01",
        checkout="2027-01-03",
        max_pages=5
    )

    print(f"\nTotal hotels collected: {len(hotels)}")

    # Sort by price
    sorted_hotels = sorted(
        [h for h in hotels if h.get('min_total_price')],
        key=lambda x: x['min_total_price']
    )

    print("\nTop 5 cheapest hotels:")
    for h in sorted_hotels[:5]:
        print(f"  {h['hotel_name']}: ${h['min_total_price']}")

JavaScript Example ​

javascript
const axios = require('axios');

const RAPIDAPI_KEY = 'YOUR_RAPIDAPI_KEY';
const BASE_URL = 'https://booking-com.p.rapidapi.com';

/**
 * Fetch all hotels using pagination
 */
async function getAllHotels(destId, destType, checkin, checkout, maxPages = 10) {
    const allHotels = [];
    let page = 0;

    while (page < maxPages) {
        try {
            const response = await axios.get(`${BASE_URL}/v1/hotels/search`, {
                headers: {
                    'X-RapidAPI-Key': RAPIDAPI_KEY,
                    'X-RapidAPI-Host': 'booking-com.p.rapidapi.com'
                },
                params: {
                    locale: 'en-gb',
                    dest_id: destId,
                    dest_type: destType,
                    checkin_date: checkin,
                    checkout_date: checkout,
                    room_number: 1,
                    adults_number: 2,
                    page_number: page,
                    filter_by_currency: 'USD',
                    order_by: 'popularity',
                    units: 'metric'
                }
            });

            const hotels = response.data.result || [];
            if (hotels.length === 0) break;

            allHotels.push(...hotels);
            console.log(`Page ${page}: ${hotels.length} hotels (Total: ${allHotels.length})`);
            page++;

        } catch (error) {
            console.error(`Error on page ${page}:`, error.message);
            break;
        }
    }

    return allHotels;
}

// Usage
async function main() {
    const hotels = await getAllHotels(
        '-2140479',  // Amsterdam
        'city',
        '2027-01-01',
        '2027-01-03',
        5  // max pages
    );

    console.log(`\nTotal hotels collected: ${hotels.length}`);

    // Sort by price
    const sorted = hotels
        .filter(h => h.min_total_price)
        .sort((a, b) => a.min_total_price - b.min_total_price);

    console.log('\nTop 5 cheapest hotels:');
    sorted.slice(0, 5).forEach(h => {
        console.log(`  ${h.hotel_name}: $${h.min_total_price}`);
    });
}

main().catch(console.error);

FAQ ​

How to search for the nearest hotels by coordinates? ​

Use the Search hotels by coordinates endpoint:

GET /v1/hotels/search-by-coordinates?latitude=51.5074&longitude=-0.1278&...

Does the API provide online booking and cancellation? ​

The API allows you to find hotels and rooms, then get a booking link to complete the reservation on Booking com:

https://secure.booking.com/book.html?hotel_id=7292334&checkin=2021-09-14&interval=2&stage=1&nr_rooms_729233401_325315371_3_0_0=1

Why doesn't currency filtering work correctly? ​

Prices and currency filters are always in the hotel's local currency. For example, if the hotel operates in Euros, prices will be displayed in Euros regardless of the currency parameter.

How do I paginate results? ​

Use the page_number parameter to navigate through result pages. Start with page_number=0 and increment for subsequent pages.


Support ​

We’re dedicated to providing the best API products.