# Pisos.com Scraper - Spanish Real Estate Listings (`bovi/pisos-scraper`) Actor

Scrape property listings from pisos.com, Spain's real estate portal: price, area, rooms, bathrooms, floor, photos, phone, location and coordinates. Sale and rent, any city, filters and sorting, no login needed.

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

## Pricing

from $1.20 / 1,000 pisos.com scraper - spanish real estate listings

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 for Spanish Property Listings

This Actor scrapes public sale and rent listing cards from pisos.com for structured Spanish property data. It needs no login or API key; on the Free plan, it reads only the first result page of each search URL.

- Track sale prices, areas and room counts for a Spanish city or province.
- Compare monthly rents by property type before shortlisting an area.
- Collect published agency phone numbers and listing URLs.
- Sort results and keep listings inside your chosen price range.
- Get `null` when a card does not publish a detail, such as a studio's floor.

### What you get

Each dataset item is one listing card from a pisos.com search results page; detail pages are not opened. Missing source values are `null`, and `images` is empty when no matching photo URL is found. `propertyType` is the URL slug, such as `piso`, not the input value `apartment`.

| Family | Fields | Type | What you receive |
| --- | --- | --- | --- |
| Identity | `id`, `url`, `source`, `scrapedAt` | string; string; string; ISO 8601 string | Listing ID, absolute URL, `source` set to `pisos.com`, and UTC parse time |
| Content | `title`, `description`, `propertyType`, `transaction`, `isNewDevelopment` | string; string; string; string; boolean | Card title and description; URL property slug; sale or rent; and new-development flag. Values can be `null` when unavailable |
| Price | `priceText`, `priceAmount`, `priceCurrency` | string; integer; string | Display price and numeric EUR price. Values are `null` when the card does not publish the relevant price |
| Size | `rooms`, `bathrooms`, `areaM2`, `floor` | integer; integer; number; integer | Rooms, bathrooms, square meters and floor. Missing values are `null`; `floor` is `0` for `bajo` |
| Place | `locationText`, `city`, `region`, `country`, `latitude`, `longitude`, `provinceCode`, `municipalityCode` | string; string; string; string; number; number; string; string | Card location, place names, coordinates and codes; each can be `null` |
| Contact and media | `phone`, `agencySlug`, `images` | string; string; array of strings | Published phone, agency slug and card photo URLs from `fotos.imghs.net` |

### Sample output

One listing from a sale search, shortened by dropping `description`, `images`, `isNewDevelopment`, `provinceCode`, `municipalityCode`, `agencySlug`, `region`, `country` and `scrapedAt`. Every value below is unchanged.

```json
{
  "id": "65077851154.510936",
  "url": "https://www.pisos.com/comprar/piso-carabanchel_san_isidro28019-65077851154_510936/",
  "transaction": "sale",
  "propertyType": "piso",
  "title": "Piso en calle de San Cándido",
  "locationText": "San Isidro (Distrito Carabanchel. Madrid Capital)",
  "priceText": "439.900 €",
  "priceAmount": 439900,
  "priceCurrency": "EUR",
  "phone": "919383603",
  "rooms": 3,
  "bathrooms": 2,
  "areaM2": 90,
  "floor": 1,
  "city": "Madrid Capital",
  "latitude": 40.399459,
  "longitude": -3.7209612,
  "source": "pisos.com"
}
```

### Pricing

This is a pay-per-event Actor. Saved listings are the primary event on the Free plan: `$0.0012` each, or `$1.20` per 1,000 dataset items. Only listings written to the dataset are billed; duplicates and cards rejected by the price filter are not result events.

| Event | When it is charged | Free-plan price |
| --- | --- | --- |
| `apify-actor-start` | When the Actor starts. One event per GB of memory, minimum one event. Default memory is 512 MB, so the run charges one start event. | $0.00005 |
| `apify-default-dataset-item` | Each listing written to the dataset. | $0.0012 on the Free plan |

On the Free plan, 1,000 dataset-item events cost 1,000 × `$0.0012` = `$1.20`, and 10,000 dataset-item events cost 10,000 × `$0.0012` = `$12.00`. On the Free plan, the corresponding actor-start calculations are 1,000 × `$0.00005` = `$0.05` and 10,000 × `$0.00005` = `$0.50`.

