# habitaclia Scraper — Spain & Catalonia Property Listings (`yugenox/habitaclia-scraper`) Actor

Scrape habitaclia.com homes for sale and rent by town, district or province: price, price drops, m², bedrooms, bathrooms, floor, condition, energy certificate, features, address, coordinates, photos, agency name, phone and e-mail. Never collects private sellers' contacts. No login.

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

## Pricing

from $0.80 / 1,000 listings

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## habitaclia Scraper: Spain and Catalonia property listings

Scrape **habitaclia.com**, the leading property portal in Catalonia that also covers the rest of Spain, by town, city, district or province. Every listing comes with the **price, price drop, size in m², price per m², bedrooms, bathrooms, floor, condition, orientation, heating, energy certificate (rating and kWh/m²), features, address, neighbourhood, district, coordinates, photos, the full description and the agency's name, company name, phone, e-mail, website and its own reference**. Homes, parking, commercial premises, offices, land and industrial units, for sale or for rent. No login, no cookies, no habitaclia account.

### What you get

| | |
|---|---|
| **Listing** | ID, URL, title, sale / rent, property type and subtype (flat, penthouse, duplex, house, chalet…), new build or not, promoted or not |
| **Price** | Price in euros (monthly for rentals), the price before the latest drop, price per m² |
| **Property** | Built area m², plot m², bedrooms, bathrooms, floor, condition, orientation, heating |
| **Energy** | Energy rating A–G with kWh/m² per year, CO₂ rating with kg/m² per year |
| **Features** | Lift, air conditioning, terrace, balcony, pool, parking, storage room, furnished, equipped kitchen… |
| **Location** | Address, street, neighbourhood, district, town, province, region, latitude/longitude and how precise they are |
| **Media** | Photo URLs (full size), photo count, video and virtual-tour flags |
| **Agency** | Trade name, company name, phone, e-mail, website, habitaclia page, logo, the agency's own reference |

Listings from **private sellers** (particulares) are included without the seller's name, phone or e-mail, or leave them out with **Only agency listings**.

### How to use it

1. Enter one or more **locations**: a town, city or province, e.g. `Barcelona`, `Sant Cugat del Vallès`, `Girona`, `Tarragona provincia`. You can also paste a habitaclia search URL, for example a district page.
2. Choose **Buy or rent** and a **property type**.
3. Set **Max listings** and any filters, then run.

**Max listings** is the total for the run, shared fairly between your locations. Set it to `0` to get every listing of your searches. Big cities are no problem: habitaclia shows at most about 10,000 results per search, so the scraper splits a bigger search into price ranges and still gets them all.

#### Input examples

Flats for sale in Barcelona from €400,000 with at least 3 bedrooms:

```json
{
  "locations": ["Barcelona"],
  "operation": "buy",
  "minPrice": 400000,
  "minBedrooms": 3,
  "maxItems": 500
}
```

Rentals in several towns, agencies only:

```json
{
  "locations": ["Sant Cugat del Vallès", "Badalona", "Sabadell"],
  "operation": "rent",
  "maxPrice": 2000,
  "onlyAgencies": true,
  "maxItems": 300
}
```

Every listing in a district, from a pasted URL:

```json
{
  "startUrls": [{ "url": "https://www.habitaclia.com/comprar/viviendas/barcelona-provincia/barcelona-capital/eixample/s" }],
  "maxItems": 0
}
```

You can also paste listing URLs (they end in `/d`) to refresh specific properties.

### Output example

```json
{
  "site": "habitaclia",
  "listingId": "13404809-a83e-4ce3-82a5-5ca5011314e1",
  "url": "https://www.habitaclia.com/comprar/atico/placa-de-la-sagrada-familia/eixample/barcelona-capital/13404809-a83e-4ce3-82a5-5ca5011314e1/d",
  "title": "Increible ático con vistas sagrada familia, 8º, exterior, luminoso, silencioso, techos bóveda",
  "operation": "sale",
  "propertyType": "flat",
  "propertySubtype": "penthouse",
  "price": 585000,
  "currency": "EUR",
  "pricePerM2": 9000,
  "areaM2": 65,
  "bedrooms": 1,
  "bathrooms": 1,
  "floor": "penthouse",
  "condition": "renovated",
  "orientation": "south",
  "heating": "electric",
  "energyRating": "E",
  "energyConsumption": 141,
  "emissionsRating": "E",
  "emissionsValue": 30,
  "features": ["Elevator", "Furnished", "Equipped kitchen", "Air conditioner", "Balcony"],
  "address": "Plaça de la Sagrada Família, Eixample, Barcelona Capital",
  "neighbourhood": "Sagrada Família",
  "district": "Eixample",
  "municipality": "Barcelona Capital",
  "province": "Barcelona",
  "region": "Cataluña",
  "latitude": 41.4031,
  "longitude": 2.1724,
  "addressPrecision": "street",
  "imageCount": 22,
  "sellerType": "agency",
  "agencyName": "AgenciaBCN Real Estate",
  "agencyLegalName": "Agencia BCN Real Estate Intermediación e Inversión S.L.",
  "agencyPhone": "+34937684437",
  "agencyEmail": "info@agenciabcn.com",
  "agencyWebsite": "https://www.agenciabcn.com/",
  "agencyReference": "Abcn197",
  "updatedAt": "2026-10-01T16:39:35.312Z",
  "searchLocation": "Barcelona"
}
```

