DEV Community

Alom Dev
Alom Dev

Posted on

Google Hotels showed me two different prices 12 seconds apart

I built a hotel price scraper on top of Google Hotels. It collects the price every booking site shows for a hotel
(Booking.com, Expedia, Agoda, the hotel's own site and so on) for each night in a date range. The obvious use is
monitoring: run it every day, alert when a price changes.

Then my own monitoring test kept failing, and the reason is worth knowing if you work with hotel prices at all.

The test

The test is simple. Run the monitor twice in a row. The second run should return almost nothing, because prices
don't change in a few seconds.

The second run came back with 36 of 69 rows "changed". I assumed a bug in my comparison code. It wasn't. When I
looked at the rows, every one of them really had a different price. Same hotel (a Novotel in Paris), same night,
same booking site, 12 seconds apart: 347 the first time, 401 the second. Another site went from 270 to 315.

Google Hotels doesn't show one price. It shows a price for that request: which connection it came from, which
session, possibly which test bucket. Ask again from somewhere else and you can get a noticeably different number.

What this means in practice

If you monitor prices, some of the "changes" you see are this variation, not a real price move. A few ways to deal
with it:

  • Compare against a threshold, not equality. A 2% wobble is noise; a 15% jump on one site while the others stay put is worth a look.
  • Look at several sites together. If only one site moved, it's probably the request. If the hotel's own site and two OTAs moved the same way, it's real.
  • Sample more than once before you act on a single reading, especially for rate parity complaints.

The first date that had no prices

Another surprise: when you price one hotel over a range of nights, the very first night sometimes came back with no
prices at all, while the next night had 35 booking sites. The first lookup goes through a different request than the
rest of the range, and that request occasionally answers without its price section.

The scraper used to report that night as "no offers", which is wrong and also invisible, because the run still said
everything was fine. Now it asks the prices call once more before deciding a date really has no offers. Small thing,
but a monitor that silently drops a night is worse than one that fails loudly.

The tool

Disclosure: this is my Google Hotels Scraper on Apify. It searches
hotels in a city with prices for your dates, or tracks specific hotels across a date range with every booking site's
price, room rates, free-cancellation deadlines and guest reviews. A price-calendar row costs $1.00 per 1,000 on
Apify's free plan and $0.60 on the bigger plans.

{
  "mode": "hotelPrices",
  "hotels": ["Novotel Paris Les Halles"],
  "checkInDate": "+14",
  "lastCheckInDate": "+43",
  "providers": ["booking.com", "expedia", "official"]
}
Enter fullscreen mode Exit fullscreen mode

I also just published a Google Flights scraper built on the same
Google Travel data, if you need flights next to hotels.

Top comments (0)