DEV Community

Cover image for Google Hotels API in Python: hotel prices for any city, no API key
Monkey.D.Scraping
Monkey.D.Scraping

Posted on Fully Autonomous

Google Hotels API in Python: hotel prices for any city, no API key

I needed hotel prices for a few cities, for specific dates, as JSON. The usual answer to "is there a Google Hotels API?" is: sort of. Google's own hotel APIs are for hotels publishing their prices, and the SERP providers that expose Google Hotels want a subscription and a key before you see a single row.

So I built one on Apify that you call with a city and get hotels back. Disclosure up front: it's my tool, and an AI assistant helped me draft this post. All numbers below come from one real run I did today.

What one call returns

Input: a city, dates, currency. Output: one row per hotel.

{
  "recordType": "hotel",
  "destination": "Lisbon",
  "rank": 2,
  "hotelName": "Moxy Lisbon City",
  "checkIn": "2026-12-11",
  "checkOut": "2026-12-13",
  "nights": 2,
  "currency": "USD",
  "nightlyFromDisplayed": 80,
  "stayTotalFromDisplayed": 187,
  "rating": 4.4,
  "reviewCount": 1004,
  "hotelClass": 3,
  "amenities": ["Breakfast ($)", "Free Wi-Fi", "Parking ($)", "Outdoor pool", "Air conditioning", "Pet-friendly", "Bar", "Restaurant"]
}
Enter fullscreen mode Exit fullscreen mode

Turn on room offers and every hotel also comes with its rates on each booking site. More on that below, it's the fun part.

Google Hotels API in Python

You need a free Apify account and its API token. Nothing from Google.

pip install "apify-client>=3"
export APIFY_TOKEN=your_token
Enter fullscreen mode Exit fullscreen mode
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])

run = client.actor("monkey.d.scraping/google-hotels-room-offers").call(
    run_input={
        "destinations": ["Lisbon"],
        "checkIn": "2026-12-11",
        "checkOut": "2026-12-13",
        "currency": "USD",
        "includeRoomOffers": True,
        "maxOffersPerHotel": 10,
    }
)

rows = list(client.dataset(run.default_dataset_id).iterate_items())
hotels = [r for r in rows if r["recordType"] == "hotel"]
offers = [r for r in rows if r["recordType"] == "offer"]

# well-rated hotels under $130 a night
picks = sorted(
    (h for h in hotels if (h["rating"] or 0) >= 4.5 and (h["nightlyFromDisplayed"] or 1e9) <= 130),
    key=lambda h: h["nightlyFromDisplayed"],
)
for h in picks:
    print(f'{h["hotelName"]:<45} ${h["nightlyFromDisplayed"]:>4.0f}/night  {h["rating"]} ({h["reviewCount"]})')
Enter fullscreen mode Exit fullscreen mode

What came back for Lisbon:

Hotel Per night Total, 2 nights Rating
137 Lux Residence $80 $187 4.5 (1,172)
Boutique Chiado Apartments & Suites $98 $196 4.6 (435)
Blue Liberdade Hotel $106 $225 4.8 (736)
Altis Grand Hotel $106 $255 4.7 (6,626)
Hotel Portugal - Portugal Boutique Hotel $111 $253 4.7 (1,271)
Patio São Vicente Guest Houses $113 $257 4.9 (357)
Hotel Britania Art Deco Lisboa $124 $271 4.8 (653)
1908 Lisboa Hotel $124 $271 4.7 (688)

Prefer plain HTTP? Same thing with curl:

curl -X POST "https://api.apify.com/v2/acts/monkey.d.scraping~google-hotels-room-offers/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"destinations":["Lisbon"],"currency":"USD"}'
Enter fullscreen mode Exit fullscreen mode

Same room, different price on every booking site

This is the part I like. With includeRoomOffers on, each hotel gets one row per offer: booking site, room name, nightly price, stay total, free cancellation and deadline when the site states them.

Brown's Avenue Hotel, same two nights, "Contemporary Standard Small Room":

Booking site Stay total
Booking.com $377
Expedia.com $395
Hotels.com $395
Travelocity.com $395
Hotels.com, free cancellation until Dec 9 $415

$38 between the cheapest and the flexible rate, for the same room. If you work in revenue management you already know this as rate shopping and parity checks; if you're building a travel app, it's your comparison table for free.

Run it twice on the same stay and it also gives you a list of price changes (JSON and CSV), so a daily schedule turns into a hotel price tracker.

What it costs

$0.003 per run plus $0.05 per 1,000 results, where a result is one hotel or one room offer.

The Lisbon run above returned 20 hotels and 155 room offers in 69 seconds. Total: $0.012. A plain city search with 20 hotels is about $0.004. The Apify free plan covers a lot of experimenting.

Use it from an AI agent (MCP)

The Actor is also available through the Apify MCP server, so Claude, Cursor or any MCP client can call it. Prompts that work:

  • "Find hotels in Barcelona for 12–14 March under 150 euros with a rating above 4.3."
  • "Compare the room rates of Hotel Britania in Lisbon across booking sites, free cancellation only."

FAQ

Is there an official Google Hotels API? Google's hotel APIs are for accommodation partners publishing their own rates. To read public prices of any hotel, you need a tool like this one or a SERP API provider.

Do I need a Google API key? No. Only an Apify token.

Which currencies? EUR, USD, GBP, CHF, JPY, CAD, AUD, CNY, INR.

Can I search by neighbourhood or hotel type? Yes, write it like a Google search: "hotels near Colosseum Rome", "hostels in Lisbon", "Paris 5-star hotels".

Links

If you try it on a city where something looks off, tell me in the comments. Boring job, but I want it done well.

Top comments (0)