Every row has the same columns (60 in total, see the Output tab); a value habitaclia doesn't publish is `null`. The columns are the same as in our Fotocasa Scraper, so you can combine both portals in one table.

### Use cases

- **Price monitoring**: track asking prices and price drops by neighbourhood with a daily schedule.
- **Market analysis**: price per m², energy ratings, condition and stock per district or town.
- **Agency lead lists**: which agencies list where, with their business phone, e-mail and website.
- **Investment sourcing**: filter by price, size and bedrooms across many towns at once.
- **Rental research**: monthly rents by area for yield calculations.

### FAQ

**Do I need a habitaclia account, cookies or a login?** No. The scraper reads the same public pages any visitor sees. It never logs in and needs nothing from you except a location.

**Can I get every listing in Barcelona?** Yes. habitaclia shows at most about 10,000 results per search; when a search is bigger and you ask for more, the scraper splits it into price ranges, reads each one and removes duplicates.

**How fast is it?** 30 listings per page and roughly 2 seconds per page, so 1,000 listings take a bit over a minute.

**Which places can I search?** Any town, city or province habitaclia knows. Names are looked up on habitaclia itself. A name it doesn't know is skipped, not charged, and the run's status message says so. For a district or neighbourhood, paste its habitaclia URL.

**What about private sellers?** Their listings are included without the seller's name, phone, e-mail or house number, with coordinates rounded to about 100 m, and their descriptions have phone numbers and e-mails removed. Turn on **Only agency listings** to leave them out.

**Which proxy should I use?** Keep the default (Apify Proxy, datacenter). It comes with every Apify plan, including the free one. If habitaclia refuses datacenter IPs for a while, the run switches to residential proxies when your account has them, and carries on without them when it doesn't.

**What does a run cost?** You pay per listing saved and a small fee per run. See the Pricing tab. Listings removed by your filters are never charged.

**Is it legal to scrape habitaclia?** This Actor only collects publicly available data: property listings that anyone can see on habitaclia without an account, such as prices, sizes, addresses as published, photos and the advertising agency's business details. Collecting publicly available data is generally legal, but you're responsible for how you use it. Listings can be published by private individuals; the scraper leaves out their name and contact details and removes phone numbers and e-mails from their descriptions. You must follow privacy laws such as GDPR and the Spanish LOPDGDD, as well as habitaclia's terms. If you're unsure, check with a lawyer. More on this: [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/)

**Does it access any private data?** No. Everything comes from pages habitaclia shows to any visitor without logging in. It never uses a login, never contacts advertisers, and follows habitaclia's robots.txt.

*This Actor is not affiliated with, endorsed by or sponsored by habitaclia or Adevinta. habitaclia is a trademark of its owner.*

# Actor input Schema

## `locations` (type: `array`):

Towns, cities or provinces, e.g. "Barcelona", "Sant Cugat del Vallès", "Girona", "Tarragona provincia". habitaclia is strongest in Catalonia and also covers the rest of Spain. You can also paste habitaclia search URLs here (a town, district or neighbourhood page). Each location is searched separately.

## `operation` (type: `string`):

Listings for sale or for rent.

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

Homes covers flats, penthouses, duplexes, lofts, studios and houses together.

## `maxItems` (type: `integer`):

Maximum number of listings for the whole run, shared fairly between your locations. 0 = everything.

## `startUrls` (type: `array`):

Optional: habitaclia search URLs from www.habitaclia.com (e.g. https://www.habitaclia.com/comprar/viviendas/barcelona-provincia/barcelona-capital/eixample/s) or listing URLs (they end in /d).

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

For rentals: the monthly rent.

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

Only listings priced at or below this (€). Leave empty for no limit.

## `minBedrooms` (type: `integer`):

Only listings with at least this many bedrooms. Leave empty for no limit.

## `maxBedrooms` (type: `integer`):

Only listings with at most this many bedrooms. Leave empty for no limit.

## `minBathrooms` (type: `integer`):

Only listings with at least this many bathrooms. Leave empty for no limit.

## `minSize` (type: `integer`):

Only listings whose size (m²) is at least this value. Leave empty for no limit.

## `maxSize` (type: `integer`):

Only listings whose size (m²) is at most this value. Leave empty for no limit.

## `onlyAgencies` (type: `boolean`):

Leave out listings from private sellers (particulares). Their listings are otherwise included without the seller's name, phone or e-mail.

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

Apify Proxy (datacenter) is the default and comes with every Apify plan. If habitaclia refuses datacenter IPs for a while, the run switches to residential proxies when your account has them.

## Actor input object example

```json
{
  "locations": [
    "Barcelona"
  ],
  "operation": "buy",
  "propertyType": "homes",
  "maxItems": 20,
  "onlyAgencies": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (type: `string`):

All scraped listings.

## `run` (type: `string`):

Status and statistics for this run.

## `report` (type: `string`):

RUN_REPORT: how the run ended, counts, requests and proxy use.

# 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 = {
    "locations": [
        "Barcelona"
    ],
    "maxItems": 20,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("yugenox/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 = {
    "locations": ["Barcelona"],
    "maxItems": 20,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("yugenox/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 '{
  "locations": [
    "Barcelona"
  ],
  "maxItems": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call yugenox/habitaclia-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,yugenox/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/F5yMuvye0iBkjDw7N/builds/tfnIhCE0hGXPLRHNj/openapi.json
