How to scrape Idealista
Extract typed JSON from Idealista property pages: price, size in m2, rooms, bathrooms, location and listing type, with managed rendering for DataDome.
- Site:
- idealista.com
- Difficulty:
- Hard
- Rendering:
- JavaScript-rendered
- Anti-bot:
- DataDome, device fingerprint verification, sliding-puzzle CAPTCHA, behavioral and IP analysis
What you can extract from Idealista
These are the fields teams most often pull from idealista.com, and why a hand-written selector for each one tends to break over time.
| Field | Type | Why selectors break |
|---|---|---|
| price | number | The headline price sits in a span like .info-data-price whose class hashes change between deploys, and the value is a localized string such as '320.000 EUR' using dots as thousands separators, so a CSS selector returns text you must still strip and reparse, and price-on-request listings render a word instead of a number. |
| size_m2 | number | Surface area is one unlabeled item inside a generic .info-features list shared with rooms and floor, with no stable per-field class, so a positional selector silently grabs the rooms value when a listing omits size, and the 'm2' suffix and Spanish decimal comma must be stripped before it is a usable number. |
| rooms | number | Room count appears as 'X hab.' in the same flat .info-features span list as size and floor, ordered differently for plots, garages and rooms-for-rent, so an index-based CSS selector that works on a flat in Madrid maps to the wrong attribute on a parking space or studio with no separate bedroom. |
| bathrooms | number | Bathroom count is frequently absent from the summary card and only shown in the detail 'Caracteristicas basicas' block, so a selector targeting the card returns nothing for many listings, and when present it is plain text like '2 baños' with no numeric attribute to read directly. |
| location | string | The location combines a neighborhood heading and a breadcrumb trail rendered after JavaScript hydration, with exact street often masked to 'zona' for privacy, so a single CSS selector captures either too little (just the district) or stale server-rendered placeholder text before the client fills it in. |
| listing_type | string | Whether a page is venta, alquiler or alquiler de habitacion is encoded in the URL slug and a small badge, not in any consistent labeled element, so a CSS selector cannot reliably distinguish a sale from a long-term rental, and seasonal or transfer listings reuse the same markup with different meaning. |
The schema-first approach
Instead of maintaining selectors, you hand Extracto a JSON schema describing the shape you want. Here is a schema that works for Idealista:
{
"price": "number",
"size_m2": "number",
"rooms": "number",
"bathrooms": "number",
"location": "string",
"listing_type": "string"
} - 1
Describe the Idealista fields you want
Write a small JSON schema listing the fields to pull from idealista.com (for example price, size_m2, rooms). No CSS selectors or XPath needed.
- 2
Send the URL and schema to Extracto
POST the Idealista page URL and your schema to the Extracto API. Extracto renders the page in a real browser, handling JavaScript and dynamic content automatically.
- 3
Get schema-validated JSON back
Extracto returns JSON that matches your schema exactly, validated before it leaves the API, so your pipeline never receives broken or partial data.
Common pitfalls when scraping Idealista
- DataDome serves a sliding-puzzle CAPTCHA and a device-fingerprint verification screen even at normal browsing speed, so a naive fetch returns the challenge HTML rather than the listing. Extracto handles rendering and the managed anti-bot layer, but you should still keep volume modest and respect robots.txt rather than hammering region pages.
- Idealista is heavily geo-aware: the same listing URL can return different content, currency formatting or a block depending on the exit region, so results extracted from one location may not match what a Spanish visitor sees. Treat the listing's own language path (/en/ versus the default Spanish) as part of the URL identity.
- Prices and surface areas use Spanish locale formatting, dots for thousands and commas for decimals, plus 'm2' and 'EUR' suffixes. If you type these fields as number, expect Extracto to return the parsed numeric value and to return null when a listing shows 'a consultar' instead of a price, rather than guessing a figure.
- A single Idealista URL is one listing or one search page, not the whole region. Extracto extracts the page you give it and does not crawl pagination or follow 'next' links, so plan to enumerate the listing URLs you are entitled to access yourself and call the API once per page.
- Bathroom and exact-floor data are often missing from summary cards and only present on the detail page, so requesting them from a search-results URL legitimately yields null. Point the call at the individual property URL when you need those fields populated.
Is it legal to scrape Idealista?
Idealista's terms of service restrict automated access and bulk reuse of its listing content, and the site is one of the most actively defended real-estate portals in Spain, fronted by DataDome. Before extracting anything, read https://www.idealista.com/robots.txt and the Condiciones de Uso, and treat both as binding. Idealista also publishes an official idealista/data research program and a partner API, which is the sanctioned route for licensed datasets. Keep requests to genuinely public sale and rental pages, never to login-gated agency dashboards or personal contact data, pull only the specific fields you need rather than mirroring whole regions, and keep volume modest with conservative rate limiting so you do not affect their servers. Extracto provides managed rendering and a managed anti-bot layer as infrastructure, not a license: you remain responsible for respecting Idealista's ToS, robots.txt and Spanish and EU data-protection rules (GDPR), especially around any personal data such as private-seller phone numbers. When in doubt, prefer the official idealista/data channel or seek written permission.
Extracto follows robots.txt by default and rate-limits politely. You are responsible for compliance with Idealista's terms and applicable law (GDPR, CCPA) in your use case.