# Fotocasa Scraper — Spain Property for Sale & Rent (`tortuga/fotocasa-scraper`) Actor

Scrape Fotocasa property listings for sale and rent in Spain: price, €/m², size, rooms, bathrooms, floor, address, coordinates, agency, photos, dates.

- **URL**: https://apify.com/tortuga/fotocasa-scraper.md
- **Developed by:** [Trevor Ortega](https://apify.com/tortuga) (community)
- **Categories:** Real estate
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.64 / 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

Scrape property listings from **Fotocasa** (fotocasa.es), Spain's second-largest property portal, for sale and to rent: price, price per m², size, rooms, bathrooms, floor, amenities, the full description, address and district, coordinates, photos, agency or private advertiser, and publication date. Turn on details for the energy certificate, construction type, orientation, conservation state, building age, all full-size photos, videos and the agency's reference.

Paste any Fotocasa search URL with your filters applied, or type a location (`madrid-capital`, `barcelona-capital`, `valencia-provincia`, ...) and set price, rooms, size and sort in the input. No login and no browser on your side: one request returns 30 listings, and the listings already come with their full description and coordinates. Export to JSON, CSV or Excel, or use the API. You pay per listing you get.

### What data does Fotocasa Scraper extract?

Every listing from a search page (the `result` event):

| Field | Description |
|---|---|
| `id`, `url` | Fotocasa listing id and listing URL (`.../189137740/d`) |
| `operation`, `propertyType`, `propertySubtype` | `sale` or `rent`; Fotocasa's own type and subtype (`Flat`, `Flat` / `Duplex`, `House` ...) |
| `price`, `currency`, `pricePeriod` | Price in EUR; `pricePeriod` is `month` for rentals and `null` for sales |
| `priceDrop` | Amount of the price reduction in EUR when Fotocasa shows one (`24.000 €` becomes `24000`) |
| `pricePerSqm` | Price divided by size, rounded to cents (monthly rent per m² for rentals) |
| `rooms`, `bathrooms`, `size` | Bedrooms, bathrooms, built size in m² |
| `floor`, `floorLabel`, `floorCode` | Floor number above the ground floor (1 = first floor; 10 means tenth or higher); `floorLabel` as Fotocasa words it (`GROUND_FLOOR`, `BASEMENT`, `3RD_FLOOR`); `floorCode` is Fotocasa's raw code. Ground floor and basement listings have `floor` `null` and a `floorLabel` |
| `elevator`, `features` | Lift yes/`null`; list of amenity keys the listing ticks (`air_conditioner`, `terrace`, `furnished`, `community_pool`, `storage_room`, ...) |
| `description` | Full listing description with line breaks |
| `address`, `neighborhood`, `district`, `municipality`, `province`, `region`, `zipCode` | Location as Fotocasa shows it. Street names are only published on some listings (see details) |
| `latitude`, `longitude` | Map coordinates. Fotocasa often shows an approximate point when the advertiser hides the exact address |
| `photos`, `hasVideo`, `hasVirtualTour`, `hasFloorPlan`, `isNewConstruction` | All photos in the search result (full size URLs) and media / new-build flags |
| `advertiserName`, `advertiserType`, `advertiserId`, `advertiserUrl` | Agency or private advertiser; `professional` or `private` |
| `publishedAt`, `updatedAt` | Publication time (UTC) and, when different, last update |
| `page`, `sourceUrl`, `scrapedAt` | Page number, the search it came from, time of scraping |

With **Include listing details** on, or for listing URLs (the extra `detail` event), each listing also gets:

| Field | Description |
|---|---|
| `title` | Fotocasa's listing title (`Piso de alquiler en Carrer Corsega`) |
| `street` | Street name when the advertiser publishes it |
| `energyRating`, `energyConsumption`, `emissionsRating`, `emissionsValue` | Energy certificate: class letter and value (kWh/m2 year), emissions class and value |
| `constructionType`, `antiquity`, `conservationState`, `orientation`, `furnished` | `secondHand` / `newConstruction`, building age band (`BETWEEN_10_AND_20_YEARS`), state (`VERY_GOOD`), orientation (`SOUTH`), furnished yes/no |
| `extraFeatures` | Readable feature list in Spanish (`Aire acondicionado`, `Terraza`, `Ascensor`) |
| `photos`, `videos`, `virtualTourUrl` | Every photo in original size, video links (YouTube / Vimeo), virtual tour link |
| `reference`, `advertiserLegalName` | The advertiser's reference code and the company's legal name |
| `detailError` | Why details are missing for this listing (e.g. it was removed), otherwise `null` |

Phone numbers sit behind a "show phone" button on Fotocasa and are not collected. Private advertisers are exported only as the alias Fotocasa shows publicly.

### How to scrape Fotocasa listings

1. Either paste **Start URLs**: any Fotocasa search page with filters chosen on the site (homes, offices, garages, land, new builds ...), or single listing URLs.
2. Or type **Locations** as they appear in Fotocasa URLs (`madrid-capital`, `barcelona-capital`, `sevilla-capital`, `malaga-provincia`, `espana`, or a district like `valencia-capital/algiros`), choose **For sale or to rent** and **Property type**, and optionally **Min / Max price**, **Min bedrooms**, **Min / Max size** and **Sort by**.
3. Set **Max items** (and **Max pages per search**) to cap the run and the cost.
4. Turn on **Include listing details** only if you need the fields from the listing page.
5. Click **Start** and download the dataset as JSON, CSV or Excel, or read it with the API.

#### Input example

```json
{
  "locations": ["barcelona-capital"],
  "operation": "rent",
  "propertyType": "pisos",
  "maxPrice": 2000,
  "minRooms": 2,
  "minSize": 50,
  "sort": "newest",
  "maxItems": 200,
  "includeDetails": false
}
```

The same with a URL: `{"startUrls": [{"url": "https://www.fotocasa.es/es/alquiler/pisos/barcelona-capital/todas-las-zonas/l?maxPrice=2000&minRooms=2&minSurface=50&sortType=publicationDate"}]}`.

#### Output example

One listing with details (long arrays shortened):

```json
{
  "id": "191314308",
  "url": "https://www.fotocasa.es/es/alquiler/vivienda/barcelona-capital/aire-acondicionado-calefaccion-ascensor-amueblado-television/191314308/d",
  "operation": "rent",
  "propertyType": "Flat",
  "propertySubtype": "Flat",
  "price": 1401,
  "currency": "EUR",
  "pricePeriod": "month",
  "priceDrop": null,
  "pricePerSqm": 15.4,
  "rooms": 2,
  "bathrooms": 2,
  "size": 91,
  "floor": 4,
  "floorCode": 9,
  "elevator": true,
  "features": ["air_conditioner", "cabinets", "elevator", "equiped_kitchen", "furnished", "heating", "parquet", "tv"],
  "description": "Descubre esta magnífica vivienda de 91 m², totalmente amueblada ...",
  "address": "Dreta de l'Eixample, Eixample, Barcelona, Barcelona",
  "neighborhood": "Dreta de l'Eixample",
  "district": "Eixample",
  "municipality": "Barcelona",
  "province": "Barcelona",
  "region": "Cataluña",
  "zipCode": "08037",
  "latitude": 41.400614646628085,
  "longitude": 2.1649027011891926,
  "photos": ["https://static.fotocasa.es/images/ads/2f34545c-f83c-4937-8...?rule=original", "..."],
  "hasVideo": false,
  "hasVirtualTour": false,
  "hasFloorPlan": false,
  "isNewConstruction": false,
  "advertiserName": "GuinotPrunera-somos ALTHENA Barcelona",
  "advertiserType": "professional",
  "advertiserId": 9202767552250,
  "advertiserUrl": "https://www.fotocasa.es/es/pro/guinotprunera-somos-althena-barcelona/",
  "publishedAt": "2026-11-05T12:49:14+00:00",
  "updatedAt": null,
  "sourceUrl": "https://www.fotocasa.es/es/alquiler/pisos/barcelona-capital/todas-las-zonas/l?maxPrice=2500&minRooms=2&sortType=publicationDate",
  "page": 1,
  "scrapedAt": "2026-11-05T14:54:03+00:00",
  "title": "Piso de alquiler en Carrer Corsega",
  "street": "Carrer Corsega",
  "constructionType": "secondHand",
  "antiquity": "BETWEEN_10_AND_20_YEARS",
  "conservationState": "VERY_GOOD",
  "orientation": "EAST",
  "furnished": true,
  "floorLabel": "4TH_FLOOR",
  "energyRating": "C",
  "energyConsumption": 55,
  "emissionsRating": "B",
  "emissionsValue": 9,
  "extraFeatures": ["Aire acondicionado", "Armarios", "Calefacción", "Parquet", "Ascensor", "Amueblado", "TV"],
  "videos": null,
  "virtualTourUrl": null,
  "reference": "33040",
  "advertiserLegalName": "Guinot Prunera",
  "detailError": null
}
```

Without details the same keys are present; the detail-only ones are `null` or empty.

### Monitor changes on a schedule

Turn on **Only new or changed items** to watch a search: each run remembers what earlier runs returned and outputs only listings that are new or whose price or price drop changed. Unchanged listings are dropped before any listing page is opened, so they are not charged. **Max items** then sets how many listings are checked per run; use the `newest` sort so new listings land in that window (30 listings = one search page). Save the input as a task and add a Schedule in Apify (for example hourly or daily), and give each watch its own **Monitoring key** if several schedules use the same search. Every output item has `changeType` (`new` or `changed`), and changed items have `previousValues` with the old values, e.g. `{"price": 730000}`.

### How much does it cost to scrape Fotocasa?

Pay per event; platform usage is included in the event price:

- **Listing** (`result`): **$0.0008** per listing saved, so 1,000 listings cost $0.80.
- **Listing details** (`detail`): **+$0.0008** per listing whose page was opened (Include listing details, or listing URLs).

There is no start fee. Search results already contain the description, features, coordinates and photos, so most users never need details.

### How many results can I get?

Fotocasa shows 30 listings per page. The Actor requests `/l/2`, `/l/3`, ... up to **Max pages per search** (default 10 = 300 listings) or until the search ends. Fotocasa shows the total count in the result (for example 12,666 sale listings in Madrid), which is reported in the run summary as `resultTotals`. For whole cities split the search by district, price band or size band (several Locations or Start URLs). A listing that appears in two of your searches is saved once. Very deep pages are not tested beyond a few dozen pages.

### Which property types and filters are supported?

With Locations: all homes (`viviendas`), flats, houses and villas (`chalets`), penthouses, duplexes, lofts, studios, new builds, retail premises, offices, industrial buildings, garages, storage rooms, land and whole buildings, for sale or to rent, with min/max price, min bedrooms, min/max size and a newest / lowest price sort. Any other filter Fotocasa offers (features, energy class, ...) works by pasting the search URL from your browser as a Start URL: the Actor keeps the query string on every page.

### Does it need a login or cookies?

No. It reads public search and listing pages only, through Apify's datacenter proxy. Fotocasa's CDN refuses roughly one request in three with a 403; the Actor retries on a fresh IP automatically, so you do not need to do anything.

### Is it legal to scrape Fotocasa?

The Actor collects public listing data that Fotocasa shows to every visitor: prices, property features, descriptions, agency names and photos. It does not collect phone numbers or e-mail addresses. Descriptions can mention people; you are responsible for how you use the data under GDPR and Fotocasa's terms. If in doubt, consult a lawyer.

### Related scrapers

- [Immobiliare.it Scraper](https://apify.com/tortuga/immobiliare-scraper): Italian Property Listings & Prices
- [ImmoScout24 Scraper](https://apify.com/tortuga/immobilienscout24-scraper): German Rentals & Homes for Sale
- [SeLoger Scraper](https://apify.com/tortuga/seloger-scraper): French Real Estate Listings
- [Funda Scraper](https://apify.com/tortuga/funda-scraper): Dutch Property for Sale & Rent
- [Leboncoin Scraper](https://apify.com/tortuga/leboncoin-scraper): Listings, Prices & Sellers

### Found it useful?

A ★ review on this Actor's Apify Store page helps other users find it and tells us what to improve. Issues and feature requests are welcome in the Actor's **Issues** tab.

# Actor input Schema

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

Fotocasa search pages from fotocasa.es with any filters applied in the browser, e.g. https://www.fotocasa.es/es/comprar/viviendas/valencia-capital/todas-las-zonas/l or https://www.fotocasa.es/es/alquiler/viviendas/barcelona-capital/todas-las-zonas/l?maxPrice=1500. Homes, offices, garages, land and other property types work the same way. A single listing URL (…/189137740/d) returns that listing with full details. Leave empty if you use Locations instead.

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

Alternative to Start URLs: location slugs as they appear in Fotocasa URLs, e.g. "madrid-capital", "barcelona-capital", "valencia-provincia", "malaga-capital", "espana" (whole country), or a district as "valencia-capital/algiros". Searches the property type and operation chosen below, with the filters below.

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

Used with Locations.

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

Used with Locations. 'Homes' covers flats, houses and every other kind of dwelling.

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

Used with Locations. Sale price, or monthly rent for rentals.

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

Used with Locations. Sale price, or monthly rent for rentals.

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

Used with Locations. Minimum number of rooms (bedrooms).

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

Used with Locations.

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

Used with Locations.

## `sort` (type: `string`):

Used with Locations. Default is Fotocasa's relevance order (promoted listings first). 'Newest' sorts by publication date.

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

Stop after this many listings in total (across all searches). Keeps cost predictable. Fotocasa shows 30 listings per page.

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

Stop each search after this many result pages (30 listings each). Use filters or several locations to get more results.

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

Also open every listing page to add the energy certificate, construction type, orientation, conservation state, age, furnished flag, readable extra features, all full-size photos, videos, reference and street name when published. One extra request per listing and an extra 'detail' event per listing. The search results already include the full description, features, coordinates and photos.

## `onlyNewOrChanged` (type: `boolean`):

Remember what earlier runs of this search returned and output only new listings or listings whose price or price drop changed. Use with a Schedule; unchanged listings are not charged and their listing pages are not opened. With this on, Max items is the number of listings checked per run (e.g. the newest 30 with sort 'newest').

## `monitoringKey` (type: `string`):

Name for this watch, so several schedules on the same search stay separate; defaults to a key derived from the search input

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

Apify datacenter proxy works for Fotocasa. About 1 request in 3 gets a CloudFront 403 and is retried on a new IP automatically.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.fotocasa.es/es/comprar/viviendas/valencia-capital/todas-las-zonas/l"
    }
  ],
  "operation": "sale",
  "propertyType": "viviendas",
  "sort": "",
  "maxItems": 30,
  "maxPagesPerSearch": 1,
  "includeDetails": false,
  "onlyNewOrChanged": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "startUrls": [
        {
            "url": "https://www.fotocasa.es/es/comprar/viviendas/valencia-capital/todas-las-zonas/l"
        }
    ],
    "maxItems": 30,
    "maxPagesPerSearch": 1,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

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

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

```

## MCP server setup

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