# Pisos.com Scraper (`dadhalfdev/pisos-com-scraper`) Actor

Scrape Spanish property listings from pisos.com. Use filters (sale/rent, type, location, price, bedrooms) or paste a search URL — the URL wins when set. Returns price, size, rooms, location, phone, and photos.

- **URL**: https://apify.com/dadhalfdev/pisos-com-scraper.md
- **Developed by:** [Marco Rodrigues](https://apify.com/dadhalfdev) (community)
- **Categories:** Real estate
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 results

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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use 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

## 🏠 pisos.com Scraper

Want to find properties on [pisos.com](https://www.pisos.com/) or analyze the Spanish real estate market? This scraper makes it super easy!

Use **structured filters** (sale/rent, type, location, price, bedrooms) — structured filters work better for AI agents — **or** paste an **`input_url`** straight from your browser once you've already filtered on pisos.com. When `input_url` is set it overrides the filters below. Either way, the scraper extracts property listings with prices, specs, photos, and contact phones into a CSV or JSON file.

### 💡 Perfect for...

- **Buyers & Investors:** Monitor deals across Spanish cities, price bands, and bedroom counts.
- **Estate Agencies:** Track competitor listings and build lead lists with revealed contact numbers.
- **Market Research:** Analyze supply and pricing by province, city, or district.
- **Data Analysts:** Export clean structured data for dashboards and valuation models.
- **🤖 AI Agents:** Power bots and OpenClaw workflows with real-time pisos.com listings.
- **📚 RAG Systems:** Feed property specs and prices into retrieval pipelines.
- **🔗 AI Workflows:** Plug into LangChain, AutoGPT, CrewAI, and similar stacks.

### ✨ Why you'll love this scraper

- 🔗 **Input URL or Filters:** Paste a pisos.com search URL (`input_url`) if you already filtered in the browser, or use structured filters (better for AI agents). `input_url` always wins when set — leave it empty when you want `location` and the other filters to apply.
- 🎯 **Website-Matched Filters:** Listing type, property type, price, bedrooms, bathrooms, area, and sort use the **same path slugs as pisos.com**.
- 📍 **Location Suggest:** Free-text location is resolved through the site’s geo suggest (Madrid, Marbella, Chamberí, …).
- 📞 **Phones on Listings:** Pulls the call-button number when the grid exposes it.
- 🇪🇸 **Built for Spain:** Covers venta, alquiler, and obra nueva (promociones).

### 📦 What's inside the data?

For every property listing, you will get:
- **Core Details:** `id`, `url`, `transaction`, `property_type`, `title`, `description`
- **Pricing:** `price`, `price_label`, `price_currency` (EUR)
- **Specs:** `area_m2`, `bedrooms`, `bathrooms`, `floor`
- **Location:** `location`, `city`, `region`, `country`, `latitude`, `longitude`
- **Contact / Media:** `phone`, `image_url`

### 🛠️ Sort options

Use `sort_by` with the same slugs as on pisos.com:
- **(empty)** – Relevance *(default)*
- **`fecharecientedesde-desc`** – Newest
- **`asc` / `desc`** – Price low→high / high→low
- **`hab-desc` / `hab-asc`** – Most / fewest bedrooms
- **`m2-desc` / `m2-asc`** – Largest / smallest

### 🚀 Quick start

**Option A — Input URL**
1. Open [pisos.com](https://www.pisos.com/), apply filters in the browser, copy the results URL — e.g. `https://www.pisos.com/venta/pisos-madrid/desde-100000/hasta-300000/`.
2. Paste it into `input_url`.
3. Set `max_properties` and click **Start**.

**Option B — Structured filters (better for AI agents)**
1. Leave `input_url` empty.
2. Set listing type, property type, location, and optional price / bedrooms / area / sort.
3. Set `max_properties` (up to 1000) and click **Start**.

Export CSV, Excel, or JSON when done.

---

#### Tech details for developers 🧑‍💻

**Input Example (filters):**
```json
{
  "listing_type": "venta",
  "property_type": "pisos",
  "location": "madrid",
  "price_min": 100000,
  "price_max": 300000,
  "bedrooms": "2",
  "sort_by": "asc",
  "max_properties": 100
}
````

**Input Example (URL override):**

```json
{
  "input_url": "https://www.pisos.com/venta/pisos-marbella/desde-200000/hasta-500000/con-2-habitaciones/",
  "max_properties": 50
}
```

**Output Example:**

```json
{
  "id": "65024581430.526710",
  "url": "https://www.pisos.com/comprar/piso-numancia28038-65024581430_526710/",
  "transaction": "venta",
  "property_type": "piso",
  "title": "Piso en calle de Ramón Pérez de Ayala",
  "price": 269000,
  "price_label": "269.000 €",
  "price_currency": "EUR",
  "area_m2": 108,
  "bedrooms": 3,
  "bathrooms": 2,
  "floor": "1ª planta",
  "location": "Numancia (Distrito Puente de Vallecas. Madrid Capital)",
  "city": "Madrid Capital",
  "region": "Madrid",
  "country": "ES",
  "latitude": 40.39,
  "longitude": -3.66,
  "phone": "910000000",
  "image_url": "https://fotos.imghs.net/..."
}
```

# Actor input Schema

## `input_url` (type: `string`):

Optional. Paste any pisos.com search results URL to override the filters below. Must be left empty to use location and other structured filters (better for AI agents). If this field is filled, location/price/etc. are ignored.

## `listing_type` (type: `string`):

Buy (venta), rent (alquiler), or new-build promotions (obra nueva). Ignored when input\_url is set.

## `property_type` (type: `string`):

Property category on pisos.com. Ignored for obra nueva and when input\_url is set.

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

City, province, district, or area name as on pisos.com (e.g. madrid, barcelona, marbella, chamberí). Resolved via the site geo suggest. Ignored when input\_url is set.

## `price_min` (type: `integer`):

Minimum price in euros. Ignored when input\_url is set.

## `price_max` (type: `integer`):

Maximum price in euros. Ignored when input\_url is set.

## `bedrooms` (type: `string`):

Minimum number of bedrooms (habitaciones). Ignored when input\_url is set.

## `bathrooms` (type: `string`):

Minimum number of bathrooms. Ignored when input\_url is set.

## `area_min` (type: `integer`):

Minimum floor area in m² (site steps: 40, 60, 80, …). Ignored when input\_url is set.

## `area_max` (type: `integer`):

Maximum floor area in m². Ignored when input\_url is set.

## `sort_by` (type: `string`):

Result order (same slugs as on pisos.com). Ignored when input\_url is set.

## `max_properties` (type: `integer`):

How many property listings to return (1–1000).

## Actor input object example

```json
{
  "listing_type": "venta",
  "property_type": "pisos",
  "location": "madrid",
  "bedrooms": "",
  "bathrooms": "",
  "sort_by": "",
  "max_properties": 50
}
```

# Actor output Schema

## `overview` (type: `string`):

Table view of scraped listings using the dataset 'overview' view.

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

All scraped listings from the default dataset without view transformation.

# 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 = {
    "location": "madrid"
};

// Run the Actor and wait for it to finish
const run = await client.actor("dadhalfdev/pisos-com-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 = { "location": "madrid" }

# Run the Actor and wait for it to finish
run = client.actor("dadhalfdev/pisos-com-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "location": "madrid"
}' |
apify call dadhalfdev/pisos-com-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=dadhalfdev/pisos-com-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Pisos.com Scraper",
        "description": "Scrape Spanish property listings from pisos.com. Use filters (sale/rent, type, location, price, bedrooms) or paste a search URL — the URL wins when set. Returns price, size, rooms, location, phone, and photos.",
        "version": "0.1",
        "x-build-id": "V8bYouKaijjLXpTe1"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/dadhalfdev~pisos-com-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-dadhalfdev-pisos-com-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/dadhalfdev~pisos-com-scraper/runs": {
            "post": {
                "operationId": "runs-sync-dadhalfdev-pisos-com-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/dadhalfdev~pisos-com-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-dadhalfdev-pisos-com-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "input_url": {
                        "title": "Input URL",
                        "type": "string",
                        "description": "Optional. Paste any pisos.com search results URL to override the filters below. Must be left empty to use location and other structured filters (better for AI agents). If this field is filled, location/price/etc. are ignored."
                    },
                    "listing_type": {
                        "title": "Listing type",
                        "enum": [
                            "venta",
                            "alquiler",
                            "obra_nueva"
                        ],
                        "type": "string",
                        "description": "Buy (venta), rent (alquiler), or new-build promotions (obra nueva). Ignored when input_url is set.",
                        "default": "venta"
                    },
                    "property_type": {
                        "title": "Property type",
                        "enum": [
                            "pisos",
                            "casas",
                            "aticos",
                            "duplex",
                            "estudios",
                            "lofts",
                            "locales",
                            "naves",
                            "terrenos",
                            "garajes"
                        ],
                        "type": "string",
                        "description": "Property category on pisos.com. Ignored for obra nueva and when input_url is set.",
                        "default": "pisos"
                    },
                    "location": {
                        "title": "Location",
                        "type": "string",
                        "description": "City, province, district, or area name as on pisos.com (e.g. madrid, barcelona, marbella, chamberí). Resolved via the site geo suggest. Ignored when input_url is set.",
                        "default": "madrid"
                    },
                    "price_min": {
                        "title": "Minimum price (€)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Minimum price in euros. Ignored when input_url is set."
                    },
                    "price_max": {
                        "title": "Maximum price (€)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum price in euros. Ignored when input_url is set."
                    },
                    "bedrooms": {
                        "title": "Minimum bedrooms",
                        "enum": [
                            "",
                            "1",
                            "2",
                            "3",
                            "4",
                            "5"
                        ],
                        "type": "string",
                        "description": "Minimum number of bedrooms (habitaciones). Ignored when input_url is set.",
                        "default": ""
                    },
                    "bathrooms": {
                        "title": "Minimum bathrooms",
                        "enum": [
                            "",
                            "1",
                            "2",
                            "3"
                        ],
                        "type": "string",
                        "description": "Minimum number of bathrooms. Ignored when input_url is set.",
                        "default": ""
                    },
                    "area_min": {
                        "title": "Minimum area (m²)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Minimum floor area in m² (site steps: 40, 60, 80, …). Ignored when input_url is set."
                    },
                    "area_max": {
                        "title": "Maximum area (m²)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum floor area in m². Ignored when input_url is set."
                    },
                    "sort_by": {
                        "title": "Sort by",
                        "enum": [
                            "",
                            "fecharecientedesde-desc",
                            "asc",
                            "desc",
                            "hab-desc",
                            "hab-asc",
                            "m2-desc",
                            "m2-asc"
                        ],
                        "type": "string",
                        "description": "Result order (same slugs as on pisos.com). Ignored when input_url is set.",
                        "default": ""
                    },
                    "max_properties": {
                        "title": "Maximum number of properties",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "How many property listings to return (1–1000).",
                        "default": 50
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