With default 512 MB memory, 4000 results cost `$4.80005` on the Free plan: 4000 × `$0.0012` plus one `apify-actor-start` event at `$0.00005`.

The Apify Free plan includes `$5` of monthly platform credit. After one start event, it covers 4166 dataset items: 4166 × `$0.0012` on the Free plan + `$0.00005` = `$4.99925`. One more dataset item would pass the Free plan's `$5` monthly credit, even before the start event.

Platform usage—compute, proxy traffic and storage—is included in these event prices and paid by the Actor developer. If the run reaches your charge limit, it stops and keeps listings already stored.

### How to use

1. Open this Actor in the Apify console while signed in to your Apify account.
2. Choose a transaction, property type and location slug such as `madrid` or `barcelona`.
3. Set sorting, optional price bounds and the maximum number of listings.
4. Start the run, leaving proxy configuration unset to use the default residential proxy.
5. Review the dataset when the run finishes.
6. Repeat the run through Apify Schedules; daily is a reasonable starting point for listing prices.

```json
{
  "transaction": "sale",
  "propertyType": "apartment",
  "location": "madrid",
  "sortBy": "relevance",
  "minPrice": 200000,
  "maxPrice": 450000,
  "maxResults": 50
}
```

Export the dataset as JSON or CSV, or read it through the Apify dataset API.

### Input parameters

The run reads every field below. Without `startUrls`, it builds one search URL from transaction, property type, location, sort and price. Price bounds are inclusive, sent in the URL and checked again on each card. For rent they mean monthly rent; for sale they mean asking price. With `startUrls`, transaction, property type, location and sort are ignored for URL construction, while price bounds still apply.

| Parameter | What it does | Default |
| --- | --- | --- |
| `transaction` | `sale` or `rent`; selects the generated search path | `sale` |
| `propertyType` | `apartment`, `house`, `land`, `garage`, `office`, `attic`, `duplex` or `studio` | `apartment` |
| `location` | City or province slug, such as `madrid`, `barcelona`, `sevilla`, `valencia` or `palma_de_mallorca`. It is lowercased; other-character runs become underscores. Blank becomes `madrid` | `madrid` |
| `sortBy` | `relevance`, `newest`, `cheapest`, `mostexp`, `mostrooms` or `largest` | `relevance` |
| `minPrice` | Inclusive EUR minimum, integer at least 0. Unpriced listings are excluded when either bound is set | None |
| `maxPrice` | Inclusive EUR maximum, integer at least 0. Unpriced listings are excluded when either bound is set | None |
| `startUrls` | Optional pisos.com search URLs, as strings or objects with a `url`. They replace the generated URL. Query strings and trailing page numbers are stripped; the domain is not validated | None |
| `maxResults` | Maximum saved listings. Non-numeric values use 50; values below 1 become 1. The count excludes price-filtered and duplicate cards | `50` |
| `proxyConfiguration` | Proxy used from the first request. Default is residential. No proxy is used only with `useApifyProxy: false` and no `proxyUrls` | `useApifyProxy` true, group `RESIDENTIAL` |

### Limits and edge cases

Paging stops at the saved-row limit, 400 pages per search URL, or a page with no new cards. Start URLs run in order.

| Condition | What you see | What to do |
| --- | --- | --- |
| Free plan, second page of a search URL | That URL stops before page 2 and the next start URL may run. The status shows a Free-plan preview with the saved count and `Capped: result pages.`, followed by the upgrade sentence and link. `OUTPUT` contains `free_plan_preview`, `items_returned`, `items_requested`, `limits_applied`, an upgrade link and the same message; `limits_applied` contains `result_pages`. The dataset contains only listings | Use a paid plan, subject to `maxResults`, 400 pages per URL and the charge limit |
| Free plan, first page empty, or `maxResults` filled on page 1 | No preview record. The status is `Collected 0 records.` for an empty dataset or `Collected [saved count] records.` otherwise | Treat an empty first page as that search; raise `maxResults` only when page 1 filled it |
| Free plan, price range excludes every card on page 1 | Page 2 is not requested. The status says `Pisos.com Scraper Free plan preview: 0 items. Capped: result pages.` followed by the upgrade sentence and link. `OUTPUT` has `items_returned` 0 and `limits_applied` containing `result_pages` | Clear or widen the price range if needed |
| First page fails | A non-2xx response or request error is retried up to 6 attempts of 40 seconds, with pauses of 1, 2, 4, 8 and 16 seconds. If no card was read before the failure, the run fails with nothing saved | Retry with the residential proxy and check the URL or slug |
| A later page fails | A page 2+ failure, or page 1 of a later start URL after any card ID was read, logs a warning and stops that URL. Saved rows remain; the run does not fail. The reason is in the log, not `OUTPUT` | Run a narrower search if more rows are needed |
| Price filter rejects a card | A card with no price or a price outside the inclusive range is not saved | Clear both price fields to keep unpriced listings |
| Same listing ID again | The later copy is not saved | Nothing to change |
| Abort, timeout or mid-run failure | Listings are pushed one at a time after passing filters; rows already pushed remain | Use those rows or start another run |
| Charge limit reached | The run stops; the log reports the limit and saved-row count, and those rows remain | Raise the charge limit if more rows are needed |

