Spain Tourism by Municipality Scraper (INE Mobile Phones) avatar

Spain Tourism by Municipality Scraper (INE Mobile Phones)

Pricing

from $1.00 / 1,000 result delivereds

Go to Apify Store
Spain Tourism by Municipality Scraper (INE Mobile Phones)

Spain Tourism by Municipality Scraper (INE Mobile Phones)

Monthly domestic and inbound tourists per Spanish municipality from INE mobile phone statistics, by province of origin or country. Domestic figures are the sum of the published origin-destination pairs, a lower bound, not the official total. One row per municipality, month and indicator.

Pricing

from $1.00 / 1,000 result delivereds

Rating

0.0

(0)

Developer

Steadfetch

Steadfetch

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Categories

Features

Limited permissions

Share

Returns monthly domestic and inbound tourists per Spanish destination municipality as JSON, from the experimental statistics of the Spanish National Statistics Institute (INE) that measure tourism with mobile phone positions. Domestic figures are the sum of the published origin-destination pairs (a lower bound, not the INE's official total: pairs of 30 tourists or fewer and residents of the same province are not in the source); inbound totals are the INE's own figure.

  • Source: INE, "Medicion del turismo nacional y receptor a partir de la posicion de los telefonos moviles" (public, no login, no CAPTCHA).
  • Why this Actor: the INE JSON API refuses the municipal tables of this statistic because of their volume. The municipal figures only exist as yearly Excel workbooks of 17 to 32 MB with one sheet per month and one row per origin-destination pair. The Actor finds the right workbook, reads only the month you ask for and returns tidy rows.
  • One row per destination municipality, month, indicator and breakdown: an all-origins row (domestic: sum of the published pairs, a lower bound; inbound: INE total) plus one row per province of origin (domestic) or per country of residence (inbound).
  • Coverage: every Spanish municipality the INE publishes as a destination, including those of the Canary Islands. Domestic tourism from 2019-01 to the latest month (2026-09 on 16 November 2026); inbound tourism from 2019-01 to 2025-12. The layout was checked on the 2022 and 2026 domestic files and the 2025 inbound file; a file with another layout makes the run fail with a clear error instead of returning misread rows.
  • No personal data: only aggregated counts of tourists.

What it does

  1. Reads the INEbase page of each kind you ask for (domestic, inbound or both) and finds the yearly workbook of the requested month, or of the latest month published.
  2. Downloads that workbook and reads only the sheet of that month.
  3. Emits one validated row per destination municipality, month, indicator and breakdown.

Indicators:

IndicatorKindWhat it counts
domestic_touristsinternalResidents in Spain from another province who spent the night in the municipality. Sum of the origin-destination pairs the INE publishes (see "Data notes").
inbound_touristsinboundForeign residents who spent the night in the municipality (INE total). The INE ended this series in 2025-12 and now measures inbound tourism in another statistic; this one does not continue.

Minimum input

{ "municipalityCodes": ["03031"] }

That returns domestic tourism in Benidorm (INE code 03031) for the latest published month: one total row and one row per province of origin (49 rows for 2026-09). With {} the Actor returns every destination municipality in Spain for the latest month (about 28,500 rows).

FieldTypeRequiredDescription
municipalityCodesarray of stringsnoFive-digit INE codes of destination municipalities with the leading zero, e.g. "03047" (Calp). Empty or missing means every municipality. A badly written or unknown code ("3047", 3047, "03047 ", "99999") fails the run before anything is downloaded. A valid code with no row in the file (a small municipality below the INE threshold) gives no rows and a warning in the log.
periodstringnoMonth as YYYY-MM. Missing means the latest published month of each kind. A month not published yet makes the run fail and says which is the latest available; it is never replaced by another month. Asking for inbound tourism after 2025-12 fails before downloading and says the series ends in 2025-12.
kindsarray of stringsno"internal" (domestic tourism) and/or "inbound". Default ["internal"].

Example output

{
"municipalityCode": "03047",
"municipalityName": "Calp",
"period": "2026-09",
"indicator": "domestic_tourists",
"value": 21653,
"valueNote": "sum of published crossings (lower bound)",
"unit": "persons",
"breakdown": null,
"source": "INE - Medicion del turismo a partir de telefonos moviles (estadistica experimental)",
"url": "https://www.ine.es/experimental/turismo_moviles/exp_tmov_interno_mun_2026.xlsx",
"title": "Calp (03047) - domestic_tourists - 2026-09",
"scrapedAt": "2026-11-16T12:00:00.000Z"
}

The domestic breakdown: null row is the sum of the 191 origin-destination pairs the INE published for Calp in 2026-09 (a lower bound, not the official total), which is why its valueNote says so even though value is a number. Breakdown rows of the same month:

{ "municipalityCode": "03047", "period": "2026-09", "indicator": "domestic_tourists", "value": 8371, "breakdown": { "originProvince": "Madrid", "originProvinceCode": "28" } }
{ "municipalityCode": "03047", "period": "2025-12", "indicator": "inbound_tourists", "value": 2431, "breakdown": { "country": "Reino Unido", "countryCode": "125" } }

Output fields

  • municipalityCode: INE code of the destination municipality, five digits.
  • municipalityName: official INE name (2026 list); the name in the source file for codes that no longer exist.
  • period: month, YYYY-MM.
  • indicator: domestic_tourists or inbound_tourists.
  • value: number of tourists, or null when the source hides it. For domestic_tourists it is always a sum of the published origin-destination pairs: a lower bound, not the official total.
  • valueNote: literal text of the source when value is null. On domestic_tourists rows with breakdown: null it is always "sum of published crossings (lower bound)" while value is a number. null otherwise.
  • unit: always persons.
  • breakdown: null for the all-origins row. In domestic tourism that row is the sum of the published pairs (lower bound), not the official total; in inbound tourism it is the INE total. {originProvince, originProvinceCode} for domestic rows by province of origin (also sums of published pairs); {country, countryCode} for inbound rows by country of residence (INE country name in Spanish and its 3-digit INE code).
  • source, url, title, scrapedAt: common Steadfetch envelope; url is the public INE yearly workbook the row comes from.

Pricing

Pay per event:

EventWhen it firesPrice
apify-actor-startonce per run (synthetic, automatic)0.00005 USD
apify-default-dataset-itemone validated row saved to the dataset (synthetic, automatic)0.001 USD per row = 1.00 USD per 1,000 rows

Works on the Apify free plan: about 4,999 rows for the $5 monthly credit (about 100 one-municipality runs of domestic tourism).

Only validated rows are pushed. There is no custom per-item event, so a row is never billed twice. Monitor Actors bill a monitor-check event per watched item; this extractor does not. A one-municipality run costs about 0.05 USD.

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

MeasurementValue
Calp, domestic and inbound (apify run, real source)63 rows, 28 s wall clock including tool start-up, two downloads (32 MB and 17 MB) and the courtesy pauses; peak process memory about 400 MB
Every municipality, domestic, latest month28,555 rows, 82 s wall clock (most of it writing the local dataset), peak process memory about 400 MB
Every municipality, domestic, 2026-05 (largest sheet: 84 MB of XML)30,093 rows, 158 s wall clock, peak process memory 731 MB (private bytes)
Run memory1,024 MB minimum (about 40% above the largest peak measured), 2,048 MB maximum

At 1 GB and about 30 s of platform time, a run costs roughly 0.008 GB-hours (about 0.003 USD), well below the 1 USD charged per 1,000 rows even for a one-municipality run. The platform figure has not been billed yet: no platform run has been spent on this Actor.

Development

npm install --include=dev
npm test # lint + typecheck + tests (no network, no credit)
npm run publish:check
npm run build && npm run verify:build

Tests run on the real INE workbooks (2026 domestic, 2025 inbound) cropped to the province of Alicante, and on the two INEbase pages, saved in test/fixtures/. docs/data-map.md describes the files and the crop.

Data notes

  • Statistical secrecy. The INE does not publish an origin-destination pair with 30 tourists or fewer: the row is simply missing from the file, it is not marked. Domestic totals and province rows are therefore the sum of the published pairs, a lower bound of the real figure, lower for small municipalities and distant provinces. Inbound totals are the INE's own total; country rows below the threshold are missing.
  • Domestic tourism excludes residents of the same province (the INE file only covers trips to another province).
  • If a future file marks hidden cells with text, the row has value: null and the text in valueNote, never 0.
  • Continent subtotals of the inbound file ("Total Europa", ...) are not returned; only the total and the countries.
  • Rows are matched by INE code, never by name: a province total called "Madrid" never becomes the municipality of Madrid.
  • The statistics are experimental: the INE may revise the files or change their layout. A layout the Actor does not recognise makes the run fail with a clear error instead of returning wrong numbers.

FAQ

Why is my municipality missing? Small municipalities may have no published pair above the INE threshold in a month, so they are not in the file. The run succeeds with no rows for them and logs a warning.

Why does inbound tourism stop in 2025-12? The INE ended this series; it now measures inbound tourism in another statistic. Asking for a later inbound month fails with that explanation.

Can I get several months? Run once per period. Each run downloads one yearly workbook per kind.

Does it need a proxy or a browser? No. Plain HTTP requests and a local XLSX reader that only inflates the sheet it needs.

What happens if the INE blocks the request? The run aborts with a clear error and delivers nothing: no CAPTCHA solving, no proxy evasion.

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.

Only public, aggregated statistics of the INE are read. The INE licenses its statistical information under Creative Commons Attribution 4.0 (CC BY 4.0), commercial reuse included. Because the Actor sums rows, cite it as: "Elaboracion propia con datos extraidos del sitio web del INE: www.ine.es". When you republish, keep the workbook url and the publication date shown on the INEbase page. Municipality names come from the INE list of municipalities (CC BY 4.0, "Fuente: INE, www.ine.es"). https://www.ine.es/robots.txt was checked by hand on 16 November 2026: for all user agents it disallows internal paths such as /cgi-bin/, /buscar/, /Test/ and /Admin/, and does not disallow /dynt3/inebase/ (the index pages) or /experimental/ (the workbooks), the only paths this Actor requests. The Actor does not read robots.txt at run time. It sends an honest User-Agent with contact information and pauses between requests. See docs/legal-gate.md. Steadfetch is not affiliated with the INE.