INE Spain Population by Municipality Scraper (Padron) avatar

INE Spain Population by Municipality Scraper (Padron)

Pricing

from $1.00 / 1,000 result delivereds

Go to Apify Store
INE Spain Population by Municipality Scraper (Padron)

INE Spain Population by Municipality Scraper (Padron)

Resident population by Spanish municipality and sex from the INE Padron municipal (official INE Tempus API). One validated row per municipality, year and indicator, for all 8,132 municipalities including the 88 of Canarias. Statistical secret kept as null plus a note.

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

5 days ago

Last modified

Categories

Features

Limited permissions

Share

Resident population of every Spanish municipality, by sex, from the INE Padron municipal (Spain's official municipal register of inhabitants), read through the INE's own public Tempus API.

  • Source: INE - Padron municipal, operation 22 (public, no login, no CAPTCHA). Source: INE, www.ine.es.
  • One row per municipality, year and indicator: total, male and female residents.
  • Coverage: all 8,132 municipalities of Spain, including the 88 of the Canary Islands, Ceuta and Melilla.
  • No personal data: only aggregated counts per municipality.

What it does

  1. Validates your input before anything is downloaded: municipality codes must be five-digit INE codes that exist, and the year must be a four-digit year.
  2. Groups the codes by province and asks the INE only for the provincial tables it needs: one request per province, with one second between requests. An empty list reads all 52 tables.
  3. Matches each series name of the INE table ("Calp. Hombres. Total habitantes. Personas.") to the INE municipality code, and emits one validated row per municipality, year and indicator.

Nothing is delivered until every table has been downloaded and every row validated, so a failed run delivers nothing.

When the INE hides a figure for statistical secrecy, the row is still delivered with value: null and valueNote: "secret". It is never turned into 0 and never dropped.

Input

{ "municipalityCodes": ["03047"] }
FieldTypeRequiredDescription
municipalityCodesarray of stringsNoFive-digit INE municipality codes, e.g. 03047 for Calp. Empty or missing means all municipalities. A malformed code (3047, 03047 , an unknown 99999) stops the run before any download, naming the value and the expected format.
periodstringNoYear as YYYY (reference date 1 January). Empty or missing means the latest year the INE has published. A monthly value such as 2026-11 is rejected. A year the INE has not published yet fails the run and names the latest available year; it is never replaced by another year.

Output

Example output

{
"url": "https://www.ine.es/jaxiT3/Tabla.htm?t=2856",
"title": "Calp - Population (female), 2025",
"scrapedAt": "2026-11-16T14:07:32.644Z",
"municipalityCode": "03047",
"municipalityName": "Calp",
"source": "INE - Padron municipal",
"period": "2025",
"indicator": "population_female",
"value": 13958,
"valueNote": null,
"unit": "persons",
"breakdown": { "sex": "female" }
}

Output fields

FieldTypeDescription
municipalityCodestringFive-digit INE code (two of province, three of municipality).
municipalityNamestringOfficial INE name.
periodstringYear (YYYY); the padron reference date is 1 January.
indicatorstringpopulation_total, population_male or population_female.
valuenumber or nullResidents. null when the INE hides the figure.
valueNotestring or nullsecret for statistical secrecy, no value when the INE has no figure; null otherwise.
unitstringAlways persons.
breakdownobject or null{"sex":"male"} or {"sex":"female"}; null for the total.
sourcestringINE - Padron municipal.
urlstringPublic INE page of the provincial table the row comes from.
titlestringReadable label of the row.
scrapedAtdate-timeISO 8601 UTC timestamp of the extraction.

Pricing

Pay-per-event with the two synthetic platform events:

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

There is no custom per-item event and no monitor-check event (this is an extractor, not a monitor), so a row is never billed twice. A run that fails delivers no rows and charges no result events.

Measured locally on 2026-11-16 with {"municipalityCodes":["03047"]} (Calp): 3 rows, about 1.8 s in Node and a 148 MB peak memory (about 17 s with the apify run wrapper). A full run over all 52 provincial tables is about 24,400 rows (8,132 municipalities x 3 indicators for one year) and takes about a minute because of the one-second pause between requests; it was estimated, not run.

Works on the Apify free plan: the 5 USD monthly credit covers about 5,000 rows (a little under: (5.00 - 0.00005) / 0.001 = 4,999), which is about 1,600 municipalities for one year (3 rows each); the full national table costs about 24 USD.

FAQ

Which municipalities are covered? All 8,132 in the INE list at 1 January 2026, including the 88 municipalities of Las Palmas and Santa Cruz de Tenerife, Ceuta and Melilla.

Which years are available? The latest year is the default. With period you can ask for earlier years of the same tables; a year the INE does not have fails with an error that names the latest year.

Why do I get fewer rows than I expected? A series whose name does not match any municipality of its province is skipped and written to the run log (warning), never guessed. The province total series is not a municipality and is also skipped.

What if the INE hides a number? The row stays with value: null and valueNote: "secret".

What if the INE blocks or answers without data? HTTP 401, 403, 429 or 451, or an HTTP 200 whose body is not data (for example "No puede mostrarse por restricciones de volumen"), fails the run with an error that names the INE. There is no browser, no proxy and no retry around a block.

Licence and attribution? The INE legal notice sets Creative Commons Reconocimiento 4.0 (CC BY 4.0) for the statistical information of its website, including commercial reuse, citing the source: "Fuente: INE, www.ine.es". Municipality codes and names come from the INE list at 1 January 2026. See docs/legal-gate.md.

Maintenance

Tested daily by Steadfetch against the live INE API with the Calp input. If the INE changes the table layout the Actor fails with an error instead of delivering wrong figures.

Development

npm install
npm test # lint + typecheck + offline tests on saved INE answers
npm run publish:check
npm run build && npm run verify:build

src/shared/ holds byte-identical copies of tools/lib/es-municipios/ (checked by test/shared-copies.test.ts). The data map is in docs/data-map.md.

Other Steadfetch Actors