### FAQ

#### How much does it cost to scrape pisos.com?

On the Free plan, each saved listing costs `$0.0012` and each start event costs `$0.00005`. For example, 4000 results cost `$4.80005` on the Free plan.

#### Why is the dataset empty?

A page with no new cards ends paging. A price range can exclude every card, and cards without prices are excluded when a bound is set. The status message distinguishes an empty collection from a Free-plan preview; see Limits and edge cases.

#### What should I check if the run fails?

Requests are retried up to 6 times for 40 seconds each. See Limits and edge cases for first-page failures, later-page warnings and saved partial results. Keep the residential proxy and check the URL or slug.

#### Why are some fields null?

Only listing cards are read. Phone, floor, coordinates, description and price are `null` when the card does not publish them. Floor is `0` when the card says `bajo`; a card without a price is omitted when a price bound is set.

#### Is it legal to collect public data from pisos.com?

The Actor reads public data on listing cards on pisos.com. Whether that is allowed depends on pisos.com's terms and the law applicable to your use case. This page does not give a legal guarantee.

### Usage statistics

This Actor creates a small, content-free summary at the end of each run, used only to monitor reliability and improve this Actor. No input values, credentials or scraped data are sent.

A copy of the exact record for your run is saved as `USAGE_STATS` in your own Apify key-value store.

To opt out, set `disableUsageStats` to `true` in the input. Nothing is sent then.

[Full list of collected fields](https://api.apify.com/v2/key-value-stores/v9rgHjMKLDGtHf8tD/records/index.html)

# Actor input Schema

## `transaction` (type: `string`):

Buy or rent listings.

## `propertyType` (type: `string`):

Type of property.

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

Spanish city or province slug as in pisos.com URLs, e.g. 'madrid', 'barcelona', 'sevilla', 'valencia', 'palma_de_mallorca'.

## `sortBy` (type: `string`):

Order of the search results.

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

Minimum price in EUR (sale price, or monthly rent). Applied on pisos.com and enforced exactly. Listings without a published price are excluded when a price filter is set.

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

Maximum price in EUR (sale price, or monthly rent). Applied on pisos.com and enforced exactly. Listings without a published price are excluded when a price filter is set.

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

Optional pisos.com search result URLs, e.g. https://www.pisos.com/alquiler/pisos-valencia/. When set, they replace the location, type, price and sort fields.

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

Maximum number of listings to collect.

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

Proxy settings. A residential proxy is used by default for reliable access.

## Actor input object example

```json
{
  "transaction": "sale",
  "propertyType": "apartment",
  "location": "madrid",
  "sortBy": "relevance",
  "maxResults": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

Dataset with the collected records.

# 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 = {
    "transaction": "sale",
    "propertyType": "apartment",
    "location": "madrid",
    "sortBy": "relevance",
    "maxResults": 50,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("bovi/pisos-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 = {
    "transaction": "sale",
    "propertyType": "apartment",
    "location": "madrid",
    "sortBy": "relevance",
    "maxResults": 50,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("bovi/pisos-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 '{
  "transaction": "sale",
  "propertyType": "apartment",
  "location": "madrid",
  "sortBy": "relevance",
  "maxResults": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call bovi/pisos-scraper --silent --output-dataset

```

## MCP server setup

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