# Habitaclia Spain Property Scraper (`jungle_synthesizer/habitaclia-spain-property-scraper`) Actor

Scrape Habitaclia property listings across all of Spain. Prices, locations with coordinates, energy ratings, features, photos and agency contacts for homes, rentals, offices, premises, parking and land.

- **URL**: https://apify.com/jungle_synthesizer/habitaclia-spain-property-scraper.md
- **Developed by:** [BowTiedRaccoon](https://apify.com/jungle_synthesizer) (community)
- **Categories:** Real estate, Business
- **Stats:** 2 total users, 1 monthly users, 85.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.80 / 1,000 record scrapeds

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/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 Spain Property Scraper

Collect property listings from **Habitaclia** (`habitaclia.com`), one of Spain's biggest property portals and the strongest one in Catalonia. Covers homes for sale and for rent, offices, commercial premises, parking, land, investment properties and industrial buildings in all 52 Spanish provinces.

### What does the Habitaclia Spain Property Scraper do?

- Returns complete listings: price, full description, exact coordinates, rooms, bathrooms, built area, floor, condition, energy rating, features, photos and the advertiser's contact details
- Covers every province in Spain, from Barcelona and Madrid to the Balearic and Canary Islands, Ceuta and Melilla
- Handles sale and rental listings, and seven property types, in a single run
- Reaches every listing, including provinces and cities with tens of thousands of ads
- Narrows by price range, or by pasting any Habitaclia search page (a city, district or neighbourhood)

### What data does it extract?

| Field                                                  | Description |
|--------------------------------------------------------|-------------|
| `listing_id`                                           | Habitaclia listing id |
| `reference`                                            | Advertiser's own reference for the property |
| `listing_url`                                          | Link to the listing on Habitaclia |
| `title`                                                | Listing headline (empty when the advertiser left it blank) |
| `price`                                                | Asking price in EUR, or monthly rent for rentals. Empty when the price is on request |
| `currency`                                             | `EUR` |
| `transaction_type`                                     | `sale` or `rent` |
| `property_type`                                        | Subtype such as `flat`, `house`, `penthouse`, `chalet`, `office` |
| `address`                                              | Street and number |
| `neighborhood`, `district`, `municipality`, `province` | Location hierarchy |
| `latitude`, `longitude`                                | Coordinates |
| `rooms`, `bathrooms`                                   | Bedroom and bathroom counts |
| `area_sqm`                                             | Built area in square metres |
| `floor`                                                | Floor number, or `mezzanine` |
| `construction_year`                                    | Year the building was constructed |
| `condition`                                            | Condition of the property, such as `GOOD` or `NEEDS_RENOVATION` |
| `energy_certificate`                                   | Energy efficiency rating, A to G |
| `description`                                          | Full listing text, in the language the advertiser wrote it |
| `features`                                             | Listed amenities such as `ELEVATOR` or `TERRACE` |
| `agency_name`, `agency_url`                            | Advertiser name and website |
| `agent_phone`, `agent_email`                           | Contact details |
| `image_urls`                                           | Photo URLs |
| `updated_at`                                           | When the listing was last updated |
| `scraped_at`                                           | When the record was collected |

Fields the advertiser did not fill in come back empty. In a sample of 300 listings from Barcelona, Madrid and Girona, price, coordinates, area, description and contact phone were present on every listing, bathrooms on 96 percent, rooms on 90 percent and the energy rating on 62 percent.

### How to use it

1. Choose **Transaction Types** (for sale, for rent, or both) and **Property Types**.
2. Choose the **Provinces** to cover. Leave the list empty to cover the whole country.
3. Set **Max Items** to the number of listings you want.
4. Optionally set a **Minimum Price** or **Maximum Price**.
5. Run it and download the dataset as JSON, CSV or Excel.

#### Input

| Field              | Type    | Default         | Description                                                                   |
|--------------------|---------|-----------------|-------------------------------------------------------------------------------|
| `maxItems`         | integer | 10              | Maximum number of listings to return                                          |
| `transactionTypes` | array   | `["buy"]`       | `buy`, `rent`, or both                                                        |
| `propertyTypes`    | array   | `["home"]`      | `home`, `parking`, `commercial`, `office`, `land`, `investment`, `industrial` |
| `provinces`        | array   | `["barcelona"]` | Provinces to cover. Empty means all of Spain                                  |
| `searchUrls`       | array   | empty           | Habitaclia search page URLs. When set, these replace the province selection   |
| `minPrice`         | integer | none            | Lowest price in EUR (monthly rent for rentals)                                |
| `maxPrice`         | integer | none            | Highest price in EUR (monthly rent for rentals)                               |

Example, 500 flats for rent in Madrid under 1,500 EUR a month:

```json
{
  "maxItems": 500,
  "transactionTypes": ["rent"],
  "propertyTypes": ["home"],
  "provinces": ["madrid"],
  "maxPrice": 1500
}
```

Example, everything on sale in one neighbourhood:

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

#### Resuming a large crawl

Every run emits a `resumeCursor` in its Output. If a large crawl stops before it finishes — because it hit `maxItems`, your spend cap (`maxTotalChargeUsd`), or was aborted — start a new run with **the same input** plus that `resumeCursor` to continue from where it left off. The crawl resumes from the queued work the previous run didn't reach.

- You are **not re-charged** for records the earlier run already delivered.
- Resume within your account's run-retention window — on the free tier, roughly your 10 most recent runs. Once the source run is pruned, its `resumeCursor` is no longer valid.
- `resumeCursor` is opaque — supply it unmodified.

### Output example

```json
{
  "listing_id": "d5645052-64df-4a30-917f-407945b02da0",
  "reference": "V02363",
  "listing_url": "https://www.habitaclia.com/comprar/planta-intermedia/de-la-riera/centre/vic/d5645052-64df-4a30-917f-407945b02da0/d",
  "price": 395000,
  "currency": "EUR",
  "transaction_type": "sale",
  "property_type": "flat",
  "address": "De la Riera",
  "district": "Centre",
  "municipality": "Vic",
  "province": "Barcelona",
  "latitude": 41.9294,
  "longitude": 2.2533,
  "rooms": 3,
  "bathrooms": 2,
  "area_sqm": 104,
  "energy_certificate": "E",
  "agency_name": "CODOLGESTIO",
  "agent_phone": "+34938863638"
}
```

### Good to know

- Each listing appears once per run, identified by `listing_id`.
- Listing text is returned as written, mostly Spanish or Catalan.
- Listings change all day. Counts reflect the portal at the moment of the run.

### Support

Questions or a field you need? Write to actor-support@orbtop.com.

# Actor input Schema

## `sp_intended_usage` (type: `string`):

What will this data feed? E.g. lead lists, KYB checks, price tracking.

## `sp_improvement_suggestions` (type: `string`):

Provide any feedback or suggestions for improvements.

## `sp_contact` (type: `string`):

We'll personally help with your use case. No spam.

## `resumeCursor` (type: `string`):

Leave empty for a fresh crawl. To CONTINUE a previous run where it stopped — without paying again for records you already received — paste the `resumeCursor` value from that run's Output (the run's OUTPUT key). Resume promptly: the previous run's data expires with your account's retention window (free tier: your ~10 most recent runs).

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

