# 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, 96.7% 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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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": 10
}
```

# 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 = {
    "listing_type": "venta",
    "property_type": "pisos",
    "location": "madrid",
    "max_properties": 10
};

// 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 = {
    "listing_type": "venta",
    "property_type": "pisos",
    "location": "madrid",
    "max_properties": 10,
}

# 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(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 '{
  "listing_type": "venta",
  "property_type": "pisos",
  "location": "madrid",
  "max_properties": 10
}' |
apify call dadhalfdev/pisos-com-scraper --silent --output-dataset

```

## MCP server setup

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