# Habitaclia.com Scraper - Spain Property Data (`parsebird/habitaclia-scraper`) Actor

Scrape Habitaclia.com Spanish real estate listings: price, area, rooms, address, coordinates, energy rating, amenities, and advertiser details. Filter by price, area, rooms. Export JSON, CSV, Excel.

- **URL**: https://apify.com/parsebird/habitaclia-scraper.md
- **Developed by:** [ParseBird](https://apify.com/parsebird) (community)
- **Categories:** Real estate, Lead generation, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 property listings

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

### Habitaclia.com Scraper - Spain Property Data

Habitaclia Scraper extracts Spanish property listings from [Habitaclia.com](https://www.habitaclia.com/) by transaction type, property category, and location, including price, area, rooms, address, coordinates, energy rating, amenities, and advertiser details.

<table><tr>
<td style="border-left:4px solid #1C1917;padding:12px 16px;font-weight:600">
Search any Spanish province or town for sale or rental listings, filter by price, area, and rooms, and get 30+ fields per property — including full image galleries, energy certificates, and coordinates pulled from each listing's detail page.
</td>
</tr></table>

##### Copy to your AI assistant

Copy this block into ChatGPT, Claude, Cursor, or any LLM to start using this actor.

```text
Use Apify Actor parsebird/habitaclia-scraper to scrape Habitaclia.com Spanish property listings. Example with ApifyClient: client.actor("parsebird/habitaclia-scraper").call(run_input={"transactionType":"sale","propertyType":"apartment","location":"barcelona","minPrice":200000,"maxPrice":600000,"maxListings":200,"maxPages":20}). Inputs: transactionType string enum sale/rent default sale; propertyType string enum apartment/housing/house/attic/duplex/office/commercial/industrial/land/parking default apartment; location string Habitaclia location slug default barcelona (e.g. madrid, valencia, palma_de_mallorca); minPrice/maxPrice integer EUR; minArea/maxArea integer m2; minRooms/maxRooms integer; advertiserType string enum all/agency/private default all; keyword string substring filter on title and description; maxListings integer default 200; maxPages integer default 20; proxyConfiguration object defaults to Residential proxies with country ES. Output fields: adId, detailUrl, title, shortDescription, description, transactionType, propertyType, price, priceCurrency, pricePerSqm, areaSqm, rooms, bathrooms, floor, energyClass, energyConsumption, energyEmissions, country, province, city, neighborhood, street, fullAddress, latitude, longitude, mainImageUrl, imageUrls, imageCount, advertiserId, advertiserName, advertiserUrl, advertiserType, hasElevator, hasParking, hasTerrace, hasPool, isFurnished, datePosted, labels, scrapedAt. API docs: https://docs.apify.com/api/client/python/ and https://docs.apify.com/api/client/js/. Token: https://console.apify.com/account/integrations.
```

### What is Habitaclia Scraper?

**Habitaclia Scraper** is a Habitaclia.com scraper and Spanish property data API alternative for real estate research, investment analysis, and market monitoring. Choose a transaction type, property category, and a Habitaclia location — a province for a region-wide search or a town for one municipality — and the actor returns one structured row per listing.

Use it to build property datasets, track a market segment over time, or feed listings into analysis tools through [Apify](https://apify.com/), without manually paging through Habitaclia's search results.

### What can Habitaclia Scraper do?

- 🏠 Search any of 10 property categories — apartments, houses, attics, duplexes, offices, commercial premises, industrial units, land, and parking — for sale or rent.
- 📍 Target a whole Spanish province or one specific town using Habitaclia's own location slugs.
- 💶 Filter results by price, surface area, and room count.
- 🏢 Filter by advertiser type: agency or private seller.
- 🔎 Filter by a keyword matched against the title and description.
- 📸 Pull each listing's full image gallery, not just the thumbnail shown in search results.
- ⚡ Extract energy certificate ratings, coordinates, amenities, and advertiser contact details from every listing's detail page.
- ⏰ Run on demand or with [Apify schedules](https://docs.apify.com/platform/schedules) for recurring market monitoring.
- 🔌 Access results through the [Apify API](https://docs.apify.com/api/v2), webhooks, and [integrations](https://apify.com/integrations).
- 💾 Download datasets as JSON, CSV, Excel, XML, or HTML from Apify storage.

### What data can you extract from Habitaclia.com?

| Field | Description |
|-------|-------------|
| `title` / `description` | Listing title and full description |
| `price` / `pricePerSqm` | Price in EUR and price per square meter |
| `areaSqm` / `rooms` / `bathrooms` | Surface area, room count, and bathrooms |
| `energyClass` / `energyConsumption` / `energyEmissions` | Energy certificate rating and figures |
| `province` / `city` / `neighborhood` / `fullAddress` | Parsed location hierarchy |
| `latitude` / `longitude` | Coordinates read from the listing's map |
| `mainImageUrl` / `imageUrls` / `imageCount` | Full-size image gallery |
| `advertiserName` / `advertiserUrl` / `advertiserType` | Agency or private seller details |
| `hasElevator`, `hasParking`, `hasTerrace`, `hasPool`, … | Amenity flags parsed from the listing's feature list |

### How to scrape Habitaclia.com property listings

1. Open [Habitaclia Scraper](https://apify.com/parsebird/habitaclia-scraper) on Apify.
2. Choose `transactionType` (sale or rent) and `propertyType`.
3. Set `location` to a Habitaclia slug — a province for a region-wide search (e.g. `barcelona`) or a town for one municipality (e.g. `sant_cugat_del_valles`).
4. Optionally add `minPrice`/`maxPrice`, `minArea`/`maxArea`, `minRooms`/`maxRooms`, `advertiserType`, or `keyword` to narrow results.
5. Set `maxListings` and `maxPages` to control how much of the search to crawl.
6. Run the actor, open the dataset, and export results as JSON, CSV, Excel, or through the [Apify API](https://docs.apify.com/api/v2).

### Input parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `transactionType` | string | No | `sale` | `sale` (Comprar) or `rent` (Alquiler). |
| `propertyType` | string | No | `apartment` | `apartment`, `housing`, `house`, `attic`, `duplex`, `office`, `commercial`, `industrial`, `land`, or `parking`. |
| `location` | string | No | `barcelona` | Habitaclia location slug, lowercase ASCII with underscores for spaces. |
| `minPrice` / `maxPrice` | integer | No | - | Price range filter in EUR (client-side). |
| `minArea` / `maxArea` | integer | No | - | Surface area filter in m² (client-side). |
| `minRooms` / `maxRooms` | integer | No | - | Room-count filter, 0–20 (client-side). |
| `advertiserType` | string | No | `all` | `all`, `agency`, or `private` (client-side). |
| `keyword` | string | No | - | Substring filter on title and description (client-side). |
| `maxListings` | integer | No | `200` | Hard cap on the number of listings saved. |
| `maxPages` | integer | No | `20` | Maximum search pages to crawl (~25 listings per page). |
| `proxyConfiguration` | object | No | Residential + ES | Apify Proxy settings. Residential with country ES is recommended and set by default. |

Example — Barcelona apartments for sale, €200k–€600k, 3+ rooms, agencies only:

```json
{
  "transactionType": "sale",
  "propertyType": "apartment",
  "location": "barcelona",
  "minPrice": 200000,
  "maxPrice": 600000,
  "minRooms": 3,
  "advertiserType": "agency",
  "maxListings": 500,
  "maxPages": 35
}
```

Example — Madrid rentals between €1,000 and €1,800:

```json
{
  "transactionType": "rent",
  "propertyType": "apartment",
  "location": "madrid",
  "minPrice": 1000,
  "maxPrice": 1800,
  "maxListings": 200,
  "maxPages": 20
}
```

### Output example

One JSON record per listing, written to the default Apify dataset. The full record includes 30+ fields, including all amenity booleans:

```json
{
  "adId": "21311004317263",
  "detailUrl": "https://www.habitaclia.com/comprar-piso-...-i21311004317263.htm",
  "title": "Piso Carrer del rosselló. Junto al passeig sant joan, finca regia de 105 m2, 3 habitacione",
  "transactionType": "sale",
  "propertyType": "apartment",
  "price": 575000,
  "priceCurrency": "EUR",
  "pricePerSqm": 5476,
  "areaSqm": 105,
  "rooms": 3,
  "bathrooms": 1,
  "energyClass": "E",
  "country": "ES",
  "province": "Barcelona",
  "city": "Barcelona",
  "neighborhood": "Dreta de l´Eixample",
  "street": "Carrer del Rosselló",
  "fullAddress": "Carrer del Rosselló, Dreta de l´Eixample, Barcelona",
  "latitude": 41.4023078,
  "longitude": 2.1695036,
  "mainImageUrl": "https://images.habimg.com/imgh/21311-4317263/...XL.jpg",
  "imageCount": 30,
  "advertiserName": "AgenciaBCN Real Estate",
  "advertiserType": "agency",
  "hasElevator": true,
  "hasHeating": true,
  "scrapedAt": "2026-08-21T12:54:52.280847+00:00"
}
```

Some fields, like `floor`, `orientation`, and `datePosted`, only appear when the source listing itself includes that structured detail — they come back `null` rather than a guessed value when Habitaclia doesn't publish them. Download results in JSON, CSV, Excel, XML, or HTML from the Apify dataset.

### Python API example

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

run = client.actor("parsebird/habitaclia-scraper").call(run_input={
    "transactionType": "sale",
    "propertyType": "apartment",
    "location": "barcelona",
    "minPrice": 200000,
    "maxPrice": 600000,
    "maxListings": 200,
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

### JavaScript API example

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });

const run = await client.actor('parsebird/habitaclia-scraper').call({
  transactionType: 'sale',
  propertyType: 'apartment',
  location: 'barcelona',
  minPrice: 200000,
  maxPrice: 600000,
  maxListings: 200,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

See Apify's official [Python client](https://docs.apify.com/api/client/python/) and [JavaScript client](https://docs.apify.com/api/client/js/) documentation for more options.

### How much does it cost to scrape Habitaclia.com?

**What is the price per listing?**

| Plan | Price per event | Price per 1,000 |
|------|----------------|-----------------|
| Free | $0.003 | **$3.00** |
| Bronze | $0.0025 | **$2.50** |
| Silver | $0.002 | **$2.00** |
| Gold | $0.0015 | **$1.50** |

Each `listing-scraped` event means one property listing was extracted and pushed to the dataset. A run collecting 1,000 listings costs $3.00 on the Free plan or $1.50 on Gold. Apify's free trial credits cover test runs.

### Use cases

- Build a dataset of Spanish for-sale or rental listings for a specific city or province.
- Track price and inventory trends in a market segment over time with scheduled runs.
- Feed listing data, coordinates, and images into a property search tool or map.
- Compare agency vs. private-seller pricing and inventory in a given area.
- Screen properties by energy rating alongside price and size.

### How it works

1. The actor validates `transactionType`, `propertyType`, `location`, and the filter and limit options.
2. It builds a Habitaclia search URL from the transaction type, property type, and location, and pages through search results up to `maxPages` or `maxListings`.
3. Each search-result page is parsed for core fields: price, area, rooms, bathrooms, advertiser type, and a short description.
4. Listings are filtered by `minPrice`/`maxPrice`, `minArea`/`maxArea`, `minRooms`/`maxRooms`, `advertiserType`, and `keyword` before any detail page is fetched, to avoid wasted requests.
5. For each listing that passes the filters, the actor opens the listing's detail page to add coordinates, energy rating, amenities, advertiser contact details, and the full image gallery.
6. It pushes one row per listing to the default Apify dataset and charges one PPE event per pushed listing on the Apify platform.

### What are the limitations of Habitaclia.com scraping?

- Habitaclia does not expose exact street numbers on most listings; `street` and `fullAddress` reflect what the listing itself publishes.
- Fields like `floor`, `orientation`, `usableAreaSqm`, and `terrainAreaSqm` depend on whether the individual listing includes that structured detail — many listings omit them.
- Client-side filters (`minPrice`, `maxArea`, etc.) are applied after each search page is fetched, so very narrow filters on a broad search may require crawling many pages to fill `maxListings`.
- Detail-page requests require Apify Residential proxies with Spain targeting for reliable access.

### Is it legal to scrape Habitaclia.com?

**Is scraping Habitaclia.com legal?**

Habitaclia Scraper reads publicly available property listing pages that Habitaclia itself serves to any visitor. Scraping publicly available data is generally allowed in many jurisdictions, but you should review Habitaclia's terms and make sure your use case complies with applicable laws. For background, read Apify's guide: [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/).

### Other Spain and European property scrapers / Related Actors

| Actor | Best for |
|-------|----------|
| [Habitaclia.com Scraper](https://apify.com/parsebird/habitaclia-scraper) | Spanish property listings and market data |
| [Fotocasa Scraper](https://apify.com/parsebird/fotocasa-scraper) | Another major Spanish real estate portal |
| [Otodom.pl Scraper](https://apify.com/parsebird/otodom-scraper) | Polish property listings |

### FAQ

**Does Habitaclia Scraper require a Habitaclia.com account?**

No login is required. The actor reads Habitaclia's public search and listing detail pages.

**How do I find a location slug?**

Search a city or province on habitaclia.com and look at the resulting URL — the slug is the lowercase, underscore-separated segment before `.htm`, for example `sant_cugat_del_valles` or `palma_de_mallorca`.

**Why do the price/area/rooms filters need a detail-page fetch?**

They don't — `minPrice`, `maxPrice`, `minArea`, `maxArea`, `minRooms`, `maxRooms`, `advertiserType`, and `keyword` are all applied using data already present on the search-results page, before any detail page is opened. Only enrichment fields like energy rating, coordinates, and the full image gallery require the extra detail-page request.

**Can I search a whole province instead of one town?**

Yes. Province-level Habitaclia slugs (like `barcelona` or `madrid`) return listings across the whole province; town-level slugs (like `sant_cugat_del_valles`) target just that municipality.

**Can I schedule recurring runs to track new listings?**

Yes. Use [Apify schedules](https://docs.apify.com/platform/schedules) to run the actor daily, weekly, or at any interval.

**Where can I report issues or request fields?**

Open the Issues tab on the actor page and include your input example, run ID, and the fields you expected.

# Actor input Schema

## `transactionType` (type: `string`):

Sale (Comprar) or rent (Alquiler).

## `propertyType` (type: `string`):

Property category to search.

## `location` (type: `string`):

Habitaclia location slug, lowercase ASCII with underscores for spaces, e.g. barcelona, madrid, valencia, palma\_de\_mallorca, sant\_cugat\_del\_valles. Province slugs search the whole province; town slugs target one municipality.

## `minPrice` (type: `integer`):

Minimum price in EUR. Applied after fetching (client-side filter).

## `maxPrice` (type: `integer`):

Maximum price in EUR. Applied after fetching (client-side filter).

## `minArea` (type: `integer`):

Minimum surface area in square meters. Applied after fetching (client-side filter).

## `maxArea` (type: `integer`):

Maximum surface area in square meters. Applied after fetching (client-side filter).

## `minRooms` (type: `integer`):

Minimum room count. Applied after fetching (client-side filter).

## `maxRooms` (type: `integer`):

Maximum room count. Applied after fetching (client-side filter).

## `advertiserType` (type: `string`):

Filter by who posted the listing. Applied after fetching (client-side filter).

## `keyword` (type: `string`):

Optional substring filter on the listing title and description. Applied after fetching (client-side filter).

## `maxListings` (type: `integer`):

Hard cap on the number of listings saved.

## `maxPages` (type: `integer`):

Maximum search-result pages to crawl. Habitaclia shows about 25 listings per page.

## `proxyConfiguration` (type: `object`):

Apify Proxy settings. Residential proxies with country ES are recommended and set by default for reliable access.

## Actor input object example

```json
{
  "transactionType": "sale",
  "propertyType": "apartment",
  "location": "barcelona",
  "advertiserType": "all",
  "maxListings": 40,
  "maxPages": 4,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "ES"
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

# 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 = {
    "transactionType": "sale",
    "propertyType": "apartment",
    "location": "barcelona",
    "maxListings": 40,
    "maxPages": 4
};

// Run the Actor and wait for it to finish
const run = await client.actor("parsebird/habitaclia-scraper").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 = {
    "transactionType": "sale",
    "propertyType": "apartment",
    "location": "barcelona",
    "maxListings": 40,
    "maxPages": 4,
}

# Run the Actor and wait for it to finish
run = client.actor("parsebird/habitaclia-scraper").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 '{
  "transactionType": "sale",
  "propertyType": "apartment",
  "location": "barcelona",
  "maxListings": 40,
  "maxPages": 4
}' |
apify call parsebird/habitaclia-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parsebird/habitaclia-scraper"
        }
    }
}

```

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/XA4Sqb3OADYwfdIeg/builds/hTRgeiFD6gqIQqh4U/openapi.json
