# Habitaclia Listings Scraper (`piotrv1001/habitaclia-listings-scraper`) Actor

The Habitaclia Listings Scraper exports property listings from any Habitaclia search: price, rooms, bathrooms, area, energy rating, amenities, address and coordinates, photos and the agency name, phone and email. Ideal for Catalonia rental and sale market research.

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

## Pricing

from $1.50 / 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 Listings Scraper

Export property listings from [Habitaclia](https://www.habitaclia.com), the leading real estate portal in Catalonia. The **Habitaclia Listings Scraper** turns any Habitaclia search (pisos, casas, áticos, locales or terrenos, for sale or rent, in any town or district) into structured data: price and price reduction, rooms, bathrooms, built area, floor, condition, energy rating, amenities, street address with map coordinates, the full description, photos and **the agency's name, phone and email**. Use it for rental market analysis, price monitoring, investment research or agency lead lists.

### ✨ Features

- 🔎 **Any search you can build on Habitaclia**: paste the results URL after choosing operation, property type, location, price, size, rooms or sort order. Every page of that search is collected.
- 📞 **Agency contact**: agency trade name and legal name, website, Habitaclia profile URL, phone and email on every listing.
- 📍 **Location down to the map pin**: street address, neighbourhood, district, town, comarca and province, plus latitude and longitude (`addressPrecision` says whether the pin is the exact street or the zone).
- 📐 **Property details**: rooms, bathrooms, built and plot area, construction year, floor, orientation, heating, condition, energy consumption and emissions labels, and the list of amenities (lift, parking, terrace, pool...).
- 💶 **Prices**: asking price and the amount it was reduced by.
- ♻️ **No duplicates**: listings shared by overlapping searches are returned and charged once.

### 🛠️ How It Works

1. **Search on Habitaclia** – Open [Habitaclia](https://www.habitaclia.com/comprar/viviendas/barcelona-provincia/barcelona-capital/s), set the location and filters you want and copy the URL of the results page.
2. **Paste the URL(s)** – Add one or more search URLs. A URL ending in `/s/3` starts from page 3.
3. **Set a limit** – `maxItems` caps the total number of listings (default 50).
4. **Run it** – Listings arrive page by page; the `SUMMARY` record shows, for each search, how many results Habitaclia reported and how many were collected.

### ⚙️ Input

| Field | Description |
|---|---|
| `startUrls` | Habitaclia search results URLs, e.g. `https://www.habitaclia.com/comprar/viviendas/barcelona-provincia/barcelona-capital/s`. |
| `maxItems` | Maximum number of listings across all searches. Default 50. |
| `proxyConfiguration` | Apify Proxy; the default (Spanish residential) works. |

```json
{
    "startUrls": [
        { "url": "https://www.habitaclia.com/comprar/viviendas/barcelona-provincia/barcelona-capital/s" },
        { "url": "https://www.habitaclia.com/alquiler/viviendas/barcelona-provincia/barcelona-capital/s?minPrice=1000&maxPrice=2000" }
    ],
    "maxItems": 500
}
```

### 📊 Sample Output Data

```json
{
    "id": "c42ee303-4088-457b-bc3d-65129ad6ce06",
    "reference": "454540",
    "url": "https://www.habitaclia.com/alquiler/planta-intermedia/gracia/barcelona-capital/c42ee303-4088-457b-bc3d-65129ad6ce06/d",
    "title": "Piso de 3 habitaciones en alquiler en La Salut, Barcelona",
    "transaction": "rent",
    "price": 1620,
    "priceReduction": null,
    "propertyType": "flat",
    "propertySubtype": "flat",
    "condition": null,
    "isNewDevelopment": false,
    "rooms": 3,
    "bathrooms": 1,
    "builtArea": 70,
    "landArea": null,
    "constructionYear": null,
    "floor": null,
    "orientation": null,
    "heating": "NON_SPECIFIED",
    "energyConsumption": null,
    "energyEmissions": null,
    "features": [
        "FURNISHED",
        "AIR_CONDITIONER",
        "INTERNET",
        "BALCONY",
        "EQUIPPED_KITCHEN"
    ],
    "address": "Av. del Coll del Portell",
    "neighbourhood": "La Salut",
    "district": "Gràcia",
    "municipality": "Barcelona Capital",
    "region": "Barcelonès",
    "province": "Barcelona",
    "latitude": 41.411701269033216,
    "longitude": 2.1537089548996846,
    "addressPrecision": "ZONE",
    "description": "Bienvenido a este impresionante apartamento de 3 habitaciones en alquiler en La Salut, Barcelona. Este apartamento, bellamente amueblado, ofrece comodidad y …",
    "publisherName": "Spotahome",
    "publisherLegalName": "Spotahome",
    "publisherWebsite": "http://www.spotahome.com/",
    "publisherUrl": "https://www.habitaclia.com/inmobiliaria/spotahome-5/",
    "phone": "+34910000000",
    "email": "fotocasaspotahome@robot.zapier.com",
    "images": [
        "https://static.fotocasa.es/images/ads/636da16b-02cd-41b0-81a9-739f294fcb71?rule=original",
        "https://static.fotocasa.es/images/ads/849c026e-3ce8-4934-8926-4237b75729eb?rule=original"
    ],
    "updatedAt": "2026-08-13T20:35:32.3269642+02:00",
    "searchUrl": "https://www.habitaclia.com/alquiler/viviendas/barcelona-provincia/barcelona-capital/s/3?minPrice=1000&maxPrice=2000",
    "scrapedAt": "2026-10-10T10:00:54.202Z"
}
```

### 💰 Pricing

This Actor uses pay-per-event pricing:

| Event | Price |
|---|---|
| Listing returned to the dataset | $0.0015 ($1.50 per 1,000) |
| Actor start (once per run) | $0.00005 |

Examples: 100 listings cost $0.15005, 1,000 listings cost $1.50005. You pay only for listings delivered to the dataset; repeats are never charged. Set a maximum cost per run in Apify Console and the Actor stops when it is reached.

### ❓ FAQ

**Does it return phone numbers and emails?**
Yes, the agency `phone` and `email` that Habitaclia attaches to each listing.

**How many listings can I get from one search?**
Habitaclia serves roughly the first 10,000 results of a search (about 344 pages); past that it shows page 1 again. The Actor detects this, stops, and the status message tells you to split the search with filters (district, price range, property type) to get the rest.

**Can I monitor new listings?**
Yes. Schedule the Actor with a search sorted by newest and compare `id`s between runs; `updatedAt` shows when each listing was last updated.

**Is scraping Habitaclia legal?**
The Actor collects publicly visible listing data. Make sure your use of it complies with Habitaclia's terms and with data-protection law (GDPR), especially for contact details.

*Keywords: habitaclia scraper, habitaclia API, pisos en alquiler Barcelona, viviendas en venta Cataluña, precios de alquiler, inmobiliarias.*

# Actor input Schema

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

Habitaclia search results pages, copied from the browser after choosing operation (buy/rent), property type, location, price, size, rooms or any other filter and sort. Every page of each search is collected. A URL ending in /s/3 starts from page 3.

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

Stop after this many listings across all searches. Each listing is returned once even when several searches include it.

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

Habitaclia works best from Spanish residential connections; the default works.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.habitaclia.com/comprar/viviendas/barcelona-provincia/barcelona-capital/s"
    }
  ],
  "maxItems": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "ES"
  }
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "startUrls": [
        {
            "url": "https://www.habitaclia.com/comprar/viviendas/barcelona-provincia/barcelona-capital/s"
        }
    ],
    "maxItems": 50,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "ES"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("piotrv1001/habitaclia-listings-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 = {
    "startUrls": [{ "url": "https://www.habitaclia.com/comprar/viviendas/barcelona-provincia/barcelona-capital/s" }],
    "maxItems": 50,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "ES",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("piotrv1001/habitaclia-listings-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 '{
  "startUrls": [
    {
      "url": "https://www.habitaclia.com/comprar/viviendas/barcelona-provincia/barcelona-capital/s"
    }
  ],
  "maxItems": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "ES"
  }
}' |
apify call piotrv1001/habitaclia-listings-scraper --silent --output-dataset

```

## MCP server setup

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