# Fotocasa Spain Real Estate Scraper (`parseforge/fotocasa-spain-scraper`) Actor

Scrape Fotocasa.es property listings from any search URL: price, size, rooms, energy certificate, coordinates, agency phone and every photo. Export to CSV, JSON, Excel or XML.

- **URL**: https://apify.com/parseforge/fotocasa-spain-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Real estate, Automation, 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 property 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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

![ParseForge Banner](https://github.com/ParseForge/apify-assets/blob/ad35ccc13ddd068b9d6cba33f323962e39aed5b2/banner.jpg?raw=true)

## 🏠 Fotocasa Spain Real Estate Scraper

> 🚀 **Export Fotocasa property listings in seconds.** Paste any fotocasa.es search URL and get every listing as a flat row with 70 fields: price, euros per square metre, rooms, surface, floor, energy certificate, coordinates, agency name and phone, and every photo.

Fotocasa is one of Spain's two largest property portals, with tens of thousands of active sale and rental listings in every province. This Actor reads the same server-rendered data the Fotocasa website uses to draw its search results and listing pages, so you get the portal's own structured record for each property, not a guess parsed from the layout. No login, no API key, no browser.

A single Madrid capital search held 11,495 sale listings on the day this README was written. The Actor walks every results page (30 listings each), opens each listing for the full record, and stops exactly at your maximum. It accepts Spanish, Catalan, English and German Fotocasa URLs, sale and rental searches, room shares, and single listing URLs.

| 🎯 Target Audience | 💡 Primary Use Cases |
|---|---|
| Real estate investors and buy-to-let funds | Track asking prices and euros per square metre by neighbourhood |
| Market analysts and proptech teams | Build supply, price and time-on-market datasets across Spanish cities |
| Agencies and lead generation teams | Collect agency names, phones and references from every active listing |
| Data journalists and researchers | Study housing affordability, energy ratings and rental supply |

### 📋 What the Fotocasa Spain Real Estate Scraper does

- 🔗 **Any search URL.** Copy a fotocasa.es results page with your filters already applied (buy or rent, property type, city, district, price, rooms) and the Actor follows every page of it.
- 🏘 **Full listing records.** Opens each property page to add the description, energy certificate letters and kWh values, orientation, floor, heating, hot water, conservation state, building age, agency legal name and reference.
- 📐 **Derived pricing.** Computes euros per square metre from the listing's own price and surface, ready for comparisons.
- 📅 **Real dates.** Converts Fotocasa's relative "published 3 days ago" into an exact ISO timestamp.
- 🗺 **Coordinates and address hierarchy.** Latitude, longitude, street, neighbourhood, district, city, county, province, region and zip code on every row.
- ⚡ **Sort control.** Newest, oldest, cheapest, most expensive or largest first, so a small run grabs exactly the listings you want.

> 💡 **Why it matters:** Fotocasa has no public API. Its listing data lives inside the pages, and the Actor extracts it as clean, typed rows you can export to CSV, Excel, JSON or XML, feed to a spreadsheet, or pipe into your own models.

### 🎬 Full Demo (🚧 Coming soon)

### 📊 Output

Each row is one property listing. The Overview view in the Dataset tab shows the key columns; the full export carries all 70 fields.

| Field | Description |
|---|---|
| 🖼 `imageUrl` | Main photo |
| 🏠 `title` | Property type, transaction and location, e.g. "Flat for rent in Barri Gòtic, Barcelona" |
| 🔗 `url` | Canonical listing URL |
| 🆔 `id` | Fotocasa listing id |
| 🔁 `transactionType` | Sale, Rent, Share, Rent to buy or Transfer |
| 🏢 `propertyType`, `propertySubtype` | Flat, House, Penthouse, Studio, Ground floor with garden, ... |
| 💶 `price`, `priceText`, `currency` | Numeric price in EUR and the display string (per month for rentals) |
| 📐 `pricePerSqm` | Price divided by surface, rounded |
| 📉 `priceDrop` | Amount the price was reduced, 0 when unchanged |
| 🛏 `rooms`, `bathrooms`, `surface` | Rooms, bathrooms and built surface in m² |
| 🪜 `floor`, `orientation` | Floor (e.g. "5th floor", "Ground floor") and compass orientation |
| 🏗 `antiquity`, `conservationState`, `constructionType` | Building age band, condition and second hand vs new build |
| 🔥 `heating`, `hotWater` | Energy source for heating and hot water |
| ✅ `hasElevator`, `isFurnished`, `hasAirConditioning`, `hasParking`, `hasTerrace`, `hasBalcony`, `hasPool`, `hasGarden`, `hasStorageRoom`, `petsAllowed` | Yes / No feature flags |
| 🆕 `isNewConstruction`, `hasVideo`, `hasVirtualTour`, `hasFloorPlans` | Yes / No |
| ⚡ `energyCertificate`, `energyRating`, `energyConsumption`, `emissionsRating`, `emissionsValue` | Certificate status (Valid, Exempt, In process), letters A to G and kWh/m² and kg CO₂/m² per year |
| 📝 `description` | Full listing text as written by the advertiser |
| 📅 `publishedAt` | ISO timestamp of publication |
| 📍 `address`, `neighborhood`, `district`, `city`, `county`, `province`, `region`, `zipCode`, `country` | Address hierarchy |
| 🗺 `latitude`, `longitude`, `isExactLocation` | Coordinates and whether Fotocasa marks them as exact |
| 🏢 `agencyName`, `agencyLegalName`, `agencyType`, `agencyPhone`, `agencyUrl`, `agencyLogoUrl`, `agencyReference` | Advertiser details (professional or private) |
| 🧩 `featureKeys`, `extraFeatures`, `subsidies` | Feature lists as Fotocasa tags them, plus public purchase subsidies the listing qualifies for |
| 📷 `imageCount`, `images`, `videos` | Every photo URL in order, plus YouTube or hosted video links |
| 🕒 `scrapedAt`, `error` | Scrape timestamp; `error` is null on data rows |

Sample rows from a real run:

```json
{
  "imageUrl": "https://static.fotocasa.es/images/ads/338410b1-0a15-497e-b3e5-19aa8f51bf71?rule=original",
  "title": "Flat for rent in Barri Gòtic, Barcelona",
  "url": "https://www.fotocasa.es/es/alquiler/vivienda/barcelona-capital/aire-acondicionado-parking-ascensor-patio-amueblado-television-se-aceptan-mascotas-internet/190691868/d",
  "id": 190691868,
  "transactionType": "Rent",
  "propertyType": "Flat",
  "price": 900,
  "priceText": "900 €/month",
  "pricePerSqm": 9,
  "rooms": 3,
  "bathrooms": 2,
  "surface": 99,
  "floor": "2nd floor",
  "orientation": "North",
  "hasElevator": "Yes",
  "isFurnished": "Yes",
  "petsAllowed": "Yes",
  "energyCertificate": "Exempt",
  "publishedAt": "2026-09-07T23:51:53.603Z",
  "neighborhood": "Barri Gòtic",
  "district": "Ciutat Vella",
  "city": "Barcelona",
  "zipCode": "08002",
  "latitude": 41.3850735,
  "longitude": 2.1736581,
  "agencyName": "FIN EL",
  "agencyLegalName": "FIN EL SL",
  "agencyPhone": "+34657212567",
  "agencyReference": "APPFKEI-79",
  "extraFeatures": ["Aire acondicionado", "Garaje privado", "Ascensor", "Patio", "Amueblado", "TV", "Se aceptan mascotas", "Internet", "Cocina Equipada"],
  "imageCount": 6
}
```

```json
{
  "title": "Flat for sale in Ventas, Madrid Capital",
  "url": "https://www.fotocasa.es/es/comprar/vivienda/madrid-capital/aire-acondicionado-calefaccion-amueblado/189752697/d",
  "transactionType": "Sale",
  "priceText": "299.900 €",
  "pricePerSqm": 5453,
  "surface": 55,
  "floor": "5th floor",
  "orientation": "East",
  "antiquity": "Between 50 and 70 years",
  "conservationState": "Very good",
  "heating": "Electricity",
  "energyCertificate": "Valid",
  "energyRating": "G",
  "energyConsumption": 999,
  "emissionsRating": "G",
  "publishedAt": "2026-05-22T11:22:17.243Z",
  "agencyName": "TengoTuCasa",
  "agencyReference": "83976",
  "subsidies": ["aval-comprar-casa-nacional", "mi-primera-vivienda-madrid"],
  "imageCount": 35
}
```

```json
{
  "title": "Ground floor with garden for sale in El Cabanyal - El Canyamelar, Valencia",
  "url": "https://www.fotocasa.es/en/buy/home/valencia/el-cabanyal-el-canyamelar/189911411/d",
  "transactionType": "Sale",
  "propertySubtype": "Ground floor with garden",
  "priceText": "149.000 €",
  "pricePerSqm": 4139,
  "surface": 36,
  "floor": "Ground floor",
  "city": "Valencia",
  "province": "Valencia",
  "agencyName": "Sorolla Servicios Inmobiliarios",
  "publishedAt": "2026-06-08T11:29:58.373Z",
  "imageCount": 6
}
```

Values Fotocasa withholds for a listing (no energy certificate letters when the listing is exempt, no orientation or building age on many rentals, no description when the advertiser left it blank) come back as `"Not Disclosed"` rather than empty cells, so your spreadsheet columns stay typed.

### ✨ Why choose this Actor

- 🧾 **The portal's own record, not a layout scrape.** Reads the structured data embedded in each page, so rows do not break when Fotocasa restyles its cards.
- 🧮 **70 typed fields per listing**, including energy certificate values, agency reference numbers and exact publication timestamps that most alternatives skip.
- 🔁 **Sale, rent, share, rent-to-buy and transfer** searches, plus single listing URLs, in any of Fotocasa's four site languages.
- 🎚 **Depth switch.** Turn listing details off for a fast, cheaper pass over search cards only (price, size, rooms, features, coordinates, agency phone and photos are already on the card).
- 🧹 **Deduplicated.** Promoted listings that Fotocasa repeats across pages are delivered once.
- 🛡 **Proxy-ready.** Fotocasa blocks datacenter and most non-European IPs, so the Actor ships with Spanish residential proxies switched on and rotates sessions on any block.

### 📈 How it compares to alternatives

| Feature | ParseForge | Fotocasa Scraper (igolaizola) | Fotocasa.es Search Results Scraper (azzouzana) | Fotocasa Scraper (memo23) |
|---|---|---|---|---|
| Input | Search URL or listing URL | Location name, coordinates and filters | Search URL | Search URL |
| Listing detail pages | Yes, switchable | Yes | Not listed | Not listed |
| Energy certificate letters and values | Yes | Not listed | Not listed | Not listed |
| Euros per square metre | Yes, computed | No | No | No |
| Exact publication timestamp | Yes | Yes | Not listed | Not listed |
| Agency phone and reference | Yes | Phone only | Not listed | Not listed |
| Sort control | 6 options | 7 options | URL only | URL only |
| Browser required | No | No | No | No |

Fotocasa itself sets one limit worth knowing: it serves 30 listings per results page and re-inserts promoted listings on later pages. The Actor dedupes those and stops when the search is exhausted, so very large searches (a whole province) are best split by city or price band to keep runs short.

### 🚀 How to use

1. [Create a free Apify account](https://console.apify.com/sign-up?fpr=vmoqkp) and get $5 of monthly credit.
2. Open the [Fotocasa Spain Real Estate Scraper](https://apify.com/parseforge/fotocasa-spain-scraper?fpr=vmoqkp) in Apify Store.
3. On fotocasa.es, run the search you want (buy or rent, city, price, rooms) and copy the URL from the address bar.
4. Paste it into **Fotocasa search or listing URLs**, set **Max Items**, and optionally pick a sort order or switch off listing details.
5. Click **Start**. When the run finishes, download the dataset from the **Dataset** tab as CSV, Excel, JSON or XML, or read it through the API.

A first run with the defaults:

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

### 💼 Business use cases

#### 📈 Price monitoring for investors

Run the same Madrid Salamanca search every Monday sorted by newest first, keep `id`, `price`, `pricePerSqm` and `publishedAt`, and chart how asking prices move week over week.

#### 🏢 Agency lead lists

Scrape a province with details switched off, group rows by `agencyName` and `agencyPhone`, and you have every active agency in the area with the number of listings each one carries.

#### 🧮 Valuation models

Combine `surface`, `rooms`, `floor`, `energyRating`, `antiquity`, `latitude` and `longitude` from tens of thousands of listings to train a hedonic price model for a city.

#### 🔔 New supply alerts

Schedule a daily run with `sortBy: "publicationDate"` and `maxItems: 50`, then push the rows to Slack or email to catch new listings before they are widely seen.

### 🔌 Automating Fotocasa Spain Real Estate Scraper

- **Make and Zapier**: trigger a run on a schedule and send new rows to Google Sheets, Airtable or a CRM.
- **Slack**: post the newest listings from each run into a channel with the Apify Slack integration.
- **Airbyte**: sync every dataset into your warehouse for historical analysis.
- **GitHub Actions**: call the Apify API from a workflow to refresh a dataset that feeds a dashboard.
- **Google Drive**: export each run as an Excel file straight into a shared folder.

### 🌟 Beyond business use cases

- **Research**: compare energy ratings and prices per square metre across Spanish provinces.
- **Personal**: watch one neighbourhood for a flat that fits your budget and get an alert the day it appears.
- **Non-profit**: measure rental affordability and supply in a city for a housing report.
- **Experimentation**: feed listing descriptions and photos to a language or vision model to tag renovation state.

### 🤖 Ask an AI assistant about this scraper

Add the Actor to Claude, Cursor or any MCP client and ask for Fotocasa data in plain language:

```bash
claude mcp add --transport http apify "https://mcp.apify.com?tools=parseforge/fotocasa-spain-scraper"
```

### ❓ Frequently Asked Questions

#### 🔑 Do I need a Fotocasa account or API key?

No. The Actor reads public listing pages only.

#### 🔗 Which URLs work?

Any fotocasa.es results page whose path ends in `/l` (with or without filters and a page number) and any single listing page whose path ends in `/d`. Spanish (`/es/`), Catalan (`/ca/`), English (`/en/`) and German (`/de/`) URLs are all accepted.

#### 🏠 Does it work for rentals and room shares?

Yes. Paste a rental (`/alquiler/`) or share (`/compartir/`) search and the rows carry `transactionType` "Rent" or "Share" with the monthly price.

#### 🧾 What does "Open each listing for full details" add?

The description, energy certificate letters and values, orientation, floor, heating, hot water, conservation state, building age, agency legal name and reference, and any video. It costs one extra request per listing. Switch it off for a faster pass over search cards only.

#### 🔢 How many listings can one URL return?

Everything the search holds. Fotocasa serves 30 listings per page and the Actor walks every page until the search count is reached or your Max Items is hit.

#### ⚡ Why is the energy rating "Not Disclosed" on some rows?

Fotocasa marks many listings, most rentals in particular, as exempt or in process. The Actor reports that status in `energyCertificate` and leaves the letters as "Not Disclosed" rather than inventing a value.

#### 🗺 Are the coordinates exact?

When `isExactLocation` is "Yes". Otherwise Fotocasa places the pin at the neighbourhood or street level, which the Actor passes through as is.

#### 🛡 Do I need a proxy?

Yes, and it is switched on by default. Fotocasa blocks datacenter IP ranges and most non-European IPs with a 403 page, so the Actor uses Apify residential proxies with Spain as the country. Keep that setting unless you have your own Spanish proxies.

#### 🚦 Why did I get an error row?

A row with an `error` field means a URL was not a Fotocasa search or listing URL, a listing was removed (404), or the site blocked the request even after retries. Data rows always have `error` set to null.

#### 📅 Where does `publishedAt` come from?

From the timestamp Fotocasa embeds in each listing card and detail page, converted to ISO 8601 in UTC.

#### 📤 What export formats are supported?

CSV, Excel, JSON and XML from the Dataset tab, or any of them through the Apify API.

### 🔌 Integrate with any app

Run the Actor from the Apify API, the JavaScript or Python client, the CLI, or through webhooks, and connect it to Make, Zapier, n8n, Google Sheets, Slack, Airbyte or your own code.

### 🔗 Recommended Actors

- [Habitaclia Spain Real Estate Scraper](https://apify.com/parseforge/habitaclia-spain-scraper?fpr=vmoqkp): the Catalonia-focused sister portal, same row layout.

> 💡 **Pro Tip:** browse the complete [ParseForge collection](https://apify.com/parseforge?fpr=vmoqkp) for more real estate and marketplace scrapers.

**🆘 Need Help?** [Open our contact form](https://tally.so/r/BzdKgA) with your run ID, your input and what you expected.

> **⚠️ Disclaimer:** This Actor is an independent tool and is not affiliated with, endorsed by, or sponsored by Fotocasa or Adevinta Spain, S.L.U. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR. Do not use it to collect personal data unlawfully.

# Actor input Schema

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

One or more fotocasa.es URLs. Paste a search results page copied from your browser with every filter already applied (buy or rent, property type, city or district, price, rooms), for example https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l. Single listing URLs ending in /d also work. Spanish, Catalan, English and German URLs are all accepted.

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

Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000

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

On (default): one extra request per listing to collect the energy certificate, orientation, floor, heating, building age, agency legal name and reference. Off: faster and lighter, search-card fields only.

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

Order in which Fotocasa returns the results. Useful with a low Max Items to grab only the newest or cheapest listings.

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

Keep Apify residential proxies with country Spain enabled. Datacenter proxies and the automatic proxy group are blocked by Fotocasa.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l"
    }
  ],
  "maxItems": 10,
  "includeDetails": true,
  "sortBy": "",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "ES"
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

Key identity, price, size and location fields

## `fullData` (type: `string`):

Complete dataset with all 70 fields, including energy certificate, agency contact, feature lists, photos and videos

# 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": [
        {
            "url": "https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l"
        }
    ],
    "maxItems": 10,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "ES"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/fotocasa-spain-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": [{ "url": "https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l" }],
    "maxItems": 10,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "ES",
    },
}

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

```

## MCP server setup

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