# Airbnb Availability Calendar Scraper (Spain, by Municipality) (`steadfetch/airbnb-calendar-scraper`) Actor

12-month availability and minimum stay of the Airbnb listings of a Spanish municipality, chosen by INE code. One row per listing with 365 days. No prices: Airbnb does not publish them per night. No login, no host names. You are responsible for complying with Airbnb's terms.

- **URL**: https://apify.com/steadfetch/airbnb-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 result 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

## Airbnb Availability Calendar Scraper (Spain, by Municipality)

Returns a snapshot of the public Airbnb calendar of the listings of a Spanish municipality as JSON: for every listing, availability and minimum stay for each day of the next 12 months (365 days), not prices. Airbnb does not publish a price per night on the listing calendar, so `price` is always `null`.

- **Source:** [Airbnb](https://www.airbnb.es), public pages without login: the map search `/s/homes` by a box of coordinates and the calendar each listing page shows.
- **Why this Actor:** Airbnb has no public data API and its search stops at 270 results. The Actor cuts the box of the municipality into map cells small enough to page through, reads every listing once in a stable order, and asks two calendar requests per listing for a full year.
- **One row per listing**, in the shape of the Steadfetch calendar snapshot (`CalendarSnapshotItem`). Two snapshots of the same municipality on different days can be compared with [rental-calendar-monitor](https://apify.com/steadfetch/rental-calendar-monitor) to estimate the nights sold.
- **Coverage:** every Spanish municipality, including the 88 of the Canary Islands, chosen by its five-digit INE code.
- **No personal data:** no host names, no addresses, no reviews; coordinates rounded to 3 decimals (about 100 m).

### What it does

1. Takes the box of the municipality from the INE code (official INE list and IGN boundaries).
2. Searches Airbnb by that box. A box with more than 250 results is split into four quarters, and each quarter again while it holds more; empty quarters (the sea, for example) are dropped. Cells are visited west to east and south to north, depth first.
3. Pages through each cell in the order of the page cursors. A listing already seen in an earlier cell is not counted again, and a listing whose coordinates fall outside the box of the municipality is never delivered.
4. Reads the calendar of each listing (two requests for 12 months) and delivers one validated row with one entry per day from the run day (UTC).
5. Stops after `maxListings` rows and writes the `CONTINUATION` record (see below) so the next run can continue where this one stopped.

The Actor makes plain HTTP requests, with at least 2 seconds between requests and at most 500 listings per run. The query id of the Airbnb calendar changes when Airbnb updates its website: the Actor reads it from the website code at the start of each run, falls back to the last known id, and fails with an error naming the query if neither answers.

### Minimum input

```json
{ "municipalityCode": "03047", "maxListings": 3 }
```

That returns three listings of Calp (INE code 03047) with 365 days each, in about 30 seconds and 10 requests. A run of the default 25 listings takes about 2 minutes.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `municipalityCode` | string | yes | Five-digit INE code with the leading zero: `"03047"` (Calp), `"29067"` (Malaga), `"35016"` (Las Palmas de Gran Canaria). A badly written or unknown code (`"3047"`, `3047`, `"03047 "`, `"99999"`) fails the run before any request. |
| `months` | integer | no | Months of calendar from today, 1 to 12. Default 12 (365 days). Up to 11 months take one calendar request per listing; 12 take two. |
| `maxListings` | integer | no | Rows to deliver in this run. Default 25, fixed maximum 500 listings per run. |
| `offset` | integer | no | Listings to skip in the stable order. Default 0. Use the `nextOffset` of the previous run. |
| `proxyConfiguration` | object | no | Optional network setting. By default the Actor connects directly, without a proxy. |

### Example output

```json
{
  "url": "https://www.airbnb.es/rooms/46171416",
  "title": "Alojamiento SEA&DREAMS OldTown I",
  "scrapedAt": "2026-11-16T15:24:16.720Z",
  "source": "airbnb",
  "municipalityCode": "03047",
  "municipalityName": "Calp",
  "listingId": "46171416",
  "propertyType": null,
  "capacity": null,
  "rating": 4.64,
  "reviewCount": null,
  "lat": 38.644,
  "lon": 0.044,
  "currency": null,
  "calendar": [
    { "date": "2026-11-16", "available": false, "price": null, "minNights": 2 },
    { "date": "2026-11-17", "available": true, "price": null, "minNights": 2 }
  ]
}
```

The real `calendar` has 365 entries, from the run day to the same date a year later minus one day.

### Output fields

- `url`: public Airbnb page of the listing.
- `title`: title of the listing as shown in the search (typed by its host), or `null`.
- `scrapedAt`: when the calendar of this listing was read, ISO 8601 in UTC (ends in `Z`). Its date is the first day of `calendar`.
- `source`: always `airbnb`.
- `municipalityCode`, `municipalityName`: INE code and official name of the municipality searched.
- `listingId`: Airbnb listing ID, stable between runs.
- `propertyType`: the property type when the search title gives it (`"Apartamento"`), otherwise `null`. The map search Airbnb serves today usually does not show it.
- `capacity`: always `null` (neither the search nor the calendar give it).
- `rating`: average rating on Airbnb's 0-5 scale, `null` for new listings.
- `reviewCount`: number of reviews when the search shows it, otherwise `null`.
- `lat`, `lon`: position rounded to 3 decimals.
- `currency`: always `null` (there are no prices).
- `calendar`: one entry per day, ascending, without repeats, at most 365. `available` is `true` when the night can be booked; `minNights` is the minimum stay starting that night (`null` when Airbnb does not give it); `price` is always `null`, never 0.

### Resuming: the CONTINUATION record

At the end of every run, including a run that stops on an error, the Actor writes the record `CONTINUATION` to its default key-value store:

```json
{ "nextOffset": 25, "totalSeen": 36 }
```

- `nextOffset`: position of the first listing not processed, in the stable order. Run again with `"offset": 25` to get the next ones; no listing of the first 25 is repeated. `null` means there is nothing left.
- `totalSeen`: distinct listings inside the box of the municipality on the search pages this run read.

The stable order is: cells in the order of the map walk, inside each cell the pages in the order of their cursors, inside each page the order of Airbnb's answer. To reach `offset` N the Actor reads the search pages before it again (no calendars), so a resumed run spends a few search requests more.

The order is stable for the same search answers, but Airbnb ranks its results and the ranking moves: two runs a few minutes apart can list the same cell in a different order. A resumed run can then repeat or miss a few listings of the earlier run. Resume soon after the previous run and drop repeated `listingId` values when you join the datasets.

### Pricing

Pay per event:

| Event | When it fires | Price |
| ----- | ------------- | ----- |
| `apify-actor-start` | once per run (synthetic, automatic) | 0.00005 USD |
| `apify-default-dataset-item` | one validated listing saved to the dataset (synthetic, automatic) | 0.002 USD per listing = **2.00 USD per 1,000 listings** |

Works on the Apify free plan: about 2,499 listings for the $5 monthly credit.

Only validated rows are pushed. There is no custom per-item event, so a listing is never billed twice. Monitor Actors bill a `monitor-check` event per watched item; this scraper does not.

#### Cost per 1,000 results (measured locally, 16 November 2026)

| Measurement | Value |
| ----------- | ----- |
| Calp, 5 listings (`apify run`, real source) | 5 rows, 15 requests, 37 to 39 s wall clock including tool start-up; largest node process about 175 MB |
| Calp, resumed with `offset` 5, 2 listings | 2 rows, 8 requests, 27 s; none of the 5 of the previous run repeated |
| Malaga, 5 listings | 5 rows, 15 requests, 47 s wall clock; largest node process about 390 MB (apify-cli included) |
| Time per listing | about 4 s (two calendar requests at one every 2 seconds) |
| Run memory | 512 MB minimum, 1,024 MB maximum |

1,000 listings take about 70 minutes, almost all of it the pause between requests: at 512 MB that is about 0.6 GB-hours, roughly 0.25 USD of platform time, below the 2.00 USD charged. The platform figure has not been billed yet: no platform run has been spent on this Actor.

### Data notes

- **A box is a rectangle.** The box of a municipality can include edges of its neighbours (in Calp, part of Altea around Mascarat; in Malaga, part of Alhaurin de la Torre). Those listings are inside the box and are delivered with the code searched. Filter by polygon afterwards if you need the exact boundary.
- **No prices, by design.** Airbnb shows a price only for a stay with dates, not per night on the calendar. The Actor never asks one stay per day.
- **Search limit.** A map cell is split up to 8 times. A cell that still holds more than 270 listings (very dense blocks) is read up to its first 270, with a warning in the log.
- **Listings that disappear** between the search and the calendar request are skipped with a warning; the run goes on.
- The set of listings Airbnb returns changes from day to day; `listingId` is what links two snapshots.

### FAQ

**Why are there no prices?** Airbnb does not publish a price per night on its calendar. The only way to get one would be to ask a stay for every single night, which this Actor does not do.

**How do I get the whole municipality?** Run with `maxListings: 500`, then again with `offset` set to the `nextOffset` of the `CONTINUATION` record, until it is `null`. On 16 November 2026 the search counted about 2,500 results in the box of Calp.

**How do I estimate occupancy?** Take two snapshots of the same municipality on different days and compare them with rental-calendar-monitor: a night free in the first and not free in the second is counted as sold.

**Why is a listing of a neighbouring town in my results?** Because it lies inside the box of the municipality you asked for (see Data notes).

**Does it need a browser or a proxy?** No. Plain HTTP requests, no browser, no login, no cookies.

**What happens if Airbnb refuses a request?** On HTTP 401, 403, 429 or 451 the run stops at once, keeps every row already delivered, writes `CONTINUATION` with the first listing not delivered, and fails with an error naming what Airbnb answered. It does not retry those answers. A server error or a network failure is retried once.

### Maintenance

This Actor is **tested daily**: automated runs keep the source reachable and the output schema valid, and failures open an issue in this repository. Schema changes are announced through repository releases.

### Legal and use

You are responsible for complying with Airbnb's Terms of Service and the laws that apply to you when you run this Actor. It reads only public pages, without login, at a fixed pace of at least 2 seconds between requests and at most 500 listings per run, and it delivers no host names, no addresses and no reviews. If a platform or a person asks for content to be removed, Steadfetch answers within 48 hours. See `docs/legal-gate.md`. Steadfetch is not affiliated with Airbnb.

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".

# Actor input Schema

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

Five-digit INE code of the municipality, with the leading zero: "03047" for Calp, "29067" for Malaga, "35016" for Las Palmas de Gran Canaria.

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

How many months of calendar to read from today (1 to 12). 12 gives 365 days.

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

How many listings to deliver in this run. Fixed maximum: 500 per run. Use offset to continue in the next run.

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

How many listings to skip, in the stable order of the search. Put here the nextOffset of the CONTINUATION record of the previous run.

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

Optional. By default the Actor uses no proxy.

## Actor input object example

```json
{
  "municipalityCode": "03047",
  "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/airbnb-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/airbnb-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/airbnb-calendar-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,steadfetch/airbnb-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/Ex5NeZDk4aPgLdZlP/builds/KkyNndmNJug7vAZhM/openapi.json
