# Fotocasa Scraper — Spain Property Listings & Prices (`yugenox/fotocasa-scraper`) Actor

Scrape Fotocasa.es homes for sale and rent by city, district or neighbourhood: price, price drops, m², bedrooms, bathrooms, address, coordinates, photos, features, agency name and phone. Optional energy certificate, floor and agency reference. Private sellers' contacts are never collected. No login.

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

## Pricing

from $0.80 / 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.

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 property listings and prices

Scrape **Fotocasa.es**, one of Spain's biggest property portals, by city, town, province, district or neighbourhood. Every listing comes with the **price, price drop, size in m², price per m², bedrooms, bathrooms, address, neighbourhood, district, postal code, coordinates, photos, features (lift, terrace, pool, parking…), the full description and the agency's name, phone and Fotocasa page**. Turn on **listing details** to add the **energy certificate (rating and kWh/m²), floor, orientation, the agency's company name, website and its own reference**. Homes for sale, for rent and rooms to share. No login, no cookies, no Fotocasa account.

### What you get

| | |
|---|---|
| **Listing** | ID, URL, a short title, sale / rent / share, property type and subtype, new build or not, promoted or not |
| **Price** | Price in euros (monthly for rentals), the price before the latest drop, price per m² |
| **Property** | Built area m², plot m², bedrooms, bathrooms, amenities (lift, terrace, air conditioning, pool, parking, storage room, garden…) |
| **Location** | Address, street, neighbourhood, district, town, province, region, postal code, latitude/longitude and how precise they are |
| **Media** | Photo URLs (full size), photo count, video and virtual-tour flags |
| **Agency** | Agency name, Fotocasa agency page, logo, phone |
| **Listing details** (optional) | Energy and CO₂ ratings with values, floor, orientation, agency company name and website, the agency's own reference, every photo |
| **Dates** | When the listing was published and last updated |

Listings from **private sellers** (particulares) are included without the seller's name, phone or e-mail, or leave them out with **Only agency listings**.

### How to use it

1. Enter one or more **locations**: a Spanish city, town or province, e.g. `Madrid`, `Marbella`, `Sant Cugat del Vallès`, `Málaga provincia`. You can also paste a Fotocasa search URL, for example a district or neighbourhood page.
2. Choose **Buy or rent** and a **property type** (homes, flats, penthouses, houses, garages, offices, land…).
3. Set **Max listings** and any filters, then run.

**Max listings** is the total for the run, shared fairly between your locations.

#### Input examples

Flats for sale in Madrid between €300,000 and €600,000 with at least 2 bedrooms:

```json
{
  "locations": ["Madrid"],
  "operation": "buy",
  "propertyType": "flats",
  "minPrice": 300000,
  "maxPrice": 600000,
  "minBedrooms": 2,
  "maxItems": 200
}
```

New rentals on the Costa del Sol, published in the last 48 hours, with energy certificates (good for a daily schedule):

```json
{
  "locations": ["Marbella", "Estepona", "Benalmádena"],
  "operation": "rent",
  "listingFilter": "new-48h",
  "includeDetails": true,
  "maxItems": 300
}
```

One neighbourhood, from a pasted Fotocasa URL:

```json
{
  "startUrls": [{ "url": "https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/chamberi/l" }],
  "maxItems": 100
}
```

You can also paste listing URLs (they end in `/<number>/d`) to refresh specific properties.

### Output example

```json
{
  "site": "fotocasa",
  "listingId": "190682510",
  "url": "https://www.fotocasa.es/es/comprar/vivienda/madrid-capital/aire-acondicionado-calefaccion-terraza-no-amueblado/190682510/d",
  "title": "Flat for sale in Calle Lorenzo San Nicolás, Pueblo Nuevo",
  "operation": "sale",
  "propertyType": "flat",
  "propertySubtype": "intermediate floor",
  "price": 250000,
  "currency": "EUR",
  "previousPrice": null,
  "pricePerM2": 4807.69,
  "areaM2": 52,
  "bedrooms": 2,
  "bathrooms": 1,
  "floor": "2nd floor",
  "orientation": "southwest",
  "energyRating": "F",
  "energyConsumption": 319,
  "emissionsRating": "E",
  "emissionsValue": 60,
  "features": ["Air conditioning", "Heating", "Parquet floors", "Terrace", "Security door", "Unfurnished", "Exterior"],
  "address": "Calle Lorenzo San Nicolás, Pueblo Nuevo",
  "neighbourhood": "Pueblo Nuevo",
  "district": "Ciudad Lineal",
  "municipality": "Madrid",
  "province": "Madrid",
  "postalCode": "28017",
  "latitude": 40.4328,
  "longitude": -3.6407,
  "addressPrecision": "street",
  "imageCount": 20,
  "sellerType": "agency",
  "agencyName": "VOhome Pueblo Nuevo - Quintana",
  "agencyLegalName": "Vohome Quintana, Sl",
  "agencyPhone": "+34911138858",
  "agencyWebsite": "http://www.vohome.es/",
  "agencyReference": "QUIN1200397",
  "publishedAt": "2026-09-07T11:40:16.473Z",
  "searchLocation": "Madrid",
  "detailsFetched": true
}
```

Every row has the same columns (60 in total, see the Output tab); a value Fotocasa doesn't publish is `null`. `floor`, `orientation`, the energy fields, `agencyLegalName`, `agencyWebsite` and `agencyReference` are filled when **Include listing details** is on.

### Use cases

