Habitaclia.com Real Estate Scraper (Spain)
Pricing
from $0.43 / 1,000 list-tier listings
Habitaclia.com Real Estate Scraper (Spain)
Public Habitaclia.com property listings from search results: price, rooms, baths, area, location, agency, photos, and optional detail page. No start fee.
Pricing
from $0.43 / 1,000 list-tier listings
Rating
0.0
(0)
Developer
Stone Jade
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
2 days ago
Last modified
Categories
Features
Share
Extract structured residential property listings from Habitaclia.com, one of Spain's leading real estate portals, directly into clean JSON, CSV, Excel, or API pipelines. Collect asking rents and sale prices, room and bathroom counts, built and land area, multi-level Spanish locations, energy efficiency ratings, amenities, photos, and public agency contacts—with zero run-start fees and lightweight 256 MB HTTP execution.
Overview & Key Features
Habitaclia.com Real Estate Scraper extracts public rent (/alquiler/.../s) and sale (/comprar/.../s) property listings as well as direct detail URLs (/…/{uuid}/d) by reading the structured window.__INITIAL_PROPS__ JSON payload embedded directly in public Habitaclia pages—no headless browser needed.
Unlike many property portals where search cards omit key metadata, Habitaclia search result pages (~29 listings per page, paginated via /s and /s/N) already include rich descriptions, energy certificate ratings and CO2 emissions, feature tags, photo galleries, and public agency contacts. Leaving scrapeDetails off captures the complete search-card payload at full speed, while enabling scrapeDetails: true re-fetches each public detail page to confirm the detail embed.
Key Capabilities
- Zero start fee, flat transparent pricing: Both list-tier (
listing) and detail-tier (listing-detail) events cost $0.0005 per result ($0.50 per 1,000 listings on the Free tier, with 5%–15% Apify Store subscription discounts for Bronze through Diamond), with $0.00 start fee. - Rich list-tier payloads out of the box: Even with
scrapeDetails: false, each row captureslistingId,legacyNumericId,reference,title,price,currency,pricePeriod,rooms,baths,area_m2,landArea_m2,floor,constructionYear,propertyType,propertySubtype,propertyStatus,operation,city,district,neighborhood,province,address,zipCode,lat,lon,agency,agent,agencyWebsite,isPrivateOwner,phones,emails,energyRating,energyValue,energyEmissionsRating,energyEmissionsValue,features,photos,description, and canonicalurl. - Built-in privacy filtering (Privacy Policy A): Public commercial agency phone numbers, emails, and websites printed in
__INITIAL_PROPS__are retained, while private owner (particular) phone numbers and email addresses are automatically dropped (isPrivateOwner: truerows always outputphones: []andemails: []). The Actor never calls disallowed phone-reveal or AJAX endpoints. - Page-ordered output & graceful truncation: Even when
concurrencyis increased up to3, rows are saved in page order, duplicate listing UUIDs across overlapping seeds are skipped without charging, and early stops append a single unchargedrecordType: "run-notice"row plus a completeOUTPUTsummary in the Key-Value Store.
Common Use Cases
- Spanish residential market & rent benchmarking: Compare monthly rents (
operation: "rent",pricePeriod: "month") and sale prices (operation: "sale") across Barcelona, Madrid, Valencia, Seville, Málaga, or any province/municipality on Habitaclia.com. - Energy certificate & building quality analytics: Analyze
energyRating,energyValue,energyEmissionsRating,energyEmissionsValue,constructionYear,propertyStatus, andfeatures(ELEVATOR,TERRACE,AIR_CONDITIONER,PRIVATE_PARKING, etc.) across neighbourhoods. - Agency & portfolio intelligence: Track brokerage inventory using
agency,agent,agencyWebsite,reference, andlegacyNumericId. - Geospatial housing maps: Use
lat,lon,district,neighborhood,city, andprovincecoordinates for GIS mapping and local comp engines.
Input Configuration
All input fields are optional. Running with an empty input ({}) automatically scrapes Habitaclia's public rental apartment searches (viviendas) in both Barcelona and Madrid (https://www.habitaclia.com/alquiler/viviendas/barcelona-provincia/barcelona-capital/s and https://www.habitaclia.com/alquiler/viviendas/madrid-provincia/madrid-capital/s) up to 50 listings total.
| Parameter | Type | Default | Constraints | Description |
|---|---|---|---|---|
startUrls | array<object | string> | Barcelona + Madrid rental searches | Public habitaclia.com search (/…/s or /…/s/N) or detail (/…/{uuid}/d) URLs | Search result URLs or direct listing detail URLs. Accepts Request List { "url": "..." } objects or plain URL strings. |
maxItems | integer | 50 | Min 1, Max 2000 | Maximum number of charged listings to collect across all seeds before stopping cleanly. |
maxPages | integer | null (unlimited) | Min 1, Max 2000 | Optional cap on search result pages fetched per list seed (~29 listings per page). |
startPage | integer | 1 | Min 1, Max 2000 | First search page number when the start URL does not already specify /s/N. |
scrapeDetails | boolean | false | true / false | Re-fetches each listing's public detail page to confirm the detail embed (tier: "detail"). Charged as listing-detail instead of listing. Failed detail fetches preserve the list row (detailError) charged as listing. |
requestDelayMs | integer | 1200 | Min 1200 | Minimum interval in milliseconds between HTTP request starts. A Crawl-delay directive in robots.txt can only raise this gap. |
concurrency | integer | 1 | Min 1, Max 3 | Maximum search or detail requests in flight simultaneously. Rows are still emitted in page order while spacing request starts by at least requestDelayMs. |
maxRunSeconds | integer | 3600 | Min 30 | Graceful run-time budget in seconds. Stops ahead of platform timeout, writes OUTPUT, and appends an uncharged run-notice row when truncated. |
proxyConfiguration | object | { "useApifyProxy": false } | Apify Proxy config | Direct connection by default. Do not default to residential proxies. If a RESIDENTIAL proxy group is used, transfer is strictly capped at a fixed 5 MB per run (not user-tunable). |
useProxyFallback | boolean | false | true / false | When a proxy is configured, remain on a direct connection until repeated HTTP 403 or 429 responses occur, then switch to the configured proxy. Recommended whenever using residential proxies. |
allowDetailOnResidential | boolean | false | true / false | When using a RESIDENTIAL proxy group, detail pages stay on direct connections by default. Enable only if detail requests should also route through the residential proxy within the 5 MB cap. |
Example 1: List-Tier Search (Barcelona & Madrid Rentals)
Fast list-tier collection of up to 200 rental listings across Barcelona and Madrid directly from search result pages:
{"startUrls": [{"url": "https://www.habitaclia.com/alquiler/viviendas/barcelona-provincia/barcelona-capital/s"},{"url": "https://www.habitaclia.com/alquiler/viviendas/madrid-provincia/madrid-capital/s"}],"maxItems": 200,"maxPages": 4,"startPage": 1,"scrapeDetails": false,"requestDelayMs": 1200,"concurrency": 1,"proxyConfiguration": {"useApifyProxy": false}}
Example 2: Sale Search with Detail-Embed Confirmation & Direct Listing URL
Collect homes for sale (comprar) in Valencia alongside a specific listing URL with scrapeDetails: true and proxy fallback enabled:
{"startUrls": [{"url": "https://www.habitaclia.com/alquiler/planta-intermedia/carrer-del-capita-arenas-3/les-corts/barcelona-capital/014dca68-1aa8-4b49-b049-13b2a036824f/d"},{"url": "https://www.habitaclia.com/comprar/viviendas/valencia-provincia/valencia-capital/s"}],"maxItems": 100,"scrapeDetails": true,"requestDelayMs": 1500,"concurrency": 2,"maxRunSeconds": 1800,"useProxyFallback": true,"proxyConfiguration": {"useApifyProxy": false}}
Output Data & Dataset Schema
Preview Table
The table below shows sample rows combining the 2026-10-26 Barcelona test fixture structure with illustrative examples to show how fields map across rental and sale listings.
| Listing ID | Title | Price | Currency | Period | Rooms | Baths | Area (m²) | City / District | Agency |
|---|---|---|---|---|---|---|---|---|---|
014dca68-1aa8-4b49-b049-13b2a036824f | ¡Vive en el Corazón de Barcelona en este Exclusivo y Luminoso Piso con Terraza! | 5,300 | EUR | month | 5 | 3 | 232 | Barcelona Capital / Les Corts | REVEL |
00000000-0000-4000-8000-000000000001 | Bright 3-bedroom flat with terrace (illustrative) | 1,850 | EUR | month | 3 | 2 | 95 | Barcelona / Eixample | Example Agency |
00000000-0000-4000-8000-000000000002 | Renovated 4-bedroom family flat (illustrative) | 495,000 | EUR | null | 4 | 2 | 135 | Madrid / Salamanca | Example Estates S.L. |
Illustrative JSON Output Example
The JSON record below matches .actor/dataset_schema.json using an illustrative listing structure based on the 2026-10-26 Barcelona fixture (private-owner listings output isPrivateOwner: true, phones: [], and emails: []):
{"listingId": "014dca68-1aa8-4b49-b049-13b2a036824f","legacyNumericId": "9863004320227","reference": "CA3","title": "¡Vive en el Corazón de Barcelona en este Exclusivo y Luminoso Piso con Terraza!","price": 5300,"currency": "EUR","pricePeriod": "month","rooms": 5,"baths": 3,"area_m2": 232,"landArea_m2": null,"floor": "SIXTH","constructionYear": 1983,"propertyType": "flat","propertySubtype": "flat","propertyStatus": "ALMOST_NEW","operation": "rent","city": "Barcelona Capital","district": "Les Corts","neighborhood": "Pedralbes","province": "Barcelona","address": "Carrer del Capità Arenas 3","zipCode": "08034","lat": 41.3892013,"lon": 2.1265986,"agency": "REVEL","agent": "Revel","agencyWebsite": "https://agency.example","isPrivateOwner": false,"phones": ["+34900000000"],"emails": ["contact@example.com"],"energyRating": "F","energyValue": 133,"energyEmissionsRating": "F","energyEmissionsValue": 33,"features": ["ELEVATOR","AIR_CONDITIONER","BALCONY","PRIVATE_PARKING"],"photos": ["https://images.example.com/habitaclia/photo-1.jpg","https://images.example.com/habitaclia/photo-2.jpg"],"description": "Exterior flat with lift, terrace, and clear views in Pedralbes.","url": "https://www.habitaclia.com/alquiler/planta-intermedia/carrer-del-capita-arenas-3/les-corts/barcelona-capital/014dca68-1aa8-4b49-b049-13b2a036824f/d","publicationDate": null,"page": 1,"position": 1,"listUrl": "https://www.habitaclia.com/alquiler/viviendas/barcelona-provincia/barcelona-capital/s","tier": "list","scrapedAt": "2026-10-26T00:00:00.000Z"}
Full Dataset Field Reference
Every property declared in .actor/dataset_schema.json is listed below. Fields may be null or omitted when unpublished by the source or when specific to run-notice truncation records.
| Field | Type | Tier | Description |
|---|---|---|---|
listingId | string | null | List, Detail | Stable Habitaclia listing UUID (raw.id). Absent on run-notice rows. |
legacyNumericId | string | null | List, Detail | Legacy numeric listing ID cast to string when published. |
reference | string | null | List, Detail | Agency or publisher internal reference code when published (e.g. "CA3"). |
title | string | null | List, Detail | Public listing headline / title. |
price | number | null | List, Detail | Asking rent or sale price numeric amount. |
currency | string | null | List, Detail | ISO currency code ("EUR" is assumed for Spanish listings when the embed omits a currency). |
pricePeriod | string | null | List, Detail | Billing period ("month" for operation: "rent"; null for operation: "sale"). |
rooms | number | null | List, Detail | Number of bedrooms/rooms when published. |
baths | number | null | List, Detail | Number of bathrooms when published. |
area_m2 | number | null | List, Detail | Built surface area (builtSurface) in square metres (m²). |
landArea_m2 | number | null | List, Detail | Plot/land area (landArea) in square metres when published. |
floor | string | number | null | List, Detail | Floor as a number or published code such as "THIRD", "SIXTH", or "GROUND". |
constructionYear | number | null | List, Detail | Year of construction when published. |
propertyType | string | null | List, Detail | Building type label as published (e.g. "flat", "house"). |
propertySubtype | string | null | List, Detail | Property subtype label when published. |
propertyStatus | string | null | List, Detail | Condition/status code when published (e.g. "ALMOST_NEW"). |
operation | string | null | List, Detail | Normalized transaction type: "rent" or "sale" (derived from transaction.type or URL path). |
city | string | null | List, Detail | Municipality or city name (e.g. "Barcelona Capital"). |
district | string | null | List, Detail | Municipal district name (e.g. "Les Corts", "Eixample"). |
neighborhood | string | null | List, Detail | Neighbourhood (barrio) name when published (e.g. "Pedralbes"). |
province | string | null | List, Detail | Spanish province name (e.g. "Barcelona", "Madrid"). |
address | string | null | List, Detail | Display address or street name + number when published. |
zipCode | string | null | List, Detail | Spanish postal code when published. |
lat | number | null | List, Detail | Latitude coordinate when published. |
lon | number | null | List, Detail | Longitude coordinate when published. |
agency | string | null | List, Detail | Real estate agency trade name or publisher name. |
agent | string | null | List, Detail | Public publisher/contact name on the listing. |
agencyWebsite | string | null | List, Detail | Publisher website URL when published. |
isPrivateOwner | boolean | null | List, Detail | true when the advertiser is a private individual (particular); false for commercial agencies. |
phones | array<string> | null | List, Detail | Public commercial phone numbers printed in the embed/description; always [] for private owners under Privacy Policy A. |
emails | array<string> | null | List, Detail | Public commercial email addresses printed in the embed/description; always [] for private owners. |
energyRating | string | null | List, Detail | Energy consumption efficiency rating letter ("A"–"G") when published. |
energyValue | number | null | List, Detail | Energy consumption value (kWh/m² year) when published. |
energyEmissionsRating | string | null | List, Detail | CO2 emissions rating letter ("A"–"G") when published. |
energyEmissionsValue | number | null | List, Detail | CO2 emissions numeric value (kg CO2/m² year) when published. |
features | array<string> | null | List, Detail | Published amenity/feature codes (e.g. "ELEVATOR", "TERRACE", "AIR_CONDITIONER"). |
photos | array<string> | null | List, Detail | Public photo URLs extracted from listing multimedia metadata. |
description | string | null | List, Detail | Plain-text listing description when published. |
url | string | null | List, Detail | Canonical public Habitaclia listing detail URL (…/{uuid}/d). |
publicationDate | string | null | List, Detail | Publication timestamp when exposed; current Habitaclia embeds omit it, so this field is normally null. |
page | integer | null | List, Detail (from list) | Search results page number where the listing was found; null for direct detail seeds. |
position | integer | null | List, Detail (from list) | One-based position of the listing on its search results page; null for direct detail seeds. |
listUrl | string | null | List, Detail | Search URL where the listing was discovered, or the direct detail URL for detail seeds. |
tier | string | null | List, Detail | Extraction tier: "list" for a search-card row or "detail" when merged with a fetched detail page. |
scrapedAt | string | null | List, Detail | ISO 8601 UTC timestamp recording when the row was scraped. |
detailError | string | null | List (fallback) | Present only when scrapeDetails: true failed for that listing and the list row was preserved at the listing rate. |
recordType | string | null | Run-notice | Set to "run-notice" on the single uncharged truncation notice; omitted on listing rows. |
truncatedAfter | integer | null | Run-notice | Total number of charged listing rows saved before the truncated run stopped. |
reason | string | null | Run-notice | Stop reason copied from OUTPUT.stopReason ("maxItems", "max-charge-reached", "run-time-limit", "proxy-budget", "cloudflare-challenge", "empty-page", or "errors"). |
Dataset Views & Key-Value Store Summary
- Dataset Views: Includes a pre-configured Overview (
overview) table in Apify Console displayinglistingId,title,price,currency,operation,rooms,baths,area_m2,city,neighborhood,agency,tier, and clickableurl. Export cleanly to JSON, CSV, Excel, XML, or Parquet. - Key-Value Store —
OUTPUT: Every run writes a full JSON summary under keyOUTPUTcontaining normalized input, pricing events, seed statuses,siteTotalEntries,pushedcounts,listSource,unavailableFields,httpstats,robotsstats,robotsDisallowedHits,errors,stopReason, andtruncated.
Pricing & Apify Store Tier Discounts
This Actor uses Pay-Per-Event (PPE) billing in USD (live pricing verified 2026-11-21) with no run-start fee ($0.00). Apify Store subscription plans automatically apply 5% to 15% tier discounts on every event:
| Event | Description | Free | Bronze (5% off) | Silver (10% off) | Gold (15% off) | Platinum (15% off) | Diamond (15% off) |
|---|---|---|---|---|---|---|---|
listing | One Habitaclia.com listing from a public search page | $0.0005 ($0.50/1k) | $0.000475 ($0.475/1k) | $0.00045 ($0.45/1k) | $0.000425 ($0.425/1k) | $0.000425 ($0.425/1k) | $0.000425 ($0.425/1k) |
listing-detail | One listing confirmed from its detail page (replaces listing) | $0.0005 ($0.50/1k) | $0.000475 ($0.475/1k) | $0.00045 ($0.45/1k) | $0.000425 ($0.425/1k) | $0.000425 ($0.425/1k) | $0.000425 ($0.425/1k) |
Cost Comparison & Billing Guarantees
- ~50% lower cost vs. benchmark: On the Free tier, 1,000 Habitaclia listings cost $0.50 ($0.425 on Gold/Platinum/Diamond) with $0.00 start fee—half the $1.00005 per 1,000 results benchmark of
trev0n($0.001× 1,000 +$0.00005start fee). - No double-charging on details:
listing-detailreplaceslistingfor that row; the two events are never charged together on a single listing. - Graceful detail fallback: If a detail page fails while
scrapeDetails: true, the Actor keeps the list row (withdetailError) and charges onlylisting. - Zero charge on non-results: Deduplicated listings, uncharged
run-noticerows, and failed runs with zero scraped listings incur $0.00 in event charges. - Always check the live Pricing tab in Apify Console for any separately billed platform compute or storage usage.
API & SDK Quickstart
Call Habitaclia.com Real Estate Scraper (Stone_JadeX/habitaclia-com-scraper) programmatically from JavaScript or Python using the official Apify API client libraries.
JavaScript (Node.js) — ApifyClient
import { ApifyClient } from 'apify-client';const client = new ApifyClient({token: process.env.APIFY_TOKEN,});const run = await client.actor('Stone_JadeX/habitaclia-com-scraper').call({startUrls: [{ url: 'https://www.habitaclia.com/alquiler/viviendas/barcelona-provincia/barcelona-capital/s' },{ url: 'https://www.habitaclia.com/alquiler/viviendas/madrid-provincia/madrid-capital/s' },],maxItems: 50,scrapeDetails: false,requestDelayMs: 1200,concurrency: 1,});const { items } = await client.dataset(run.defaultDatasetId).listItems();const listings = items.filter((row) => row.recordType !== 'run-notice');console.log(`Collected ${listings.length} listings`);for (const item of listings.slice(0, 5)) {console.log(item.listingId, item.title, item.price, item.currency, `${item.area_m2} m2`);}
Python — ApifyClient
import osfrom apify_client import ApifyClientclient = ApifyClient(os.environ["APIFY_TOKEN"])run = client.actor("Stone_JadeX/habitaclia-com-scraper").call(run_input={"startUrls": [{"url": "https://www.habitaclia.com/alquiler/viviendas/barcelona-provincia/barcelona-capital/s"},{"url": "https://www.habitaclia.com/alquiler/viviendas/madrid-provincia/madrid-capital/s"},],"maxItems": 50,"scrapeDetails": False,"requestDelayMs": 1200,"concurrency": 1,})items = [row for row in client.dataset(run["defaultDatasetId"]).iterate_items()if row.get("recordType") != "run-notice"]print(f"Collected {len(items)} listings")for item in items[:5]:print(item.get("listingId"), item.get("title"), item.get("price"), item.get("currency"), item.get("city"))
FAQ, Compliance & Limitations
Is it legal to scrape Habitaclia.com?
This Actor reads only publicly available listing pages and the public window.__INITIAL_PROPS__ JSON payload served in a normal browser session, without logging in or bypassing access controls. To protect personal privacy, phone numbers and email addresses belonging to private owners (isPrivateOwner: true) are automatically stripped, retaining only publicly published commercial contacts of real estate agencies. You are responsible for ensuring your downstream use complies with applicable law (including GDPR) and Habitaclia's terms of use. This is an independent tool and is not affiliated with Habitaclia.
How does the Actor handle robots.txt and login/account pages?
At startup, the Actor fetches https://www.habitaclia.com/robots.txt, parses User-agent: * rules scoped to www.habitaclia.com, and honors any Crawl-delay value higher than requestDelayMs. Standard search list paths (/s and /s/N) and detail pages (/…/{uuid}/d) are parsed without calling disallowed phone-reveal, AJAX, or captcha endpoints (/solicitud/vertelefono*, /phone-validation*). If a requested URL matches a Disallow rule, it is still requested, logged as a warning and counted in robotsDisallowedHits. Login and account URLs are always refused and never requested.
How do proxy fallback and the 5 MB residential cap work?
Direct connections (proxyConfiguration.useApifyProxy: false) are used by default, and residential proxies should never be configured as a default. When an Apify Proxy group is provided:
- Enable
useProxyFallback: trueto stay on direct connections until repeated HTTP403or429responses trigger fallback. - When a
RESIDENTIALproxy group is used, proxy transfer is hard-capped at 5 MB per run (not user-configurable). If the projected next request would exceed 5 MB, the run stops cleanly withstopReason: "proxy-budget". - Detail requests remain on direct connections by default when a residential proxy group is configured unless
allowDetailOnResidential: trueis explicitly turned on.
What are the main limitations?
- Habitaclia.com only: Input validation restricts
startUrlsstrictly to publichabitaclia.comsearch (/…/s,/…/s/N) and detail (/…/{uuid}/d) URLs. - Ceiling vs. guarantee:
maxItemsdefaults to50and is capped at2,000(matchingmaxPagesandstartPage). Actual output depends on live search inventory and site availability. - Source-omitted metadata: Habitaclia embeds often omit
transaction.price.currency(assumed"EUR"for Spanish listings) and do not expose a stablepublicationDatefield (leftnullwhen unpublished). - Anti-bot & snapshot semantics: Cloudflare challenges (
HTTP 403) stop the run cleanly withstopReason: "cloudflare-challenge". Each run provides a point-in-time snapshot rather than live monitoring.
Changelog
0.1.1 — 2026-11-21
- Added explicit
prefilldefaults (startUrls,maxItems,startPage,scrapeDetails,requestDelayMs,concurrency,maxRunSeconds,useProxyFallback,allowDetailOnResidential) and organized.actor/input_schema.jsoninto clearsectionCaptiongroups. - Upgraded
README.mdto full Store documentation with complete 11-parameter input table + 2 JSON examples, illustrative JSON output, full 49-field dataset reference, live Pay-Per-Event pricing with Apify Store subscription tier discounts (Bronze through Diamond), JavaScript & PythonApifyClientSDK quickstarts, and alignedrobots.txtwarn-only compliance wording.
0.1.0 — 2026-10-26
- Initial Habitaclia.com real estate scraper supporting list and optional detail tiers via
window.__INITIAL_PROPS__,/sand/s/Npagination, Privacy Policy A contact filtering, fixed 5 MB residential proxy safety cap, and flat$0.0005PPE pricing with zero start fee.