# INE Tourist Accommodation Scraper (Spain Hotels & Apartments) (`steadfetch/ine-alojamiento-turistico-extractor`) Actor

Monthly INE figures for tourist apartments and hotels in Spain by municipality: travellers and overnight stays by residence, bed places, occupancy, average stay, ADR and RevPAR. One validated JSON row per municipality, month and indicator. Official INE API, no login.

- **URL**: https://apify.com/steadfetch/ine-alojamiento-turistico-extractor.md
- **Developed by:** [Steadfetch](https://apify.com/steadfetch) (community)
- **Categories:** Travel
- **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

This Actor returns the monthly tourist accommodation statistics of Spain's national statistics office (INE) as one validated dataset row per municipality, month and indicator: travellers and overnight stays by residence, capacity, occupancy, average stay, average daily rate (ADR) and revenue per available room (RevPAR), for tourist apartments and for hotels.

Tested daily. Last verified: 2026-11-16

### What it does

The INE publishes its occupancy surveys by tourist point ("punto turistico"), not by municipality, and its API (Tempus) returns each figure as a series whose name mixes the point, the indicator and the residence in one text. The Actor downloads eight INE tables, reads those names, turns every tourist point into its five-digit INE municipality code and emits one row per figure:

| Survey | INE table | Indicators |
| --- | --- | --- |
| Tourist apartments | 75191 | `travellers`, `overnight_stays`, each by residence (`spain` or `abroad`) |
| Tourist apartments | 75193 | `bed_places`, `establishments` (number of apartments), `occupancy_rate_bed_places`, `occupancy_rate_units` |
| Tourist apartments | 2081 | `average_stay` |
| Hotels | 2078 | `travellers`, `overnight_stays`, each by residence |
| Hotels | 2076 | `bed_places`, `establishments` (open hotels), `occupancy_rate_bed_places`, `occupancy_rate_units` (rooms) |
| Hotels | 2077 | `average_stay` |
| Hotels | 46298 | `adr` (EUR) |
| Hotels | 46301 | `revpar` (EUR) |

Every row carries `breakdown.accommodationType` (`apartments` or `hotels`); travellers and overnight stays also carry `breakdown.residence`.

Limits you should know:

- **Coverage is by tourist point, not by every municipality.** The apartment survey covers 107 points and the hotel survey 138, 181 municipalities in all. A municipality that is not a point of a survey has no rows for it (Calp, for example, is an apartment point and not a hotel point), and the run logs one line per table that holds none of the municipalities you asked for.
- **Statistical secrecy.** When the INE hides a value it sends no number. The Actor still emits the row, with `value: null` and `valueNote: "secret"`; it never replaces a hidden value with 0.
- **One month per run.** The latest published month by default, or the month in `period`. Asking for a month the INE has not published fails the run and names the latest available month; it is never replaced by another one.
- If you ask for a month that one of the surveys has not published yet, the run fails naming the table and the latest month available. To avoid depending on a survey that lags, ask for a single accommodation type with `accommodationTypes` (`apartments` or `hotels`).
- Weekend occupancy, staff and room counts are published by the INE too but are not part of this Actor.

### How to use

1. Open the Actor in the Apify Console and start a run. Empty input returns the latest month for every tourist point, apartments and hotels (about 2,400 rows).
2. Or choose municipalities, a month and the accommodation type.
3. Or call it from the CLI:

```bash
apify call steadfetch/ine-alojamiento-turistico-extractor --input='{"municipalityCodes":["03047"],"accommodationTypes":["apartments"]}'
```

4. Read the results from the dataset.

### Input

#### Input fields

| Field | Type | Required | Default/Prefill | Description | Example |
| --- | --- | --- | --- | --- | --- |
| `municipalityCodes` | array of string | No | default `[]` (every municipality), prefill `["03047"]` | Five-digit INE municipality codes. A code without its leading zero, a number or an unknown code fails the run before anything is downloaded. | `["03047"]` |
| `period` | string | No | empty (latest published month) | Month in `YYYY-MM` format. | `2026-09` |
| `accommodationTypes` | array of string | No | default `["apartments","hotels"]`, prefill `["apartments"]` | `apartments`, `hotels`, or both. | `["apartments"]` |

#### Example input

Matches the declared `exampleRunInput` exactly:

```json
{
  "municipalityCodes": ["03047"],
  "accommodationTypes": ["apartments"]
}
```

### Output

#### Example output

Calp, tourist apartments, September 2026 (nine rows: four from table 75191, four from 75193, one from 2081):

```json
{
  "url": "https://servicios.ine.es/wstempus/js/ES/DATOS_TABLA/75191?nult=1",
  "title": "Calp: travellers (spain), apartments, 2026-09",
  "scrapedAt": "2026-11-16T14:12:14.635Z",
  "municipalityCode": "03047",
  "municipalityName": "Calp",
  "source": "INE table 75191",
  "period": "2026-09",
  "indicator": "travellers",
  "value": 2831,
  "valueNote": null,
  "unit": "persons",
  "breakdown": { "accommodationType": "apartments", "residence": "spain" }
}
```

A value the INE hides under statistical secrecy:

```json
{
  "municipalityCode": "38003",
  "municipalityName": "Alajero",
  "period": "2026-09",
  "indicator": "travellers",
  "value": null,
  "valueNote": "secret",
  "unit": "persons",
  "breakdown": { "accommodationType": "apartments", "residence": "abroad" }
}
```

#### Output fields

| Field | Type | Description |
| --- | --- | --- |
| `url` | string (uri) | INE Tempus API URL the figure was read from. |
| `title` | string | Short label: municipality, indicator, accommodation type and month. |
| `scrapedAt` | string (date-time) | ISO 8601 UTC timestamp of the run. |
| `municipalityCode` | string | Five-digit INE municipality code. |
| `municipalityName` | string | Official INE name of the municipality. |
| `source` | string | The INE table the figure comes from. |
| `period` | string | Month, `YYYY-MM`. |
| `indicator` | string | `travellers`, `overnight_stays`, `bed_places`, `establishments`, `occupancy_rate_bed_places`, `occupancy_rate_units`, `average_stay`, `adr` or `revpar`. |
| `value` | number or null | The figure; null when the INE hides it. |
| `valueNote` | string or null | `secret` when the INE hides the value, `not_available` when it sends neither a value nor a secrecy flag, otherwise null. |
| `unit` | string | `persons`, `nights`, `places`, `units`, `percent`, `eur` or `nights_per_stay`. |
| `breakdown` | object | `accommodationType` on every row; `residence` on travellers and overnight stays. |

### Pricing

Pay-per-event, the two synthetic events declared in `.actor/pay_per_event.json`:

- `apify-actor-start`: 0.00005 USD per run. The Apify-recommended default, which includes the first 5 seconds of compute per run for free.
- `apify-default-dataset-item`: 0.002 USD per row = **2 USD per 1,000 results**.

There is no custom per-item event, so a row is never billed twice. Measured on the Calp input: 9 rows, 3 INE requests, about 10 seconds including the one-second pauses between requests, peak memory 166 MB with the local TypeScript runner. A run with an empty input downloads the eight tables and returns about 2,400 rows.

**Works on the Apify free plan** - about 2,499 rows for the $5 monthly credit ((5.00 USD - 0.00005 USD run start) / 0.002 USD per row).

### Other Steadfetch Actors

- [Exceltur Tourism Indicators](https://apify.com/steadfetch/exceltur-indicadores-extractor) - Spain tourism GDP and regional impact series from Exceltur.
- [AENA Airport Statistics](https://apify.com/steadfetch/aena-estadisticas-extractor) - monthly passengers, operations and cargo of Spanish airports.
- [Canary Islands Vacation Rental Registry](https://apify.com/steadfetch/canarias-vivienda-vacacional-extractor) - registered holiday homes in the Canary Islands.

### FAQ

**Does it need an API key, a login or a proxy?**
No. The INE Tempus API is public. The Actor uses plain HTTPS, one request per table, with a one-second pause between requests. If the INE answers 401, 403, 429 or 451, or answers 200 with no data, the run fails with an error that names the INE and delivers nothing.

**Why does a municipality I asked for have no rows?**
The INE measures tourist points. Calp, for example, has tourist apartment figures and no hotel figures; Benidorm has both. The run log lists the tables that hold none of the municipalities you asked for.

**Why is `value` null?**
The INE hides figures that would reveal individual businesses (statistical secrecy). The row is kept so you can see that the figure exists but is hidden; it is never turned into 0.

**Why does the INE name differ from the municipality name?**
The INE writes tourist points in its own spelling ("Calpe/Calp", "Alfas Del Pi (L )"). The Actor matches them to the official INE municipality names and codes; a point that matches no municipality is omitted and the run logs a warning.

**Can I get older months?**
Yes: set `period` to any earlier month the INE holds. The Actor then asks the INE for that month.

**Does it collect personal data?**
No. Only aggregate tourism statistics are read.

### Data source and licence

Source: INE, www.ine.es (its occupancy statistics for tourist apartments and for hotels, by tourist point). The INE legal notice sets Creative Commons Reconocimiento 4.0 (CC BY 4.0) for the statistical information of its website, including commercial reuse with attribution; citation used here: "Elaboracion propia con datos extraidos del sitio web del INE: www.ine.es". Municipality codes and names come from the INE municipality list of 1 January 2026 (same licence). See `docs/legal-gate.md`.

### Support

Report bugs through the Actor's Apify Store page (Issues tab) or the steadfetch actors repository issues. Please include the run ID and the exact input you used.

### Maintenance

Tested daily: daily catalog QA runs the default input once the Actor is published. `npm test`, `npm run publish:check` and `apify-cli validate-schema` run in CI on every push.

# Actor input Schema

## `municipalityCodes` (type: `array`):

Five-digit INE municipality codes, for example 03047 for Calp. The INE publishes by tourist point, so a municipality that is not a point of a survey has no rows for it. Empty means every municipality.

## `period` (type: `string`):

Month to read, in YYYY-MM format, for example 2026-09. Empty means the latest month the INE has published. A month that is not published yet fails the run and says which is the latest.

## `accommodationTypes` (type: `array`):

Which surveys to read: tourist apartments, hotels, or both. Empty means both.

## Actor input object example

```json
{
  "municipalityCodes": [
    "03047"
  ],
  "period": "2026-09",
  "accommodationTypes": [
    "apartments"
  ]
}
```

# Actor output Schema

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

Dataset rows 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 = {
    "municipalityCodes": [
        "03047"
    ],
    "accommodationTypes": [
        "apartments"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("steadfetch/ine-alojamiento-turistico-extractor").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 = {
    "municipalityCodes": ["03047"],
    "accommodationTypes": ["apartments"],
}

# Run the Actor and wait for it to finish
run = client.actor("steadfetch/ine-alojamiento-turistico-extractor").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 '{
  "municipalityCodes": [
    "03047"
  ],
  "accommodationTypes": [
    "apartments"
  ]
}' |
apify call steadfetch/ine-alojamiento-turistico-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,steadfetch/ine-alojamiento-turistico-extractor"
        }
    }
}
```

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/n2Sw1a2CsyLuXe1uV/builds/PBuMbgmWkOo2mDVuy/openapi.json
