Documentation Python quickstart Blog Free tools Enterprise solutions hello@quanticdata.ioLog in

Collectors · Travel

Booking.com scraper API in Python

Booking.com properties around a place or address for your dates — nightly price, discount, review score, stars. One POST from Python with check_in_date and check_out_date, rows back as JSON with 41 fields, $0.02 per delivered property. No proxies or parsers to maintain.

A Python requests snippet that posts {
A Python requests call to the booking_stays collector returns one dict per property, at $0.02 each.

First call

Install, call, read the rows.

pip install requests
The only dependency.
import os, requests

r = requests.post(
    "https://api.quanticdata.io/v1/scraper/collectors/booking_stays/run",
    headers={"Authorization": f"Bearer {os.environ['QD_API_KEY']}"},
    json={
        "check_in_date": "<check_in_date>",
        "check_out_date": "<check_out_date>",
    },
    timeout=120,
)
r.raise_for_status()
run = r.json()["payload"]
print(run["count"], "rows,", run["cost"]["usd"], "USD")
for row in run["results"]:
    print(row.get("name"), row.get("property_id"), row.get("price"), row.get("price_value"))
Python: one Booking.com stays run, printing name, property_id, price, price_value

The key comes from an environment variable, never from the code. The run answers in the same request when it finishes in time; payload.results holds the rows and payload.cost what they cost.

Request parameters

What the collector takes.

Input of the Booking.com stays collector
ParameterTypeRequiredMeaning
locationstringnoCity, area or street address, e.g. "Roma, Italia" or "12 Marine Parade, Napier, New Zealand". Resolved to coordinates first; pass latitude/longitude instead to skip that step.
latitudenumbernoAlternative to location.
longitudenumbernoAlternative to location.
check_in_datestringyesYYYY-MM-DD
check_out_datestringyesYYYY-MM-DD (after check-in)
adultsintegerno (default 2)Guests (1-30).
roomsintegerno (default 1)Rooms (1-10).
currencystringnoPrice currency (EUR, USD, NZD...).
countrystringnoISO 3166-1 alpha-2 code — proxy exit geo and Google locale (gl). Omit for the default pool.
langstringnoInterface language (hl), e.g. en, it, de.
max_resultsintegernoHow many properties to deliver at most (1–100). You pay only for delivered properties.

Response fields

41 fields per property.

Fields of each row (property)
FieldTypeWhat it holds
rankinteger1-based position in Booking's order.
namestringProperty name.
property_idintegerBooking's own property id.
pricestringNightly price as shown.
price_valuenumberNumeric price for the stay requested, taxes and fees included.
currencystringCurrency of the price.
strikethrough_valuenumberPrice before the discount, when Booking shows one.
discount_pctintegerDiscount implied by the two prices.
review_scorenumberGuest score out of 10.
review_wordstringBooking's word for that score.
review_countintegerNumber of reviews.
starsintegerStar class; 0 on apartments and B&Bs that have none.
room_typestringThe unit Booking recommends for this stay.
areastringNeighbourhood as Booking names it.
distance_mintegerMetres from the point you searched — how close this competitor actually is.
distance_textstringThe distance as Booking phrases it.
free_cancellationbooleanBooking shows a free-cancellation badge on this offer.
breakfast_includedbooleanBreakfast is included in this price.
rooms_left_at_priceintegerScarcity Booking declares: "we have N left at this price".
taxes_includedbooleanWhether the price already includes taxes and charges — without it two prices are not comparable.
sustainabilitybooleanProperty carries a sustainability certification.
preferredbooleanBooking "Preferred" partner.
quality_classintegerBooking's own 1-5 quality rating, for properties with no star class.
latitudenumberProperty latitude.
longitudenumberProperty longitude.
countrystringCountry code.
checkin_fromstringEarliest check-in time.
checkout_untilstringLatest check-out time.
photostringMain photo URL.
photosstring[]Every photo Booking returned for the card.
check_in_datestringEcho of the request.
check_out_datestringEcho of the request.
nightsinteger, nullableNights of the stay.
price_per_nightnumber, nullableStay total divided by the nights.
unit_typestring, nullableKind of unit from the room label: "Entire apartment", "Private room", "Private suite", "Hotel room"…
size_m2number, nullableUnit size in m² when the label states it.
bedsinteger, nullableBeds in the recommended unit.
bedroomsinteger, nullableBedrooms, when the label states them.
bathroomsinteger, nullableBathrooms, when the label states them.
photo_largestring, nullableThe main photo at up to 1024×768.
urlstring, nullableLink that opens the property on booking.com for the same dates and guests.

Add ?format=csv to the runs endpoint to get the same rows as CSV.

Long runs

Run in the background, then poll.

A run that needs more time can go to the background: send "async": true, get 202 with the run id, and poll the runs endpoint until the status is done. Reading a run is free.

import os, time, requests

H = {"Authorization": f"Bearer {os.environ['QD_API_KEY']}"}
r = requests.post("https://api.quanticdata.io/v1/scraper/collectors/booking_stays/run", headers=H,
                  json={**{"check_in_date":"<check_in_date>","check_out_date":"<check_out_date>"}, "async": True}, timeout=30)
run_id = r.json()["payload"]["run_id"]
while True:
    run = requests.get(f"https://api.quanticdata.io/v1/scraper/collectors/runs/{run_id}", headers=H, timeout=30).json()["payload"]
    if run["status"] in ("done", "failed"):
        break
    time.sleep(5)
print(run["status"], run["count"])
Python: background run and polling

Errors

What can come back, and what is billed.

Collector run errors
StatusMeaningBilled
400The input does not match the collector (payload.errors)No
401Missing or wrong API keyNo
402Balance and free credit do not cover the run: top upNo
422The input can never resolve; retrying the same input cannot helpNo
424The run failed at the source (blocked, timed out, layout changed); safe to retryNo
429Rate limit or a per-account brake; wait for Retry-AfterNo

Only delivered rows are billed: a run that delivers nothing costs nothing.

Price

$0.02 per delivered property.

What Booking.com stays rows cost at list price
RowsCost
1$0.02
1,000$20.00
10,000$200.00

Up to 100 properties per run; split larger jobs into several runs. The $2 free credit every month covers about 100 properties. No subscription; paid tiers lower the unit price. All collector prices: collector pricing.

Before you run it

Questions developers ask

Is there a free Booking.com stays API?

Every account gets $2 of free usage each month, about 100 properties of this collector at $0.02 each, with no card.

Do I have to handle proxies, retries or blocks?

No. The collector runs on our network and handles them; a run blocked at the source returns 424 and is not billed.

How many rows can one run return?

Up to 100 properties per run (the max_results input, where the collector has one).

Can an AI agent run it?

Yes: the MCP server exposes it as the run_collector tool, with the same input and price. See the MCP server.

Run it on the free credit.

Create an API key, export it as QD_API_KEY and run the example. $0.02 per delivered property, no subscription.