# Fotocasa Listings Scraper (`piotrv1001/fotocasa-listings-scraper`) Actor

The Fotocasa Listings Scraper exports property listings from any Fotocasa search: price and price drops, rooms, bathrooms, surface, amenities, address, ZIP and coordinates, photos, description and the agency name and phone. Ideal for Spain real estate market research.

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

## Pricing

from $1.50 / 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 Listings Scraper

Export property listings from [Fotocasa](https://www.fotocasa.es), one of Spain's largest real estate portals. The **Fotocasa Listings Scraper** turns any Fotocasa search (viviendas, pisos, casas, áticos, for sale, rent or room share, anywhere in Spain) into structured data: price and price reduction, rooms, bathrooms, surface, amenities, address with ZIP code and map coordinates, the full description, photos and **the agency's name and phone**. Use it for rental and sale price monitoring, market research, investment analysis or agency lead lists.

### ✨ Features

- 🔎 **Any search you can build on Fotocasa**: paste the results URL after choosing operation, property type, location, price, size, rooms or sort order. Every page of that search is collected.
- 📞 **Agency contact**: agency name, seller type (professional or private), Fotocasa agency page and phone number.
- 📍 **Location down to the map pin**: address, neighbourhood, district, city, province and ZIP code, plus latitude and longitude.
- 📐 **Property details**: rooms, bathrooms, surface (m²), property type, new-construction flag and the list of amenities (lift, parking, terrace, air conditioning, pool...).
- 💶 **Prices**: asking price and the amount it was reduced by.
- ♻️ **No duplicates**: featured listings and listings shared by overlapping searches are returned and charged once.

### 🛠️ How It Works

1. **Search on Fotocasa** – Open [Fotocasa](https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l), set the location and filters you want and copy the URL of the results page.
2. **Paste the URL(s)** – Add one or more search URLs. A URL ending in `/l/3` starts from page 3.
3. **Set a limit** – `maxItems` caps the total number of listings (default 50).
4. **Run it** – Listings arrive page by page; the `SUMMARY` record shows, for each search, how many results Fotocasa reported and how many were collected.

### ⚙️ Input

| Field | Description |
|---|---|
| `startUrls` | Fotocasa search results URLs, e.g. `https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l`. |
| `maxItems` | Maximum number of listings across all searches. Default 50. |
| `proxyConfiguration` | Apify Proxy; the default (Spanish residential) works. |

```json
{
    "startUrls": [
        { "url": "https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l" },
        { "url": "https://www.fotocasa.es/es/alquiler/viviendas/barcelona-capital/todas-las-zonas/l?maxPrice=1500&minRooms=2" }
    ],
    "maxItems": 500
}
```

### 📊 Sample Output Data

```json
{
    "id": "186456592",
    "url": "https://www.fotocasa.es/es/alquiler/vivienda/barcelona-capital/aire-acondicionado-calefaccion-amueblado-internet/186456592/d",
    "transaction": "rent",
    "price": 1250,
    "priceReduction": 540,
    "propertyType": "Flat",
    "propertySubtype": "Flat",
    "isNewConstruction": false,
    "rooms": 2,
    "bathrooms": 1,
    "surface": 1,
    "features": [
        "air_conditioner",
        "heating",
        "furnished",
        "balcony",
        "internet"
    ],
    "location": "La Barceloneta",
    "neighborhood": "La Barceloneta",
    "district": "Ciutat Vella",
    "city": "Barcelona",
    "province": "Barcelona",
    "zipCode": "08003",
    "latitude": 41.38275751743155,
    "longitude": 2.1889080597882655,
    "description": "Bienvenido a este encantador apartamento de 2 habitaciones ubicado en el vibrante barrio de La Barceloneta. Este alojamiento, completamente amueblado y bien …",
    "agencyName": "Spotahome",
    "sellerType": "professional",
    "agencyUrl": "https://www.fotocasa.es/es/pro/spotahome-5/",
    "phone": null,
    "isFeatured": false,
    "publishedAt": "2025-05-12T16:23:47.060Z",
    "images": [
        "https://static.fotocasa.es/images/ads/a20a13c6-5510-4338-9486-dc2fa989442a?rule=original",
        "https://static.fotocasa.es/images/ads/ee1380fc-dcb5-4ac2-a9db-b73751098670?rule=original"
    ],
    "searchUrl": "https://www.fotocasa.es/es/alquiler/viviendas/barcelona-capital/todas-las-zonas/l/3?maxPrice=1500&minRooms=2&sortType=price&sortOrderDesc=false",
    "scrapedAt": "2026-10-10T10:04:12.633Z"
}
```

### 💰 Pricing

This Actor uses pay-per-event pricing:

| Event | Price |
|---|---|
| Listing returned to the dataset | $0.0015 ($1.50 per 1,000) |
| Actor start (once per run) | $0.00005 |

Examples: 100 listings cost $0.15005, 1,000 listings cost $1.50005. You pay only for listings delivered to the dataset; repeats are never charged. Set a maximum cost per run in Apify Console and the Actor stops when it is reached.

### ❓ FAQ

**Does it return phone numbers?**
Yes, `phone` carries the number Fotocasa shows for the advertiser, when there is one.

**In which order are listings collected?**
In the order of your URL. A search without a chosen order is collected newest first: Fotocasa's default order changes from one page load to the next, which would skip and repeat listings.

**How many listings can I get from one search?**
All of them: the Actor walks every page until the search runs out or your `maxItems` is reached.

**Is scraping Fotocasa legal?**
The Actor collects publicly visible listing data. Make sure your use of it complies with Fotocasa's terms and with data-protection law (GDPR), especially for contact details.

*Keywords: fotocasa scraper, fotocasa API, pisos en alquiler Madrid, viviendas en venta España, precios de vivienda, inmobiliarias.*

# Actor input Schema

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

Fotocasa search results pages, copied from the browser after choosing operation (buy/rent/share), property type, location, price, size, rooms or any other filter and sort. Every page of each search is collected. A URL ending in /l/3 starts from page 3.

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

Stop after this many listings across all searches. Each listing is returned once even when several searches include it.

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

Fotocasa works best from Spanish residential connections; the default works.

## Actor input object example

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

# Actor output Schema

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

No description

## `summary` (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/madrid-capital/todas-las-zonas/l"
        }
    ],
    "maxItems": 50,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "ES"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("piotrv1001/fotocasa-listings-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": 50,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "ES",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("piotrv1001/fotocasa-listings-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": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "ES"
  }
}' |
apify call piotrv1001/fotocasa-listings-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,piotrv1001/fotocasa-listings-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/1u4D7tYuwbAE8raPA/builds/AthzqmHuvadmqxdsu/openapi.json
