# Google Hotels Calendar Scraper (Spain by Municipality) (`steadfetch/google-hotels-calendar-scraper`) Actor

Lowest advertised price per night for up to 12 months for each hotel and rental Google Hotels lists in a Spanish municipality (INE code), with type, rating and rounded coordinates. You are responsible for complying with the terms of use of Google.

- **URL**: https://apify.com/steadfetch/google-hotels-calendar-scraper.md
- **Developed by:** [Steadfetch](https://apify.com/steadfetch) (community)
- **Categories:** Travel, Business
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 calendar snapshot delivereds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Google Hotels Calendar Scraper (Spain by Municipality)

Returns one calendar snapshot per accommodation that Google Hotels lists in a Spanish municipality, as JSON: the lowest advertised price per night for every day of up to twelve months, plus the property type, capacity (vacation rentals), Google rating, number of reviews and coordinates rounded to about 100 m. You give the five-digit INE code of the municipality; the Actor keeps only the accommodations whose coordinates fall inside that municipality.

- **Source:** Google Hotels (`www.google.com/travel/hotels`), read with plain HTTP requests, the same calls the Google Hotels web makes. No browser, no login, no cookies.
- **Coverage:** every Spanish municipality of the INE list (including the 88 of the Canary Islands) where Google Hotels lists accommodation.
- **No personal data:** no host names, no review authors, no addresses.
- **Output contract:** each row is a `CalendarSnapshotItem`, the snapshot shape that Steadfetch's `rental-calendar-monitor` compares between two runs to estimate nights sold.

You are responsible for complying with the terms of use of Google when you run this Actor.

### What it does

1. Validates the input before any request: a municipality code written wrong ("3047", 3047, "99999", "03047 ") or `maxListings` above 500 stops the run with an error that shows the value and the expected format.
2. Searches Google Hotels for "hoteles en <municipality>" (or "alquileres vacacionales en <municipality>" with `kind: "vacation_rentals"`) and walks the result pages, 18 by 18, until it has enough listings or the list ends.
3. Keeps only the listings inside the bounding box of the municipality (INE and IGN data). Google also lists nearby towns, and a name shared by several municipalities can resolve to another one: those listings are dropped and counted in the log, never delivered.
4. Reads the calendar of each listing in one request (365 nights) and pushes one validated row per listing as soon as it has it.
5. Saves a `CONTINUATION` record in the key-value store: `{ "nextOffset": <n or null>, "totalSeen": <n> }`. Run again with `offset: nextOffset` to get the next listings; `nextOffset` is null when there are no more. `totalSeen` is the number of accommodations inside the municipality, of the kind asked for, that this run saw in the Google list; it is not the total Google announces (the run stops reading the list once it has enough, and it includes the ones skipped by `offset`).

The pace is fixed: at least two seconds between two requests, with no input to change it. A run of 25 listings makes about 27 requests (about one minute); a run of 500 makes about 530 (about 18 minutes).

If the website stops answering with data, the run stops at once: it keeps the rows already delivered, notes in `CONTINUATION` where to go on, and fails with a message that says what it got. If Google changes the shape of its answers, the run fails with a message that names the call and the position that is missing, and never delivers rows with empty fields.

### Limits of Google Hotels

- **Prices for about eleven months.** Google only shows prices as far as its booking partners publish them: in the runs of November 2026 no accommodation had a price after 12 October 2027, and many have no price in the months they are closed. Those days are in the calendar with `price: null`. Ask for 12 months and expect the last weeks without prices.
- **Google does not tell "sold out" from "no offer".** A night without a price looks the same whether it is booked up or simply not offered. `available` is `true` when Google advertises a price and `false` otherwise; `minNights` is always null.
- **About 470 listings per query.** Google announces thousands of "results" for a town (about 7,000 for Calp, most of them vacation rentals), but one search only reaches about 470. `kind: "vacation_rentals"` runs a separate search, so `hotels` plus `vacation_rentals` reach more than `all`.

### Minimum input

```json
{ "municipalityCode": "03047" }
```

That returns the first 25 accommodations of Calp with twelve months of calendar.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `municipalityCode` | string | yes | Five-digit INE code, as a string: `"03047"` is Calp, `"29067"` is Malaga. |
| `kind` | string | no | `all` (default): hotels and the vacation rentals Google shows with them. `hotels`: hotels only. `vacation_rentals`: a separate search that returns vacation rentals only. |
| `months` | integer | no | Months of calendar from today (UTC), 1 to 12, default 12 (365 days at most). |
| `maxListings` | integer | no | Rows per run, 1 to 500, default 25. |
| `offset` | integer | no | Listings to skip in the Google order, default 0. Use `nextOffset` from the `CONTINUATION` record of the previous run. The order can change from one day to the next, so resume on the same day. |

### Example output

One row (calendar cut to five of its 365 days):

```json
{
  "url": "https://www.google.com/travel/hotels/entity/ChcIjN2S4KCZ-JB_GgsvZy8xdjh5emg3eBAB",
  "title": "Hotel Porto Calpe",
  "scrapedAt": "2026-11-16T15:16:01.461Z",
  "source": "google-hotels",
  "municipalityCode": "03047",
  "municipalityName": "Calp",
  "listingId": "ChcIjN2S4KCZ-JB_GgsvZy8xdjh5emg3eBAB",
  "propertyType": "Hotel de 3 estrellas",
  "capacity": null,
  "rating": 4.4,
  "reviewCount": 1967,
  "lat": 38.64,
  "lon": 0.07,
  "currency": "EUR",
  "calendar": [
    { "date": "2026-11-16", "available": true, "price": 46.33, "minNights": null },
    { "date": "2026-11-17", "available": true, "price": 61.11, "minNights": null },
    { "date": "2026-11-18", "available": true, "price": 47.32, "minNights": null },
    { "date": "2027-05-31", "available": true, "price": 86.4, "minNights": null },
    { "date": "2027-06-01", "available": false, "price": null, "minNights": null }
  ]
}
```

#### Output fields

| Field | Type | Description |
| --- | --- | --- |
| `url` | string | Public Google Hotels page of the accommodation. |
| `title` | string or null | Name as Google Hotels shows it. |
| `scrapedAt` | date-time | ISO 8601 UTC time when this calendar was read. |
| `source` | string | Always `google-hotels`. |
| `municipalityCode` | string | Five-digit INE code. |
| `municipalityName` | string | Official INE name. |
| `listingId` | string | Google Hotels entity ID, stable between runs. |
| `propertyType` | string or null | As Google names it, in Spanish: the hotel class (`Hotel de 4 estrellas`) or the rental type (`Apartamento Para 5 Personas`); `Hotel` or `Alquiler vacacional` when Google gives no type. |
| `capacity` | integer or null | Guests. Only vacation rentals give it; null for hotels. |
| `rating` | number or null | Google rating as Google shows it (a number, 0 or more); null when Google gives none. |
| `reviewCount` | integer or null | Number of Google reviews. |
| `lat`, `lon` | number or null | Rounded to 3 decimals. |
| `currency` | string or null | ISO 4217 code of the prices; null when the calendar has no price at all. |
| `calendar` | array | One entry per day from the run day (UTC), ascending, up to 365: `date`, `available`, `price` (lowest advertised price for one night from that date, null when there is none, never 0) and `minNights` (always null). |

For Calp on 16 November 2026 the first page had 20 accommodations inside the municipality (17 hotels, 3 vacation rentals); the five hotels read in the test run had between 100 and 283 of 365 nights with a price.

### Pricing

Pay-per-event with the two synthetic platform events: `apify-actor-start` at 0.00005 USD per run and `apify-default-dataset-item` at 0.002 USD per row, which is **2 USD per 1,000 results**. A row is one accommodation with its whole calendar. There is no custom event and no `Actor.charge()` call, so a row is never billed twice.

**Works on the Apify free plan** - about 2,499 results for the $5 monthly credit (N = floor((5.00 - 0.00005) / 0.002)).

Cost measured locally on 2026-11-16 (Node 24): 5 listings of Calp in 28 s and 5 of Malaga in 24 s, each with one listing request and five calendar requests, with a peak of 156 MB resident memory. The run time is set by the fixed pace, about 2.1 s per listing: 1,000 rows take about 35 minutes, about 0.15 compute units at 256 MB or 0.6 at 1 GB, so the price keeps a wide margin.

### FAQ

**Why is a price null?** Google shows no price for that night: the partners have no offer that far ahead (after about eleven months), the accommodation is closed for the season, or it is booked up. Google does not say which.

**What price is it?** The lowest price Google advertises for a one-night stay starting that day, in euros. It comes from the same call the date picker of the Google Hotels page makes. The request carries no number of guests, so there is no `adults` input.

**Why are there fewer rows than I asked for?** The municipality has fewer accommodations on Google Hotels, or Google listed places outside the municipality, which the Actor drops (the log says how many). A municipality with no accommodation inside its box gives zero rows and a warning, not an error.

**How do I get more than 500 rows, or the next page?** Run again with `offset` set to `nextOffset` from the `CONTINUATION` record. One search reaches about 470 listings; run `hotels` and `vacation_rentals` separately to reach more.

**Can I compare two runs?** Yes: the rows follow the snapshot contract of `rental-calendar-monitor`, which compares two snapshots of the same municipality and source.

**Does Google endorse this Actor?** No. See `docs/legal-gate.md`. Municipality codes and names: "Fuente: INE, www.ine.es" (CC BY 4.0). Municipality boxes: "Instituto Geografico Nacional (IGN), BDLJE, CC BY 4.0, via Opendatasoft".

### Maintenance

Tested daily by the Steadfetch QA run with the Calp input (`{"municipalityCode":"03047","maxListings":3}`). The calls Google Hotels uses are internal and can change without notice; when they do, the run fails with an error that names what changed instead of delivering wrong rows, and the Actor is fixed from saved real answers.

# Actor input Schema

## `municipalityCode` (type: `string`):

Five-digit INE code of the Spanish municipality, as a string. "03047" is Calp, "29067" is Malaga.

## `kind` (type: `string`):

all: hotels and the vacation rentals Google shows with them. hotels: hotels only. vacation_rentals: a separate search that returns vacation rentals only.

## `months` (type: `integer`):

How many months of calendar to read from today (UTC), 1 to 12. Twelve months give 365 days; Google publishes prices for about eleven of them.

## `maxListings` (type: `integer`):

Maximum number of accommodations (rows) per run. Fixed cap: 500.

## `offset` (type: `integer`):

How many accommodations to skip in the Google order, to resume a previous run: use nextOffset from its CONTINUATION record (key-value store).

## `proxyConfiguration` (type: `object`):

Optional. By default the Actor uses no proxy.

## Actor input object example

```json
{
  "municipalityCode": "03047",
  "kind": "all",
  "months": 12,
  "maxListings": 3,
  "offset": 0
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset items validated against the item schema in dataset_schema.json (fields).

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "municipalityCode": "03047",
    "maxListings": 3
};

// Run the Actor and wait for it to finish
const run = await client.actor("steadfetch/google-hotels-calendar-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "municipalityCode": "03047",
    "maxListings": 3,
}

# Run the Actor and wait for it to finish
run = client.actor("steadfetch/google-hotels-calendar-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "municipalityCode": "03047",
  "maxListings": 3
}' |
apify call steadfetch/google-hotels-calendar-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,steadfetch/google-hotels-calendar-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/y0PtjLxuBlfqWYaq0/builds/XzBi3gvziSQmN90Ur/openapi.json