- **Price monitoring**: track asking prices and price drops by neighbourhood with a daily schedule.
- **Market analysis**: price per m², stock and mix of property types per district or town.
- **Investment sourcing**: find under-priced flats, auctions, bank-owned or tenanted properties.
- **Agency intelligence**: which agencies list where, how many properties, how they price.
- **Rental research**: monthly rents by area for yield calculations.

### FAQ

**Do I need a Fotocasa account, cookies or a login?** No. The scraper reads the same public pages any visitor sees. It never logs in and needs nothing from you except a location.

**How many listings can I get per city?** Fotocasa's robots.txt lets crawlers read only the first page of each search (30 listings), and this scraper respects that. To go further it reads the first page of every district and neighbourhood, then of each bedroom count, so a big city yields thousands of listings, though not always every single one. Paste district or neighbourhood URLs, or add filters, to focus a run.

**How fast is it?** About 30 listings per page and roughly 2 seconds per page, so 1,000 listings take around 2 minutes. **Include listing details** opens each listing's page, which adds about 2 seconds per listing.

**Why were details skipped for some listings?** Fotocasa's robots.txt asks crawlers not to open some listing pages, for example many in Madrid, Barcelona and Valencia. Those listings still come with all their search data and are not charged as details.

**Why are some filters slower?** Price, size and bedroom-range filters can't be sent to Fotocasa (its robots.txt disallows them), so the scraper applies them while reading. A narrow filter in a big city reads more pages to find matches. A run that keeps finding nothing stops early and tells you why.

**What about private sellers?** Their listings are included without the seller's name, phone, e-mail or house number, with coordinates rounded to about 100 m, and their descriptions have phone numbers and e-mails removed. Turn on **Only agency listings** to leave them out.

**Which proxy should I use?** Keep the default (Apify Proxy, datacenter). It comes with every Apify plan, including the free one. If Fotocasa refuses datacenter IPs for a while, the run switches to residential proxies when your account has them, and carries on without them when it doesn't.

**What does a run cost?** You pay per listing saved, per listing whose details were read, and a small fee per run. See the Pricing tab. Listings removed by your filters are never charged.

**Is it legal to scrape Fotocasa?** This Actor only collects publicly available data: property listings that anyone can see on Fotocasa without an account, such as prices, sizes, addresses as published, photos and the advertising agency's business details. Collecting publicly available data is generally legal, but you're responsible for how you use it. Listings can be published by private individuals; the scraper leaves out their name and contact details and removes phone numbers and e-mails from their descriptions. You must follow privacy laws such as GDPR and the Spanish LOPDGDD, as well as Fotocasa's terms. If you're unsure, check with a lawyer. More on this: [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/)

**Does it access any private data?** No. Everything comes from pages Fotocasa shows to any visitor without logging in. It never uses a login, never contacts advertisers, and follows Fotocasa's robots.txt.

*This Actor is not affiliated with, endorsed by or sponsored by Fotocasa or Adevinta. Fotocasa is a trademark of its owner.*

# Actor input Schema

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

Spanish cities, towns or provinces, e.g. "Madrid", "Marbella", "Sant Cugat del Vallès", "Málaga provincia". You can also paste Fotocasa search URLs here (a city, district or neighbourhood page). Each location is searched separately.

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

Listings for sale, for rent, or rooms to share.

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

Homes covers flats, apartments, penthouses, duplexes and houses together.

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

Maximum number of listings for the whole run, shared fairly between your locations. 0 = as many as possible.

## `includeDetails` (type: `boolean`):

Also open each listing's own page for the energy certificate (rating and kWh/m²), floor, orientation, the agency's legal name, website and its own reference, and every photo. One extra page per listing.

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

Optional: Fotocasa search URLs (a city, district or neighbourhood page) or listing URLs (they end in /<number>/d).

## `listingFilter` (type: `string`):

One of Fotocasa's own page filters. "Published in the last 48 hours" is ideal for a daily schedule.

## `bedrooms` (type: `integer`):

1 to 4. Leave empty for any.

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

For rentals: the monthly rent.

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

Only listings priced at or below this (€). Leave empty for no limit.

## `minBedrooms` (type: `integer`):

Only listings with at least this many bedrooms. Leave empty for no limit.

## `maxBedrooms` (type: `integer`):

Only listings with at most this many bedrooms. Leave empty for no limit.

## `minBathrooms` (type: `integer`):

Only listings with at least this many bathrooms. Leave empty for no limit.

## `minSize` (type: `integer`):

Only listings whose size (m²) is at least this value. Leave empty for no limit.

## `maxSize` (type: `integer`):

Only listings whose size (m²) is at most this value. Leave empty for no limit.

## `onlyAgencies` (type: `boolean`):

Leave out listings from private sellers (particulares). Their listings are otherwise included without the seller's name or phone.

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

Apify Proxy (datacenter) is the default and comes with every Apify plan. If Fotocasa refuses datacenter IPs for a while, the run switches to residential proxies when your account has them.

## Actor input object example

```json
{
  "locations": [
    "Madrid"
  ],
  "operation": "buy",
  "propertyType": "homes",
  "maxItems": 20,
  "includeDetails": false,
  "listingFilter": "none",
  "onlyAgencies": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

All scraped listings.

## `run` (type: `string`):

Status and statistics for this run.

## `report` (type: `string`):

RUN_REPORT: how the run ended, counts, requests and proxy use.

# 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"
    ],
    "maxItems": 20,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("yugenox/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"],
    "maxItems": 20,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("yugenox/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"
  ],
  "maxItems": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call yugenox/fotocasa-scraper --silent --output-dataset

```

## MCP server setup

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