# Fotocasa Scraper: Spain Homes for Sale & Rent with Prices & m² (`datadesk-io/fotocasa-scraper`) Actor

Scrape Fotocasa (fotocasa.es), a top Spanish property portal: homes, premises, offices, garages and land for sale or rent by city or province. Price, €/m², bedrooms, bathrooms, surface, amenities, address, GPS, agency and phone, photos, description. Alerts. $0.90 per 1,000 listings.

- **URL**: https://apify.com/datadesk-io/fotocasa-scraper.md
- **Developed by:** [DataDesk](https://apify.com/datadesk-io) (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 $0.72 / 1,000 listings

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 & Rent with Prices, m² and Agencies

Scrape **Fotocasa (fotocasa.es)**, one of Spain's biggest property portals, by **city, province or any Fotocasa result URL**: **homes, commercial premises, offices, garages, land, storage rooms and buildings, for sale or for rent**. Every listing comes with **price, €/m², price drops, bedrooms, bathrooms, surface, floor, amenities (elevator, terrace, parking, pool, A/C…), street, neighbourhood, district, postal code, province, GPS coordinates, new-build / auction / occupied flags, agency name, page and phone (agencies only), photos, description and publication date**. Filter by price, bedrooms, surface and private sellers, and get **daily new-listing alerts**. No login, no proxy. **$0.90 per 1,000 listings.**

### Try it now (one click)

1. Click **Start**. The prefilled input gets the first 31 homes for sale in Madrid. In our latest check (Nov 23, 2026) it returned **31 listings in about 2 seconds**. An empty input runs a small demo too.
2. Add locations (Madrid, Barcelona, Valencia, malaga-provincia, espana), choose sale or rent and property type, optional price, bedrooms and surface filters, then set how many listings per location.
3. Download the results as CSV, Excel or JSON, or get them via API, webhooks, Make or Zapier.

**Price example:** 100 listings = **$0.095**, 1,000 listings = **$0.905** ($0.90 per 1,000 listings + $0.005 per run). Silver and Gold plan users pay 10% and 20% less per listing. Apify's free plan includes $5 of usage every month, enough for about 5,550 listings. Runs that find nothing are not charged.

#### Sample of real results

*Real rows from a local test run on Nov 23, 2026 (some columns). Each listing also includes the other fields listed below.*

| Title | Price € | Bedrooms | m² | €/m² | District |
|---|---|---|---|---|---|
| Flat in Calle Canencia de la Sierra, Ensanche … | 319,000 | 1 | 66 | 4833 | Villa de Vallecas |
| Flat in Colomer, Guindalera | 685,500 | 2 | 78 | 8788 | Barrio de Salamanca |
| Flat in Avenida de la Reina Victoria, Valleher… | 1,095,000 | 3 | 149 | 7349 | Chamberí |
| Attic in Calle LORCA, Nou Moles | 1300 | 2 | 90 | 14 | L'Olivereta |

### What you get

| Field group | Fields |
|---|---|
| Listing | ID, operation, property type, title, URL, description, publication date, photos (count, main image, up to 10 URLs), video and virtual tour flags |
| Price | price in EUR, price as shown, €/m², price drop |
| Property | bedrooms, bathrooms, surface m², floor, amenities, new build, opportunity, auction, occupied |
| Location | street, neighbourhood, district, city, postal code, province, region, latitude, longitude |
| Publisher | agency or private, agency name, agency page, agency phone |
| Context | search location, search URL, total listings Fotocasa reports, source, alerts flag |

### Why this Actor

- **€/m² computed for every listing** plus GPS, district and postal code: ready for price maps and valuations.
- **Agency name, page and phone** for real estate lead generation (private sellers' phones are never collected).
- **Sale and rent, 7 property types**, any city, province or the whole of Spain; paste any Fotocasa result URL.
- **Price, bedrooms, surface and private-seller filters**; listings skipped by filters are not charged.
- **$0.90 per 1,000 listings** (+ $0.005 per run): a lower per-listing price than the $1 per 1,000 of the most-used Fotocasa scraper. Fast: about 30 listings per request.

### How to use it

1. Click **Try for free** (or **Start**): the prefilled input runs a quick test.
2. Add locations (Madrid, Barcelona, Valencia, malaga-provincia, espana), choose sale or rent and property type, optional price, bedrooms and surface filters, then set how many listings per location.
3. Click **Start** and wait a few seconds.
4. Open the **Output** tab and export as **JSON, CSV, Excel, XML or HTML**, or read the dataset via API.

### Input examples

**Homes for sale in Madrid (prefill):**

```json
{"locations": ["madrid-capital"], "maxItemsPerSearch": 31}
```

**Rentals in Valencia and Barcelona province, 2+ bedrooms, up to €1,500:**

```json
{"locations": ["Valencia", "barcelona-provincia"], "operation": "rent", "minRooms": 2, "maxPrice": 1500, "maxItemsPerSearch": 300}
```

**Commercial premises for rent in Sevilla:**

```json
{"locations": ["sevilla-capital"], "operation": "rent", "propertyType": "commercial", "maxItemsPerSearch": 200}
```

**Daily alerts: private sellers in Málaga:**

```json
{"locations": ["malaga-capital"], "privateOnly": true, "onlyNewListings": true, "alertsKey": "malaga-private", "maxItemsPerSearch": 500}
```

#### Input fields

| Field | Type | Description |
|---|---|---|
| `locations` | array | Cities or Fotocasa location slugs, one per line: Madrid, Barcelona, Valencia, sevilla-capital, malaga-provincia, espana. A plain city name means the city (…-capital). Empty = Madrid (demo). |
| `operation` | string | Sale or rental listings. |
| `propertyType` | string | Type of property. |
| `minPrice` | integer | Skip cheaper listings (filtered by the Actor; skipped listings are not charged). |
| `maxPrice` | integer | Skip more expensive listings. |
| `minRooms` | integer | Minimum number of bedrooms. |
| `minSurfaceSqm` | integer | Minimum built surface. |
| `privateOnly` | boolean | Keep only listings from private owners (particulares). |
| `maxItemsPerSearch` | integer | Fotocasa shows about 30 listings per page. |
| `maxPagesPerSearch` | integer | Stops reading a location after this many pages (useful with strict price filters). |
| `maxResults` | integer | Hard cap for the whole run. |
| `startUrls` | array | Optional: Fotocasa result URLs such as https://www.fotocasa.es/es/alquiler/viviendas/valencia-capital/todas-las-zonas/l (or a district page). |
| `onlyNewListings` | boolean | Return only listings not returned in earlier runs with the same alerts key. Only new listings are charged. |
| `alertsKey` | string | Name of this alert (e.g. rent-valencia). Each key keeps its own memory. |

### Output example

*Example record from a local test run (long lists shortened).*

```json
{
  "listingId": "190572746",
  "operation": "buy",
  "propertyType": "Flat",
  "title": "Flat in Calle Canencia de la Sierra, Ensanche de Vallecas - La Gavia",
  "price": 319000.0,
  "priceText": "319.000 €",
  "currency": "EUR",
  "pricePerSqm": 4833,
  "reducedPrice": null,
  "rooms": 1,
  "bathrooms": 1,
  "surfaceSqm": 66.0,
  "floor": 12,
  "amenities": [
    "air_conditioner",
    "cabinets",
    "heating"
  ],
  "street": "Calle Canencia de la Sierra, Ensanche de Vallecas - La Gavia",
  "neighborhood": "Ensanche de Vallecas - La Gavia",
  "district": "Villa de Vallecas",
  "city": "Madrid",
  "zipCode": "28051",
  "province": "Madrid",
  "region": "Madrid",
  "latitude": 40.36486024979729,
  "longitude": -3.619922944483147,
  "isNewConstruction": false,
  "isOpportunity": false,
  "isAuctioned": false,
  "isOccupied": false,
  "publisherType": "agency",
  "agencyName": "Vohome La Gavia",
  "agencyUrl": "https://www.fotocasa.es/es/pro/vohome-la-gavia/",
  "agencyPhone": "+34910133200",
  "imageCount": 29,
  "mainImage": "https://static.fotocasa.es/images/ads/10cfe741-0fd6-48fe-913f-b8f128378e80?rule=original",
  "hasVideo": true,
  "hasVirtualTour": true,
  "description": "Inmobiliaria VOhome Propiedades La Gavia pone a la venta este fantástico piso en el Ensanche de Vallecas. \r\n\r\nLa vivienda cuenta con una distribución cómoda y funcional, compuesta …",
  "publishedAt": "2026-08-27T19:45:17.127000+00:00",
  "url": "https://www.fotocasa.es/es/comprar/vivienda/madrid-capital/aire-acondicionado-calefaccion-parking-terraza-trastero-ascensor-piscina-no-amueblado/190572746/d",
  "searchLocation": "Madrid",
  "searchUrl": "https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l",
  "totalResults": 13408,
  "source": "fotocasa.es",
  "scrapedAt": "2026-11-23T23:18:51.463903+00:00",
  "isNew": false
}
```

#### Output fields

| Field | Description |
|---|---|
| `listingId` | Fotocasa property ID |
| `operation` | buy or rent |
| `propertyType` | Flat, House, Penthouse, Duplex, Studio… |
| `title` | Property type and street / neighbourhood |
| `price` | Asking price or monthly rent in EUR |
| `priceText` | Price as shown |
| `currency` | EUR |
| `pricePerSqm` | Price divided by surface |
| `reducedPrice` | Price reduction shown by Fotocasa, when any |
| `rooms` | Number of bedrooms |
| `bathrooms` | Number of bathrooms |
| `surfaceSqm` | Built surface |
| `floor` | Floor code as given by Fotocasa |
| `amenities` | e.g. elevator, terrace, air_conditioner, parking, swimming_pool, furnished, IS_EXTERIOR |
| `street` | Street and neighbourhood as shown |
| `neighborhood` | Neighbourhood |
| `district` | District |
| `city` | City / municipality |
| `zipCode` | Postal code |
| `province` | Province |
| `region` | Autonomous community |
| `latitude` | Approximate latitude |
| `longitude` | Approximate longitude |
| `isNewConstruction` | True for new construction |
| `isOpportunity` | Marked as opportunity |
| `isAuctioned` | Auction property |
| `isOccupied` | Occupied property |
| `publisherType` | agency or private |
| `agencyName` | Real estate agency (agencies only) |
| `agencyUrl` | Agency page on Fotocasa |
| `agencyPhone` | Agency contact phone (agencies only; private sellers are not included) |
| `imageCount` | Number of photos |
| `mainImage` | First photo URL |
| `images` | Up to 10 photo URLs |
| `hasVideo` | Has video |
| `hasVirtualTour` | Has virtual tour |
| `description` | Listing description |
| `publishedAt` | Publication / last update date (UTC) |
| `url` | Listing page |
| `searchLocation` | Location searched |
| `searchUrl` | Result page that found the listing |
| `totalResults` | Listings Fotocasa reports for the search |
| `source` | Always fotocasa.es |
| `scrapedAt` | When the row was saved (UTC) |
| `isNew` | True when saved in alerts mode |

### Pricing

Pay-per-event: **$0.005** once per run that saves results + **$0.0009 per listing** ($0.90 / 1,000). Runs that save nothing are not charged.

| Listings saved | Approx. cost |
|---|---|
| 20 | $0.023 |
| 100 | $0.095 |
| 1,000 | $0.905 |
| 10,000 | $9.005 |

### Use cases

- Property investors: find under-priced homes by €/m² and district
- Real estate agencies: market monitoring and agency lead lists with phones
- Rental market analysis: rents by city, district, bedrooms and surface
- Proptech and valuation models: structured Spanish listings with GPS
- Home seekers: daily alerts for new listings that match your filters

### Integrations / API

Works with the Apify API, Schedules, webhooks, Make, Zapier, n8n and MCP. Example:

```bash
curl "https://api.apify.com/v2/acts/datadesk-io~fotocasa-scraper/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" -H "Content-Type: application/json" \
  -d '{"locations": ["madrid-capital"], "maxItemsPerSearch": 31}'
```

Python:

```python
from apify_client import ApifyClient
client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("datadesk-io/fotocasa-scraper").call(run_input={"locations": ["madrid-capital"], "maxItemsPerSearch": 31})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

### MCP

Use this Actor from an MCP client (Cursor, Claude Desktop, etc.) through the Apify MCP server (`datadesk-io/fotocasa-scraper`).

### Alerts mode

Set **Only new listings** to on and give the run an **alerts key**. Each run returns only listings not seen in earlier runs with the same key, and only new listings are charged. Schedule it daily and connect a webhook, Make, Zapier or n8n to get new listings in Slack, email or a sheet.

### FAQ

**Which locations can I use?** A city name (Madrid, Valencia) means the city itself (Fotocasa slug madrid-capital). For a province use name-provincia (barcelona-provincia), for the whole country use espana, or paste any Fotocasa result URL (also district pages).

**Why are price and bedroom filters applied by the Actor?** Fotocasa's robots.txt disallows those URL filters for crawlers, so the Actor reads the allowed result pages and filters the rows itself. Skipped rows are free; with strict filters, raise Max pages per location.

**Do you collect private sellers' phone numbers?** No. Phone, agency name and page are included only for professional agencies.

**How fresh is the data?** Live: every run reads Fotocasa at that moment. Publication date is the date Fotocasa shows (it can be the last update).

**What does floor mean?** It is Fotocasa's floor code for the listing (it is not always the plain floor number).

### Limitations

- About 30 listings per page; Fotocasa result pages are read in order (default sort).
- Price, bedrooms and surface filters are applied after reading each page.
- Detail-page extras (energy certificate, full feature list) are not included.

### Start now

Click **Start** to run the prefilled example, then adjust the input. Missing a field or filter? Open an issue on the **Issues** tab and tell us what you need.

### Support

Questions, bugs or a missing field? Email **datadesk.io@proton.me** or open an issue on the Actor page.

***

**ES:** Extrae anuncios de Fotocasa (España): viviendas, locales, oficinas, garajes y terrenos en venta o alquiler por ciudad o provincia, con precio, €/m², habitaciones, baños, superficie, extras, dirección, GPS, inmobiliaria y teléfono, fotos y descripción. Alertas diarias. $0,90 por 1.000 anuncios.
**PT:** Extraia anúncios do Fotocasa (Espanha): casas, lojas, escritórios, garagens e terrenos à venda ou para alugar por cidade ou província, com preço, €/m², quartos, banheiros, área, comodidades, endereço, GPS, imobiliária e telefone, fotos e descrição. Alertas diários. US$0,90 por 1.000 anúncios.

# Actor input Schema

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

Cities or Fotocasa location slugs, one per line: Madrid, Barcelona, Valencia, sevilla-capital, malaga-provincia, espana. A plain city name means the city (…-capital). Empty = Madrid (demo).

## `operation` (type: `string`):

Sale or rental listings.

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

Type of property.

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

Skip cheaper listings (filtered by the Actor; skipped listings are not charged).

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

Skip more expensive listings.

## `minRooms` (type: `integer`):

Minimum number of bedrooms.

## `minSurfaceSqm` (type: `integer`):

Minimum built surface.

## `privateOnly` (type: `boolean`):

Keep only listings from private owners (particulares).

## `maxItemsPerSearch` (type: `integer`):

Fotocasa shows about 30 listings per page.

## `maxPagesPerSearch` (type: `integer`):

Stops reading a location after this many pages (useful with strict price filters).

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

Hard cap for the whole run.

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

Optional: Fotocasa result URLs such as https://www.fotocasa.es/es/alquiler/viviendas/valencia-capital/todas-las-zonas/l (or a district page).

## `onlyNewListings` (type: `boolean`):

Return only listings not returned in earlier runs with the same alerts key. Only new listings are charged.

## `alertsKey` (type: `string`):

Name of this alert (e.g. rent-valencia). Each key keeps its own memory.

## Actor input object example

```json
{
  "locations": [
    "madrid-capital",
    "barcelona-capital"
  ],
  "operation": "rent",
  "propertyType": "homes",
  "minPrice": 100000,
  "maxPrice": 400000,
  "minRooms": 2,
  "minSurfaceSqm": 60,
  "privateOnly": false,
  "maxItemsPerSearch": 300,
  "maxPagesPerSearch": 30,
  "maxResults": 1000,
  "startUrls": [
    {
      "url": "https://www.fotocasa.es/es/alquiler/viviendas/valencia-capital/todas-las-zonas/l"
    }
  ],
  "onlyNewListings": false,
  "alertsKey": "rent-valencia"
}
```

# Actor output Schema

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

No description

# 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 = {
    "locations": [
        "madrid-capital"
    ],
    "maxItemsPerSearch": 31
};

// Run the Actor and wait for it to finish
const run = await client.actor("datadesk-io/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 = {
    "locations": ["madrid-capital"],
    "maxItemsPerSearch": 31,
}

# Run the Actor and wait for it to finish
run = client.actor("datadesk-io/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 '{
  "locations": [
    "madrid-capital"
  ],
  "maxItemsPerSearch": 31
}' |
apify call datadesk-io/fotocasa-scraper --silent --output-dataset

```

## MCP server setup

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