# Fotocasa.es Spain Real Estate Scraper (`wyle/fotocasa-scraper`) Actor

Ultra-fast, HTTP-only reverse-engineered scraper for Fotocasa.es. Extracts Spain real estate listings, purchase & rental prices, living space (sqm), rooms, GPS coordinates, amenities, agent contacts, and full HD image galleries with zero browser overhead.

- **URL**: https://apify.com/wyle/fotocasa-scraper.md
- **Developed by:** [Willy Lengkong](https://apify.com/wyle) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.40 / 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.es Real Estate Scraper

High-speed, HTTP-only reverse-engineered scraper for **Fotocasa.es** — Spain's #1 leading real estate and property marketplace. Extracts sale and rental properties across Madrid, Barcelona, Valencia, Seville, Malaga, and all Spanish municipalities with **zero browser overhead** and minimal memory consumption (< 128MB).

***

### ⚡ Key Features

- **Blazing Fast HTTP Extraction**: Directly parses embedded high-yield Server-Side Rendered (SSR) state without headless browser emulation. Average execution time < 1 second per 30 listings.
- **Rich Property Attributes**:
  - **Pricing**: Raw numeric price in EUR, formatted display price, and historical price reductions.
  - **Coordinates & Location**: Exact GPS latitude/longitude, neighborhood, district, municipality, province, autonomous region, and postal code.
  - **Floor Plan & Dimensions**: Living area ($m^2$), bedrooms, bathrooms, floor number, and conservation status.
  - **Amenities & Features**: Automatic detection of elevator, garage/parking, balcony, terrace, air conditioning, heating, storage room, and swimming pool.
  - **Multimedia**: Complete high-resolution image galleries (up to 40+ photos per listing) and virtual tour flags.
  - **Advertiser Intelligence**: Agency/broker name, advertiser type (*professional* vs *particular*), phone number, and direct agency profile links.
- **Pay-Per-Event (PPE) Ready**: Extremely cost-efficient execution with negligible platform usage, perfect for competitive marketplace pricing ($0.0009 - $0.0015 / result).

***

### 📥 Input Parameters

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `startUrls` | Array of Strings | No | `["https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l"]` | Direct search or category URLs on Fotocasa.es. |
| `locations` | Array of Strings | No | `[]` | List of Spanish cities or regions (e.g. `madrid-capital`, `barcelona-capital`, `valencia-capital`). |
| `transactionType` | String (Select) | No | `"comprar"` | Transaction type: `"comprar"` (Buy/Sale), `"alquiler"` (Rent), or `"compartir"` (Room share). |
| `propertyType` | String (Select) | No | `"viviendas"` | Property type: `"viviendas"` (Homes/Flats), `"obra-nueva"` (New Builds), `"locales-o-naves"`, `"oficinas"`, `"garajes"`, `"terrenos"`. |
| `maxItems` | Integer | No | `50` | Maximum number of property records to extract. |
| `proxyConfiguration` | Object | No | `{"useApifyProxy": false}` | Optional proxy settings. Standard direct HTTP works smoothly, but Apify Residential proxy is supported for large-scale runs. |
| `impersonate` | String (Select) | No | `"chrome124"` | Browser TLS fingerprint profile for `curl_cffi` HTTP requests. |

***

### 📤 Output Schema Example

Each dataset item pushed to the default Apify Dataset matches the following JSON structure:

```json
{
  "id": "190402460",
  "url": "https://www.fotocasa.es/es/comprar/vivienda/madrid-capital/villa-de-vallecas-santa-eugenia/190402460/d",
  "price": 390000.0,
  "currency": "EUR",
  "priceFormatted": "390.000 €",
  "reducedPrice": null,
  "transactionType": "comprar",
  "surfaceM2": 109.0,
  "rooms": 3,
  "bathrooms": 2,
  "floor": "3",
  "conservationStatus": "good",
  "amenities": {
    "elevator": true,
    "parking": true,
    "balcony": false,
    "terrace": false,
    "airConditioner": false,
    "heating": true,
    "furnished": false,
    "storageRoom": false,
    "swimmingPool": false
  },
  "address": {
    "full": "Santa Eugenia, Villa de Vallecas, Madrid, Madrid",
    "neighborhood": "Santa Eugenia",
    "district": "Villa de Vallecas",
    "municipality": "Madrid",
    "province": "Madrid",
    "region": "Madrid",
    "zipCode": "28031",
    "country": "España"
  },
  "location": {
    "latitude": 40.38243629540415,
    "longitude": -3.6100592732759647
  },
  "advertiser": {
    "name": "VOhome Santa Eugenia",
    "type": "professional",
    "phone": "+34912345678",
    "agencyUrl": "https://www.fotocasa.es/es/pro/vohome-santa-eugenia/"
  },
  "images": [
    "https://static.fotocasa.es/images/ads/0bce7fe0-ddd8-420b-aa08-8b3dc4c3d040?rule=original",
    "https://static.fotocasa.es/images/ads/1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d?rule=original"
  ],
  "photosCount": 24,
  "isNewConstruction": false,
  "isHighlighted": false,
  "publishedDate": "2026-09-01T12:00:00Z",
  "originalDate": "2026-08-15T09:30:00Z",
  "scrapedAt": "2026-09-09T14:15:00.000000+00:00"
}
```

***

### 🚀 Use Cases

1. **Real Estate Investment & Valuation**: Track price-per-square-meter (€/$m^2$) trends across Spanish neighborhoods for automated valuation models (AVM).
2. **Rental Yield Analysis**: Compare purchase prices vs. long-term rental rates in high-growth hubs (Madrid, Barcelona, Malaga, Valencia).
3. **Competitive Broker Intelligence**: Monitor new listings from leading agencies (Engel & Völkers, Lucas Fox, Gilmar, Redpiso, Tecnocasa) instantly.
4. **Relocation & Travel Housing**: Build custom alerts for apartments with specific criteria (balconies, terraces, parking, elevators).

# Actor input Schema

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

Direct search or listing URLs on Fotocasa.es (e.g. https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l).

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

List of Spanish cities or municipalities (e.g. madrid-capital, barcelona-capital, valencia-capital, malaga-capital, sevilla-capital).

## `transactionType` (type: `string`):

Whether to search properties for sale (comprar), rent (alquiler), or shared room (compartir).

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

Type of real estate property.

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

Maximum number of property listings to scrape.

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

Optional proxy configuration. Fotocasa runs smoothly with standard connection, but Apify Residential proxy is recommended for massive multi-page scraping.

## `impersonate` (type: `string`):

Browser TLS fingerprint profile for curl\_cffi HTTP requests.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l"
  ],
  "locations": [],
  "transactionType": "comprar",
  "propertyType": "viviendas",
  "maxItems": 50,
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "impersonate": "chrome124"
}
```

# Actor output Schema

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

Dataset containing structured Fotocasa.es properties with prices, living areas, rooms, locations, amenities, and images.

# 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": [
        "https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l"
    ],
    "locations": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("wyle/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 = {
    "startUrls": ["https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l"],
    "locations": [],
}

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

```

## MCP server setup

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