Maximum number of listings to return.

## `transactionTypes` (type: `array`):

Which listings to collect, for sale or for rent. Select both to get both.

## `propertyTypes` (type: `array`):

Which kinds of property to collect.

## `provinces` (type: `array`):

Spanish provinces to cover. Leave empty to cover all of Spain.

## `searchUrls` (type: `array`):

Optional. Paste Habitaclia search result pages (a city, district or neighbourhood, for example https://www.habitaclia.com/comprar/viviendas/barcelona-provincia/barcelona-capital/s). When set, these are collected instead of the province selection.

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

Only listings priced at or above this amount. For rentals this is the monthly rent.

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

Only listings priced at or below this amount. For rentals this is the monthly rent.

## Actor input object example

```json
{
  "sp_contact": "Share your email here...",
  "maxItems": 10,
  "transactionTypes": [
    "buy"
  ],
  "propertyTypes": [
    "home"
  ],
  "provinces": [
    "barcelona"
  ],
  "searchUrls": []
}
```

# Actor output Schema

## `results` (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 = {
    "sp_contact": "Share your email here...",
    "maxItems": 10,
    "transactionTypes": [
        "buy"
    ],
    "propertyTypes": [
        "home"
    ],
    "provinces": [
        "barcelona"
    ],
    "searchUrls": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("jungle_synthesizer/habitaclia-spain-property-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 = {
    "sp_contact": "Share your email here...",
    "maxItems": 10,
    "transactionTypes": ["buy"],
    "propertyTypes": ["home"],
    "provinces": ["barcelona"],
    "searchUrls": [],
}

# Run the Actor and wait for it to finish
run = client.actor("jungle_synthesizer/habitaclia-spain-property-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 '{
  "sp_contact": "Share your email here...",
  "maxItems": 10,
  "transactionTypes": [
    "buy"
  ],
  "propertyTypes": [
    "home"
  ],
  "provinces": [
    "barcelona"
  ],
  "searchUrls": []
}' |
apify call jungle_synthesizer/habitaclia-spain-property-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jungle_synthesizer/habitaclia-spain-property-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/dPsDfnTgNtF7pqgfp/builds/rYgs8Zz5DK6cCCaig/openapi.json
