# Fotocasa Scraper: Spain Homes for Sale and Rent (`v0iddo/fotocasa-scraper`) Actor

Scrape Fotocasa property listings for sale or to rent across Spain: price, price drop, rooms, bathrooms, surface, floor, features, neighbourhood and city, coordinates, photos, agency and publication date. Search by place or paste a Fotocasa search URL.

- **URL**: https://apify.com/v0iddo/fotocasa-scraper.md
- **Developed by:** [vøiddo](https://apify.com/v0iddo) (community)
- **Categories:** Real estate, Travel
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.05 / 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?

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

## Fotocasa Scraper: Spain Homes for Sale and Rent

Scrape Fotocasa property listings for sale or to rent across Spain: price, price drop, rooms, bathrooms, surface, floor, features, neighbourhood and city, coordinates, photos, agency and publication date. Search by place or paste a Fotocasa search URL.

- Pay per result row: the platform usage of the run is included, and a run that finds nothing has no result charges.
- No login, no cookies, no account on Fotocasa: public pages only.
- Export to JSON, CSV, Excel, XML or HTML, or read the rows through the Apify API.
- Start it from the Console, on a schedule, through the API, or as a tool for agents over MCP.
- Tested every day on its example input, with the rows checked, and repaired when a check fails.

### What you can use it for

- Property price research for a Spanish city or neighbourhood, for sale or to rent.
- Price drop alerts: schedule a search and compare prices between runs.
- Investor screening: rooms, bathrooms, surface and price per listing in one table.
- Agency market share: count listings per agency in an area.

### What you get

Every result is one row in the run's dataset. Download it as JSON, CSV, Excel or HTML, or read it through the Apify API. The main fields:

| Field | Meaning |
|---|---|
| `propertyId` | Property ID |
| `address` | Address |
| `price` | Price (EUR) |
| `rentPeriod` | Rent period |
| `propertyType` | Type |
| `rooms` | Rooms |
| `bathrooms` | Bathrooms |
| `surfaceM2` | Surface (m2) |
| `sellerType` | Seller |
| `agency` | Agency |
| `publishedAt` | Published |
| `url` | Listing |

Example row:

```json
{
  "propertyId": 190522421,
  "adId": "8ad8eae6-7b49-4f23-b261-11cf0cd5774f",
  "url": "https://www.fotocasa.es/es/comprar/vivienda/madrid-capital/aire-acondicionado-calefaccion-parking-ascensor-piscina-no-amueblado/190522421/d",
  "channel": "buy",
  "price": 675000,
  "priceText": "675.000 €",
  "currency": "EUR",
  "priceReduction": 15000,
  "rentPeriod": null,
  "propertyType": "Flat",
  "propertySubType": "Flat",
  "rooms": 4,
  "bathrooms": 2,
  "surfaceM2": 116,
  "floor": 2,
  "features": [
    "air_conditioner",
    "cabinets",
    "heating",
    "parking",
    "elevator",
    "porter_service",
    "childrens_zone",
    "community_pool",
    "not_furnished",
    "equiped_kitchen"
  ],
  "address": "Calle Austria, Rosas - Musas, San Blas, Madrid",
  "street": "Calle Austria",
  "neighborhood": "Rosas - Musas",
  "district": "San Blas",
  "city": "Madrid",
  "province": "Madrid",
  "zipCode": "28022",
  "latitude": 40.425388,
  "longitude": -3.607299,
  "isNewConstruction": false,
  "isAuction": false,
  "isOccupied": false,
  "sellerType": "agency",
  "agency": "VOhome Las Rosas-San Blas",
  "agencyUrl": "https://www.fotocasa.es/es/pro/vohome-las-rosas-san-blas/",
  "images": [
    "https://static.fotocasa.es/images/ads/85518c2d-4860-49ae-bd85-f33b4a3b0541?rule=original",
    "https://static.fotocasa.es/images/ads/6b758dc6-ed20-4487-8c96-824f47760590?rule=original",
    "https://static.fotocasa.es/images/ads/2f597cf9-bf64-428e-80f7-45c32754eb38?rule=original"
  ],
  "publishedAt": "2026-08-20T17:04:43Z",
  "description": "VOhome Propiedades Las Rosas presenta en venta este exclusivo piso, situado en una prestigiosa urbanización en el barrio de Las Rosas, una de las zonas más demandadas y distinguidas del este de Madrid. La vivienda destaca por su amplitud, excelente distribución y luminosidad. Al acceder..."
}
```

### How to use it

1. Open the **Input** tab (or call the actor through the API, see below).
2. Fill in **Search type**, **Fotocasa search URLs**; the form opens with a working example.
3. Set **Maximum results** to cap the size and the cost of the run.
4. Click **Start**. Rows appear on the **Output** tab while the run works.
5. Download the dataset, or connect it to Google Sheets, Make, Zapier, n8n or a webhook.

### Input

| Field | Type | Required | Description |
|---|---|---|---|
| `locations` | array | no | Fotocasa place slugs such as madrid-capital, barcelona-capital or valencia-capital. The slug is the part of a Fotocasa search URL after viviendas/, for example madrid-capital in https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l . Add a zone after a slash to narrow the search, for example madrid-capital/chamberi. One search is run per entry. |
| `channel` | select | no | Properties for sale or to rent. Applies to the locations above. Allowed: buy, rent. Default: `"buy"`. |
| `searchUrls` | array | no | Search result pages copied from your browser, for example https://www.fotocasa.es/es/alquiler/viviendas/valencia-capital/todas-las-zonas/l . Extra parts of the address are kept, and the run always starts at page 1. |
| `includeZones` | boolean | no | Fotocasa's robots.txt leaves only the first page of each search open to automated clients, about 30 listings. When this is on, a search of a whole place also reads the first page of each district and neighbourhood Fotocasa lists for it, which collects many more listings. Turn it off to read only the first page of each search. Default: `true`. |
| `maxItems` | integer | no | The run stops after this many result rows. It also caps what one run can cost. Default: `100`. |
| `proxyConfiguration` | object | no | Leave as is: the run starts on the cheapest network the site accepts and switches to Apify Proxy automatically when the site blocks it. Pick proxy groups here only to force one specific network. |

Example input:

```json
{
  "searchUrls": [
    "https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l"
  ],
  "channel": "buy",
  "maxItems": 20
}
```

### Pricing

You pay per result row in the dataset (the current price per 1,000 results is on the Pricing tab). A run that finds nothing produces no rows and no result charges. Set **Maximum results** to cap what a single run can cost.

### Limits and notes

- Coverage: homes for sale and to rent on fotocasa.es. Fotocasa's robots.txt closes every results page after the first, so one search returns the first page, about 30 listings. A search of a whole place therefore also reads the first page of each district and neighbourhood Fotocasa lists for it (switch off with includeZones), which gives up to about 30 listings per zone. Rows are unique by property ID across the whole run.
- Large zones are not read to the end. To go deeper, search smaller zones: add place slugs with a zone such as madrid-capital/chamberi, or paste the address of a district or neighbourhood page.
- Telephone numbers and e-mail addresses are never collected, and any found inside an agency description are removed. Descriptions are clipped to about 300 characters.
- Listings from private sellers are reduced to area level (no street, no map point, no description) so no private person can be identified. They carry sellerType private and no agency, name or seller link.
- Agency listings report the agency name and its Fotocasa page, the street shown in the advert and the map point (rounded to six decimals).
- price is a number in euros. For rentals it is the amount per rentPeriod (monthly); priceText shows the figure as advertised. priceReduction is the amount by which the price was lowered, when the advert shows one.
- floor is the storey above ground (0 is the ground floor) and is given for the ground floor up to the fifth floor; it is empty when the advert has no floor or Fotocasa's code for it is not decoded.
- features lists the amenity flags Fotocasa shows for the advert, such as elevator, parking or air_conditioner. Fotocasa's own flag not_furnished means the home is let or sold unfurnished.
- Search addresses that carry price, room or bathroom filters, or sort by date, are closed to automated access in Fotocasa's robots.txt and are refused; paste the plain place address instead.
- A place slug Fotocasa does not know stops the run with an input error. Copy the slug from a Fotocasa search address in your browser.
- Only publicly visible data is collected. No login, no paywalled content, no personal contact details.
- The actor reads only pages that the site's robots.txt leaves open to automated access.
- Sites change their pages from time to time. The actor is checked automatically and repaired when a check fails.
- Each run sends one short usage record to the developer: the Actor and run IDs, the number of results, whether the run succeeded (and if not, the kind of error, such as "blocked" or "input problem"), whether the account is on a paid Apify plan, how the run was started (for example from the Console, the API or a schedule) and a one-way fingerprint of the account (a hash, not the account ID), so that repeat runs of one account count once. It contains nothing from your input or results.

### Run it through the API

Python, with the `apify-client` package:

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("v0iddo/fotocasa-scraper").call(run_input={"searchUrls": ["https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l"], "channel": "buy", "maxItems": 20})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

JavaScript, with the `apify-client` package:

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('v0iddo/fotocasa-scraper').call({"searchUrls": ["https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l"], "channel": "buy", "maxItems": 20});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

One HTTP call that waits for the run and returns the rows (for runs that finish within 5 minutes):

```bash
curl -X POST "https://api.apify.com/v2/acts/v0iddo~fotocasa-scraper/run-sync-get-dataset-items?token=<YOUR_APIFY_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"searchUrls": ["https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l"], "channel": "buy", "maxItems": 20}'
```

### Use it from an agent (MCP)

Claude, Cursor, VS Code and other MCP clients can call this actor as a tool through the Apify MCP server. Add it to the client's MCP configuration:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=v0iddo/fotocasa-scraper",
      "headers": {
        "Authorization": "Bearer <YOUR_APIFY_TOKEN>"
      }
    }
  }
}
```

Then ask, for example: "List flats to rent in Valencia with price, rooms and surface."

### FAQ

#### Do I need an account on Fotocasa, cookies or an API key?

No. The actor reads only what every visitor of Fotocasa can see, without logging in. You only need an Apify account to start it.

#### How many results can one run return?

Up to 5,000 rows per run. Without a limit it stops at 100. Set **Maximum results** to the number you need; large jobs can also be split into several runs or scheduled.

#### How am I charged?

Per result row in the dataset, at the price on the Pricing tab for your Apify plan. The platform usage of the run is included in that price. A run that finds nothing produces no rows and no result charges, and your spending limit for a run is always respected.

#### Why did my run return no results?

The status message of the run says why: nothing matched the input, the input was not a page the actor understands, the page is closed to automated access by robots.txt, or the site refused every network the actor tried. Check the input against the example above and run it again with a small limit.

#### Can I run it on a schedule?

Yes. Save your input as a task and add a schedule in the Apify Console (daily, hourly or with a cron expression). Each run gets its own dataset, so you keep a history.

#### Which formats can I export?

JSON, CSV, Excel, XML, HTML table and RSS from the Output tab or the API. Integrations send the rows to Google Sheets, Slack, Make, Zapier, n8n or a webhook.

#### Is collecting this data allowed?

The actor collects only what Fotocasa publishes to every visitor, without a login, and it reads only pages that robots.txt leaves open. Public data can still be personal data under laws such as the GDPR, and sites have their own terms: make sure your use of the data follows the rules that apply to you.

#### What happens when Fotocasa changes its pages?

Automated tests run the actor every day on the example input and check the rows, not only that the run finished. When a check fails, the actor is repaired and rebuilt; the build history on this page shows each update.

#### Something is missing or wrong. Where do I report it?

Open an issue on the Issues tab of this actor with the run link. Requests for a new field are welcome too.

### Related actors

- [Rightmove Scraper: UK Property for Sale and to Rent](https://apify.com/v0iddo/rightmove-scraper)
- [Zillow Search Scraper: Homes for Sale, Rent and Sold](https://apify.com/v0iddo/zillow-scraper)

# Actor input Schema

## `locations` (type: `array`):

Fotocasa place slugs such as madrid-capital, barcelona-capital or valencia-capital. The slug is the part of a Fotocasa search URL after viviendas/, for example madrid-capital in https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l . Add a zone after a slash to narrow the search, for example madrid-capital/chamberi. One search is run per entry.

## `channel` (type: `string`):

Properties for sale or to rent. Applies to the locations above.

## `searchUrls` (type: `array`):

Search result pages copied from your browser, for example https://www.fotocasa.es/es/alquiler/viviendas/valencia-capital/todas-las-zonas/l . Extra parts of the address are kept, and the run always starts at page 1.

## `includeZones` (type: `boolean`):

Fotocasa's robots.txt leaves only the first page of each search open to automated clients, about 30 listings. When this is on, a search of a whole place also reads the first page of each district and neighbourhood Fotocasa lists for it, which collects many more listings. Turn it off to read only the first page of each search.

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

The run stops after this many result rows. It also caps what one run can cost.

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

Leave as is: the run starts on the cheapest network the site accepts and switches to Apify Proxy automatically when the site blocks it. Pick proxy groups here only to force one specific network.

## Actor input object example

```json
{
  "channel": "buy",
  "searchUrls": [
    "https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l"
  ],
  "includeZones": true,
  "maxItems": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

One dataset row per processed item.

# 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 = {
    "channel": "buy",
    "searchUrls": [
        "https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l"
    ],
    "maxItems": 20,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("v0iddo/fotocasa-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 = {
    "channel": "buy",
    "searchUrls": ["https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l"],
    "maxItems": 20,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("v0iddo/fotocasa-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 '{
  "channel": "buy",
  "searchUrls": [
    "https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l"
  ],
  "maxItems": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call v0iddo/fotocasa-scraper --silent --output-dataset

```

## MCP server setup

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