# Habitaclia Com Spain Properties and Details Scraper (`realestateapi/habitaclia-com-spain-properties-and-details-scraper`) Actor

Permission-gated Habitaclia property extractor. It defaults to a zero-request policy skip and stores only validated source-backed property records.

- **URL**: https://apify.com/realestateapi/habitaclia-com-spain-properties-and-details-scraper.md
- **Developed by:** [Real Estate API](https://apify.com/realestateapi) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 96.6% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.99 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 Com Spain Properties and Details Scraper

This Actor is permission-gated because Habitaclia's legal notice reserves rights to use and reuse its listing and database content. No applicable written authorization is recorded, so the default run makes no source requests.

### Authorization gate

The `authorizationConfirmed` checkbox is an operator attestation only; it does not grant permission. Set it to `true` only when applicable written authorization covers the intended collection and use. Without that literal boolean, the Actor reports `SUCCEEDED/SKIPPED_POLICY`, saves a zero-request `OUTPUT` summary, and emits no dataset rows.

### Input and output

The Actor accepts up to 20 HTTPS URLs on `habitaclia.com` or `www.habitaclia.com`, a maximum of 100 saved property records, and a per-request timeout. Duplicate input URLs are fetched once, redirects are refused, and each response is capped at 5 MB. Dataset rows contain only successful, source-backed property records with an official Habitaclia HTTPS listing URL, a property name/type, and at least one substantive property field. Page titles and candidate listing links stay out of property rows. Empty pages, malformed records, access diagnostics, and failures are not dataset items; their aggregate counts and bounded failure details go to the `OUTPUT` key.

`status` reports the native outcome (`SUCCEEDED` or `FAILED`); `runStatus` and `collectionStatus` report the collection outcome (`COMPLETED`, `PARTIAL`, `FAILED`, or `SKIPPED_POLICY`). Clean bounded completion, including an empty result, reports `status=SUCCEEDED` and `runStatus=COMPLETED`. A failure with no saved property rows reports `FAILED/FAILED` and a nonzero process exit. Failures after saved property rows report native `status=SUCCEEDED`, `runStatus=PARTIAL`, and exit code zero.

### Output

The Actor saves validated Habitaclia property listings only. It emits no listing rows by default while the authorization gate is closed; access and policy outcomes are reported separately. This example is synthetic and schema-only, not a live Habitaclia record. An authorization setting is an operator attestation, not permission.

```json
{
  "recordType": "habitaclia-listing",
  "actorRank": 493,
  "actorName": "habitaclia-com-spain-scraper",
  "entityType": "Habitaclia Spain property listings",
  "sourceWebsite": "https://www.habitaclia.com",
  "sourceUrl": "https://www.habitaclia.com/comprar/viviendas/barcelona-provincia/barcelona-capital/s",
  "finalUrl": "https://www.habitaclia.com/comprar/viviendas/barcelona-provincia/barcelona-capital/s",
  "fetchStatus": "success",
  "httpStatus": 200,
  "sourceStatus": 200,
  "sourceBacked": true,
  "sourceTransport": "public-http",
  "dataQuality": "validated",
  "propertyName": "Illustrative two-bedroom apartment",
  "listingUrl": "https://www.habitaclia.com/comprar/planta-intermedia/example/barcelona-capital/00000000-0000-0000-0000-000000000000/d",
  "listingType": "sale",
  "propertyType": "Piso",
  "price": "250.000",
  "priceCurrency": "EUR",
  "bedrooms": "2",
  "bathrooms": "1",
  "floorSize": "72",
  "locality": "Example City",
  "listingCount": 1,
  "dataAvailable": true,
  "scrapedAt": "2026-01-15T12:00:00.000Z"
}
```

### Local validation

Offline parser, contract, policy, and storage checks do not make source requests and do not establish live extraction:

```shell
npm test
npm run check
apify validate-schema
```

A live run remains blocked by the authorization gate until applicable written permission is documented. The local orchestration notes also require `ALLOW_GATED=1` for this source; that environment setting is not a rights grant.

# Actor input Schema

## `authorizationConfirmed` (type: `boolean`):

Retained for compatibility. Per the 2026-11-16 operator attestation of written permission, production collection is enabled regardless of this flag. The flag is not itself a permission grant.

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

Up to 20 public HTTPS URLs on habitaclia.com or www.habitaclia.com. Redirects are refused. Duplicate URLs are fetched once.

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

Maximum validated property records to save across the supplied URLs.

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

Bounded result pages per supplied URL (deterministic ?pagina=N pagination).

## `maxRequests` (type: `integer`):

Hard cap on total requests (search pages plus detail verifications) for one run.

## `maxConcurrency` (type: `integer`):

Bound on simultaneous requests; pages and details are fetched sequentially, so 1 is always honored.

## `includeDetails` (type: `boolean`):

Opt-in detail verification: fetch each discovered listing URL and prefer its structured record over the search card.

## `maxDetailRequests` (type: `integer`):

Bound on detail-page fetches when includeDetails is enabled.

## `testMode` (type: `boolean`):

When true, caps the run to 1 page, 6 total requests, and 3 detail requests.

## `timeoutSecs` (type: `integer`):

Per-URL public request timeout.

## Actor input object example

```json
{
  "authorizationConfirmed": false,
  "startUrls": [
    "https://www.habitaclia.com"
  ],
  "maxItems": 10,
  "maxPages": 1,
  "maxRequests": 40,
  "maxConcurrency": 1,
  "includeDetails": false,
  "maxDetailRequests": 0,
  "testMode": false,
  "timeoutSecs": 30
}
```

# Actor output Schema

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

Dataset containing only validated Habitaclia property rows; diagnostics and policy skips are not dataset items.

## `keyValueStore` (type: `string`):

Key-value store containing the OUTPUT run summary.

# 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": [
        "https://www.habitaclia.com"
    ],
    "maxItems": 10,
    "timeoutSecs": 30
};

// Run the Actor and wait for it to finish
const run = await client.actor("realestateapi/habitaclia-com-spain-properties-and-details-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": ["https://www.habitaclia.com"],
    "maxItems": 10,
    "timeoutSecs": 30,
}

# Run the Actor and wait for it to finish
run = client.actor("realestateapi/habitaclia-com-spain-properties-and-details-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": [
    "https://www.habitaclia.com"
  ],
  "maxItems": 10,
  "timeoutSecs": 30
}' |
apify call realestateapi/habitaclia-com-spain-properties-and-details-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,realestateapi/habitaclia-com-spain-properties-and-details-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/3hJmIUW6vW5bZl4Ge/builds/lsmJfIiQbq70zy7jp/openapi.json
