# Pisos.com Scraper: Spanish Property Listings for Sale and Rent (`santamaria-automations/pisos-com-scraper`) Actor

Get property listings from pisos.com list pages: price, location, bedrooms, bathrooms, size, floor, description snippet, agency, photos, badges and coordinates, for sale and rent. No login needed.

- **URL**: https://apify.com/santamaria-automations/pisos-com-scraper.md
- **Developed by:** [NanoScrape](https://apify.com/santamaria-automations) (community)
- **Categories:** Real estate, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 pisos.com listing scrapeds

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

## Pisos.com Scraper

Get property listings from [pisos.com](https://www.pisos.com/), the Spanish property portal. Paste the address of a sale or rent list page, such as flats for sale in Madrid, and the actor returns one record per listing card: price, location, bedrooms, bathrooms, size, floor, a description snippet, the agency, photos, labels and coordinates. No login and no API key are needed.

### What you get

- One record per listing card, 30 listings per list page.
- Sale lists (`/venta/...`) and rent lists (`/alquiler/...`).
- Several start URLs in one run. They are read in the order you give them, and `maxResults` counts across all of them.
- Each listing once per run, even if it shows up on more than one page.
- A run that is interrupted continues where it stopped. Listings already delivered are not delivered or charged again.
- You pay only for listings that were saved to the dataset.

The actor reads list pages only. It does not open the page of each listing.

### Use with AI agents (MCP)

Connect this actor to any MCP-compatible AI client, such as Claude Desktop, Cursor, VS Code, LangChain or LlamaIndex.

**MCP server URL:**

```
https://mcp.apify.com?tools=santamaria-automations/pisos-com-scraper
```

**Example prompt once connected:**

> "Use `pisos-com-scraper` to list the first 60 flats for sale in Madrid from pisos.com with price, size and number of bedrooms as a CSV."

### Data extracted

| Field | Example |
|-------|---------|
| `id` | `"65077851154.510936"` |
| `ad_id` | `"65077851154"` |
| `agency_id` | `"510936"` |
| `url` | `"https://www.pisos.com/comprar/piso-carabanchel_san_isidro28019-65077851154_510936/"` |
| `title` | `"Piso en calle de San Cándido"` |
| `operation` | `"sale"` or `"rent"` |
| `property_type` | `"piso"` |
| `price` | `439900` (euros; for rent, per month) |
| `currency` | `"EUR"` |
| `price_text` | `"439.900 €"` |
| `price_period` | `"month"` for rent, empty for sale |
| `price_per_m2` | Price per square metre, only when the card shows it |
| `price_drop_text`, `price_drop_amount`, `price_drop_percent` | `"20.000 € (-3%)"`, `20000`, `3`, when the card shows a reduction |
| `location_text` | `"San Isidro (Distrito Carabanchel. Madrid Capital)"` |
| `neighborhood`, `district`, `city` | `"San Isidro"`, `"Carabanchel"`, `"Madrid Capital"` |
| `province`, `country` | `"Madrid"`, `"ES"` |
| `municipality_code` | `"28079"` |
| `latitude`, `longitude` | `40.399459`, `-3.7209612` |
| `bedrooms`, `bathrooms`, `size_m2` | `3`, `2`, `90` |
| `floor`, `floor_number` | `"1ª planta"`, `1` |
| `features` | `["3 habs.", "2 baños", "90 m²", "1ª planta"]` |
| `description` | Description snippet from the card |
| `agency_name` | `"redpiso estudio pradera de san isidro"` |
| `agency_url`, `agency_logo` | Public agency page and logo |
| `agency_phone` | Phone number the card publishes for the agency |
| `has_whatsapp` | `true` when the card offers a WhatsApp button |
| `images` | The photos present on the card |
| `image_count` | `33` (all photos of the listing) |
| `badges` | `["TOP", "Oportunidad"]` |
| `is_top`, `is_new`, `is_new_development` | `true` or `false` |
| `published_text`, `updated_text` | Publication or update marker, when the card shows one |
| `search_total_results` | Total results the list reports |
| `position`, `page` | Position on the page and page number |
| `source_url` | The list page the row came from |
| `scraped_at` | Time the page was read (UTC) |

Fields that a card does not show are returned empty.

### Pricing

Pay-per-event pricing. You pay only for listings that were saved to the dataset.

| Event | Price |
|-------|-------|
| Actor start (`actor-start`) | $0.001 per run |
| Listing scraped (`pisos-listing-result`) | $0.002 per listing ($2.00 per 1,000) |

The start event is charged once per run, together with the first saved listing. A run that returns nothing is not charged. If you set a maximum cost per run, the actor stops before it goes over that limit and the run status says so.

### Input

| Field | Type | Description | Default |
|-------|------|-------------|---------|
| `startUrls` | string\[] | pisos.com list pages, for example `https://www.pisos.com/venta/pisos-madrid/` or `https://www.pisos.com/alquiler/pisos-barcelona/`. A page number in the address (`/2/`) makes the actor start from that page. | the Madrid sale list (sample) |
| `maxResults` | integer | Most listings to return in total for the run, counted across all start URLs. The start URLs are read in the order given, so later ones get what is left. 0 uses 100. | `100` |
| `maxPages` | integer | Most list pages to read for each start URL separately, so every city gets its pages. 0 uses 10. | `10` |

If `startUrls` is empty or missing, the actor runs a small sample: the Madrid sale list, up to 20 listings, and the run status says so. Numbers can be given as text, for example `"50"`.

Start URLs the site does not allow robots to read are refused before the run starts, with a message that names them. That covers the search form (`/busqueda/`), `.aspx` pages, `/WS/`, `/mapa/` and a few other paths. Nothing is fetched and nothing is charged in that case.

### Usage examples

#### First 60 flats for sale in Madrid

```json
{
  "startUrls": ["https://www.pisos.com/venta/pisos-madrid/"],
  "maxResults": 60
}
```

#### Sale lists of two cities

```json
{
  "startUrls": [
    "https://www.pisos.com/venta/pisos-madrid/",
    "https://www.pisos.com/venta/pisos-barcelona/"
  ],
  "maxResults": 100,
  "maxPages": 2
}
```

#### Rent list

```json
{
  "startUrls": ["https://www.pisos.com/alquiler/pisos-madrid/"],
  "maxResults": 30
}
```

### Output

Results are saved to the default dataset. Export them as JSON, CSV or Excel, or read them through the API.

```json
{
  "id": "65077851154.510936",
  "url": "https://www.pisos.com/comprar/piso-carabanchel_san_isidro28019-65077851154_510936/",
  "title": "Piso en calle de San Cándido",
  "operation": "sale",
  "property_type": "piso",
  "price": 439900,
  "currency": "EUR",
  "neighborhood": "San Isidro",
  "district": "Carabanchel",
  "city": "Madrid Capital",
  "bedrooms": 3,
  "bathrooms": 2,
  "size_m2": 90,
  "floor": "1ª planta",
  "agency_url": "https://www.pisos.com/inmobiliaria-redpiso_estudio_pradera_de_san_isidro/",
  "badges": ["TOP", "Oportunidad"],
  "position": 1,
  "page": 1
}
```

### Limitations

- The actor reads list cards only. Details that appear only on the listing page, such as the full description, the energy rating, the year built and the full photo set, are not included.
- The card does not show the agency name as text. `agency_name` is built from the public agency page address, so it can be a shortened or lower case form of the real name.
- Cards usually show no publication date, so `published_text` and `updated_text` are mostly empty. Cards usually show no price per square metre either, so `price_per_m2` is mostly empty.
- A card loads only its first photos. `images` holds those, and `image_count` gives the full number.
- Rent cards show the monthly price. A card marked "A consultar" has no price, and `price` is empty for it.
- A list shows what the site shows at that moment. Order and content change during the day, and very long lists end before the total the site reports.
- The agency phone number is only present on cards that publish it.
- Pages that the site's robots.txt does not allow are refused.

### FAQ

**Which pages should I use?**
Sale and rent list pages, such as `https://www.pisos.com/venta/pisos-madrid/`. Pages for houses, studios or other places work the same way as long as the address starts with `/venta/` or `/alquiler/`.

**How many listings can I get from one list?**
The actor reads pages until it has `maxResults` listings, `maxPages` pages or the list ends. Each page holds 30 listings.

**What does a run cost?**
The start price plus the price per listing in the table above. A run that returns nothing costs nothing.

**What status does a run end with?**
The run status says how many listings were delivered. If the site refuses every request, the run fails and nothing is charged. If a list has no listings, the run ends normally and says so.

**Can I get the full listing details?**
No. This actor returns the data of the list cards. It does not open listing pages.

**Can I use a filtered list?**
Yes, if you copy the address of the filtered list from your browser and it starts with `/venta/` or `/alquiler/`. Filters that the site keeps in the page address are kept. Anything after `?` is ignored.

# Actor input Schema

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

pisos.com sale or rent list pages, for example https://www.pisos.com/venta/pisos-madrid/ or https://www.pisos.com/alquiler/pisos-barcelona/. Each page holds up to 30 listings. A page number in the address (for example /2/) makes the actor start from that page. If left empty, the actor runs a sample of up to 20 listings from the Madrid sale list.

## `maxResults` (type: `integer`):

Most listings to return across all start URLs, read in order. 0 or empty uses 100.

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

Most list pages to read for each start URL. 0 or empty uses 10.

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

Connection settings. The default works for most runs; the actor chooses the level it needs.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.pisos.com/venta/pisos-madrid/"
  ],
  "maxResults": 60,
  "maxPages": 2,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `defaultDataset` (type: `string`):

Dataset with one record per property card

# 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.pisos.com/venta/pisos-madrid/"
    ],
    "maxResults": 60,
    "maxPages": 2,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("santamaria-automations/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 = {
    "startUrls": ["https://www.pisos.com/venta/pisos-madrid/"],
    "maxResults": 60,
    "maxPages": 2,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("santamaria-automations/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 '{
  "startUrls": [
    "https://www.pisos.com/venta/pisos-madrid/"
  ],
  "maxResults": 60,
  "maxPages": 2,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call santamaria-automations/pisos-com-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,santamaria-automations/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/93OGFETMkcUtzDNn3/builds/bczhMWtrM4IKUsCqz/openapi.json
