# Fotocasa Scraper: Spain Property Listings, Agency Phones (`fayoussef/fotocasa-scraper`) Actor

Scrape property listings from Fotocasa.es, one of Spain's biggest real estate portals. Filter by province, city, price, rooms and size. Export prices, addresses, coordinates, photos and agency phone numbers, or one lead row per agency.

- **URL**: https://apify.com/fayoussef/fotocasa-scraper.md
- **Developed by:** [Youssef Farhan](https://apify.com/fayoussef) (community)
- **Categories:** Real estate, Developer tools, MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.68 / 1,000 result scrapeds

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

### What does Fotocasa Scraper do?

**Fotocasa Scraper** extracts property listings from [Fotocasa.es](https://www.fotocasa.es), one of Spain's biggest real estate portals. Search homes, commercial premises, offices, land and garages, for sale or for rent, across any province or city. You get **prices, addresses, coordinates, photos and agency phone numbers** as clean data you can download or send to your own tools.

It also has an **agency leads mode**: one row per real-estate agency, with its phone, how many listings it has and its price range. That makes it a quick way to build a Spanish estate agent list.

Running it on Apify gives you an API, scheduling, integrations and monitoring, with no setup and no proxy to manage.

### Why use this Fotocasa scraper?

- **Find estate agents in Spain**: build a lead list of agencies by province or city, with phone numbers.
- **Track the property market**: follow prices, price per square metre and price reductions by area.
- **Find investment deals**: filter by price, size and rooms, then sort by newest or cheapest.
- **Feed your own tools**: send fresh listings to a spreadsheet, CRM or dashboard on a schedule.

### How to scrape Fotocasa

1. Click **Try for free**.
2. Pick the operation and property type, then choose provinces or type city names.
3. Add any filters: price, rooms, bathrooms or surface.
4. Choose **Agency leads** if you want one row per agency.
5. Click **Start**, then download your results as JSON, CSV, Excel or HTML.

You can also paste a search results URL from fotocasa.es instead of using the form.

### Input

Every field is optional. An empty form searches homes for sale across Spain.

```json
{
    "mode": "listings",
    "max_items": 100,
    "operation": "sale",
    "property_type": "viviendas",
    "provinces": ["malaga-provincia"],
    "cities": ["Madrid"],
    "price_to": 300000,
    "rooms_from": 2,
    "sort_by": "newest"
}
```

### Output

One record per listing:

```json
{
    "id": "191260818",
    "url": "https://www.fotocasa.es/es/comprar/vivienda/riudecols/191260818/d",
    "operation": "sale",
    "property_type": "Flat",
    "location": "Carrer de Catalunya, Riudecols",
    "price_eur": 125000,
    "price_per_m2_eur": 1953,
    "rooms": 2,
    "bathrooms": 1,
    "surface_m2": 64,
    "province": "Tarragona",
    "city": "Riudecols",
    "postal_code": "43390",
    "latitude": 41.1679,
    "longitude": 0.9774,
    "seller_type": "agency",
    "agency_name": "Example Inmobiliaria",
    "agency_phone": "+34900000000",
    "published_at": "2026-10-30T19:38:13+00:00",
    "image_url": "https://static.fotocasa.es/images/ads/example?rule=original"
}
```

In agency leads mode, each row has `agency_name`, `agency_phone`, `agency_url`, `listings_found`, `provinces`, `cities`, `lowest_price_eur`, `highest_price_eur` and `sample_listing_url`.

### Data fields

| Field | What it is |
| --- | --- |
| `price_eur`, `price_reduction_eur`, `price_per_m2_eur` | Asking price, the amount it was reduced by, and price per square metre |
| `rooms`, `bathrooms`, `surface_m2`, `floor` | Size and layout |
| `amenities` | Features such as terrace, heating or air conditioning |
| `province`, `city`, `district`, `neighborhood`, `postal_code` | Location |
| `latitude`, `longitude` | Map coordinates |
| `seller_type`, `agency_name`, `agency_phone`, `agency_url` | Who is selling |
| `published_at`, `is_new_construction` | Listing date and new-build flag |
| `description`, `image_url`, `images` | Listing text and photos |

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

This Actor is pay per result: you pay for each row delivered, plus a small charge when a run starts. The current rate is shown on this Actor's Store page.

Free Apify users get up to 50 results per run, on their own Apify Proxy credit. A [paid Apify plan](https://apify.com/pricing?fpr=youssef) removes the cap and includes the proxy.

### Tips

- **Large searches are handled for you.** Fotocasa only serves about 9,000 results per search, so bigger searches are split into price bands automatically.
- **Listings with no price** can fall outside those bands on very large searches.
- **Use Max results** to control your spend. Agency leads mode stops once it has found that many agencies.
- **Use your own proxy** if you prefer: add your proxy URLs in the Proxy section.

### FAQ

#### Can I get a phone number for every listing?

No. Phone numbers are included for agencies when Fotocasa shows them. Private sellers' contact details are left out on purpose, because they are personal data. Rentals show fewer phone numbers than sales.

#### Is it legal to scrape Fotocasa?

This Actor only reads publicly visible pages. You are responsible for how you use the data, including data protection law such as GDPR when you contact businesses, and for checking the site's terms. If in doubt, ask a lawyer.

#### Can I use it from an AI agent?

Yes. Call it from any AI agent through the Apify MCP server, or from your own code with the Apify API.

#### Something does not work

Please open an [Issue](https://apify.com/fayoussef/fotocasa-scraper/issues/open) and I'll fix it.

💼 Need a custom version or another site? [Contact me through my Apify profile](https://apify.com/fayoussef)

***

### Spanish version

🇪🇸 **En español**

**Scraper de Fotocasa: anuncios de pisos y casas en España, con teléfonos de inmobiliarias.**

Extrae anuncios inmobiliarios de **Fotocasa.es**, uno de los mayores portales inmobiliarios de España. Busca viviendas, locales, oficinas, terrenos y garajes, en venta o en alquiler, en cualquier provincia o ciudad. Obtienes **precios, direcciones, coordenadas, fotos y teléfonos de inmobiliarias** en datos limpios que puedes descargar o enviar a tus herramientas.

También incluye un **modo de captación de inmobiliarias**: una fila por agencia, con su teléfono, cuántos anuncios tiene y su rango de precios. Es una forma rápida de crear un listado de inmobiliarias en España.

#### Por qué usar este scraper de Fotocasa

- **Encuentra inmobiliarias en España**: crea un listado de agencias por provincia o ciudad, con teléfonos.
- **Sigue el mercado inmobiliario**: controla precios, precio por metro cuadrado y bajadas de precio por zona.
- **Encuentra oportunidades de inversión**: filtra por precio, superficie y habitaciones, y ordena por lo más nuevo o lo más barato.
- **Alimenta tus herramientas**: envía anuncios nuevos a una hoja de cálculo, un CRM o un panel de forma programada.

#### Qué datos obtienes

| Grupo | Campos |
| --- | --- |
| Precio | precio, bajada de precio, precio por metro cuadrado |
| Vivienda | habitaciones, baños, superficie, planta, características como terraza, calefacción o aire acondicionado |
| Ubicación | provincia, ciudad, distrito, barrio, código postal, coordenadas |
| Anunciante | tipo de anunciante, nombre de la inmobiliaria, teléfono, web de la agencia en Fotocasa |
| Anuncio | fecha de publicación, obra nueva, descripción, fotos, URL |

#### Cómo extraer datos de Fotocasa

1. Pulsa **Try for free**.
2. Elige la operación y el tipo de inmueble, y selecciona provincias o escribe nombres de ciudades.
3. Añade los filtros que quieras: precio, habitaciones, baños o superficie.
4. Elige **Agency leads** si quieres una fila por inmobiliaria.
5. Pulsa **Start** y descarga los resultados en JSON, CSV, Excel o HTML.

También puedes pegar una URL de resultados de búsqueda de fotocasa.es en lugar de usar el formulario. Los nombres de los campos del formulario y del resultado están en inglés.

#### Precio

Este Actor cobra **por resultado**: pagas por cada fila entregada, más un pequeño importe al iniciar la ejecución. La tarifa vigente aparece en la página del Actor en la Store.

Con el plan gratuito de Apify obtienes hasta 50 resultados por ejecución, con tu propio crédito de Apify Proxy. Un [plan de pago de Apify](https://apify.com/pricing?fpr=youssef) elimina el límite e incluye el proxy.

#### Consejos

- **Las búsquedas grandes se gestionan solas.** Fotocasa solo muestra unos 9.000 resultados por búsqueda, así que el Actor divide las búsquedas mayores en tramos de precio automáticamente.
- **Los anuncios sin precio** pueden quedar fuera de esos tramos en búsquedas muy grandes.
- **Usa Max results** para controlar el gasto. El modo de inmobiliarias se detiene al encontrar ese número de agencias.
- **Puedes usar tu propio proxy**: añade tus URL de proxy en la sección Proxy.

#### Preguntas frecuentes

**¿Obtengo un teléfono en todos los anuncios?**
No. Los teléfonos se incluyen para las inmobiliarias cuando Fotocasa los muestra. Los datos de contacto de los particulares se omiten a propósito, porque son datos personales. Los alquileres muestran menos teléfonos que las ventas.

**¿Es legal extraer datos de Fotocasa?**
Este Actor solo lee páginas públicas. Eres responsable de cómo usas los datos, incluida la normativa de protección de datos como el RGPD cuando contactes con empresas, y de revisar las condiciones del sitio. Si tienes dudas, consulta a un abogado.

**¿Puedo usarlo desde un agente de IA?**
Sí. Puedes llamarlo desde cualquier agente de IA a través del servidor MCP de Apify, o desde tu propio código con la API de Apify.

**Algo no funciona**
Abre una [Issue](https://apify.com/fayoussef/fotocasa-scraper/issues/open) y lo arreglaré.

💼 ¿Necesitas una versión a medida u otro sitio? [Contáctame a través de mi perfil de Apify](https://apify.com/fayoussef)

# Actor input Schema

## `mode` (type: `string`):

Listings gives one row per property. Agency leads groups the results into one row per real-estate agency, with its phone and how many listings it has.

## `max_items` (type: `integer`):

Stop after this many rows. Leave empty for everything that matches.

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

Buy or rent.

## `property_type` (type: `string`):

The kind of property to search.

## `provinces` (type: `array`):

One or more provinces. Leave empty, with no cities, to search all of Spain.

## `cities` (type: `array`):

City names, for example Madrid or Barcelona. Searches the city itself, not the whole province.

## `price_from` (type: `integer`):

Lowest price.

## `price_to` (type: `integer`):

Highest price.

## `rooms_from` (type: `integer`):

Fewest bedrooms.

## `rooms_to` (type: `integer`):

Most bedrooms.

## `bathrooms_from` (type: `integer`):

Fewest bathrooms.

## `surface_from_m2` (type: `integer`):

Smallest surface.

## `surface_to_m2` (type: `integer`):

Largest surface.

## `sort_by` (type: `string`):

Order of the results.

## `start_urls` (type: `array`):

Paste search results URLs from fotocasa.es. When set, the location and filter fields above are ignored.

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

Leave as is. Paid plans get a proxy included, free plans use Apify residential. Add your own proxy URLs here only if you prefer them.

## Actor input object example

```json
{
  "mode": "listings",
  "max_items": 100,
  "operation": "sale",
  "property_type": "viviendas",
  "sort_by": "newest",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "ES"
  }
}
```

# Actor output Schema

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

One record per Fotocasa listing, or one per agency in agency mode.

# 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 = {
    "max_items": 100,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "ES"
    }
};

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

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

```

## MCP server setup

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