# Fotocasa Scraper - Spanish Property Listings (`kalilfagundes.w/fotocasa-scraper`) Actor

\[Limited Launch Offer $0.75/1K] Fotocasa scraper: homes for sale and rent by city, province or URL with price, rooms, m², coordinates, images and agency phone. No limit. No login.

- **URL**: https://apify.com/kalilfagundes.w/fotocasa-scraper.md
- **Developed by:** [Scrape With Me](https://apify.com/kalilfagundes.w) (community)
- **Categories:** Real estate, Lead generation
- **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 — Spanish property listings for sale and rent, by city, province or search URL, with no login

Scrape **Fotocasa** listings for any city, province or the whole of Spain: price, price reduction, rooms, bathrooms,
surface, floor, features (elevator, terrace, parking, air conditioning, furnished), age and condition, neighbourhood,
district, postal code with coordinates, publication date, full description, images and the agency with its phone.
Homes for sale and for rent, plus offices, commercial premises, garages, land and storage rooms. No login, no API key,
no browser, and **no result limit**: every page of a search is read (Madrid homes for sale alone is more than 12,000 listings).

### Why this Fotocasa scraper

- **Every page, not the first few.** 31 listings per page, page after page until the end of the search: 2,790 listings
  for the whole of Spain in under 3 minutes, 300 listings in 25 seconds.
- **Type a place, not a URL.** `Madrid`, `Barcelona`, `Getafe`, `Málaga provincia` or `España`. Or paste any Fotocasa
  search URL from your browser with its filters.
- **Many searches in one run.** Several places × buy/rent × property types; duplicates are saved (and charged) once.
- **Real filters.** Price range, minimum rooms and bathrooms, surface range, sort by newest or price.
- **Decoded fields.** Floor, building age, condition and orientation come out as readable labels, not Fotocasa's codes.
  A feature the listing does not mention is `null` (unknown), never a wrong `false`.
- **Agency contacts.** Agency name, profile link and phone for professional listings. Private sellers' names and phones are never saved.
- **Cheap and fast.** Direct requests, no proxy bill; the scraper switches to a residential proxy by itself only if Fotocasa
  starts refusing requests. One bad place never stops the run: its status is reported in **INPUT_STATUS**.

### Use cases: Spanish real estate data

- **Investors and analysts**: price per m², rents and yields by city, district or postal code.
- **Agencies and lead generation**: which agencies list what, where, with their phone numbers.
- **Price monitoring**: `sortBy: newest` on a schedule to catch new listings and price reductions every morning.
- **Proptech and valuation models**: a clean, geocoded dataset with surface, rooms, age and condition.
- **Researchers and journalists**: the Spanish housing market, rent levels and supply by region.

### Input example

```json
{
  "locations": ["Madrid", "Barcelona"],
  "transactions": ["buy", "rent"],
  "propertyTypes": ["viviendas"],
  "maxPrice": 400000,
  "minRooms": 2,
  "sortBy": "newest",
  "maxResultsPerSearch": 500,
  "maxItems": 2000
}
```

| Field | What it does |
|---|---|
| `locations` | One per line: a city (`Madrid` = the city), a province (`Madrid provincia`), a town (`Getafe`) or `España` |
| `transactions` | `buy`, `rent` or both |
| `propertyTypes` | `viviendas` (all homes), `pisos`, `apartamentos`, `chalets`, `locales`, `oficinas`, `garajes`, `terrenos`, `trasteros`, `edificios`, `naves-industriales` (rent: homes, premises, offices, garages) |
| `searchUrls` | Optional Fotocasa search pages copied from your browser, filters included |
| `minPrice` / `maxPrice` | Price range in EUR (monthly rent for rentals) |
| `minRooms`, `minBathrooms` | Minimums |
| `minSurface` / `maxSurface` | Surface range in m² |
| `sortBy` | `relevance`, `newest` (for monitoring) or `price` |
| `maxResultsPerSearch` | Listings per place × transaction × type (0 = all of them) |
| `maxItems` | Cap for the whole run (0 = no cap) |
| `maxImages` | Image links per listing (`imageCount` always has the total) |
| `proxyConfiguration` | Default: none. A residential proxy is used automatically if Fotocasa refuses requests |

### Output example

```json
{
  "listingId": 191120484,
  "url": "https://www.fotocasa.es/es/comprar/vivienda/madrid-capital/aire-acondicionado-amueblado/191120484/d",
  "transaction": "buy",
  "buildingType": "Flat",
  "price": 245000,
  "currency": "EUR",
  "priceReduction": null,
  "rooms": 3,
  "bathrooms": 1,
  "surfaceM2": 62,
  "furnished": true,
  "hasAirConditioning": true,
  "hasElevator": null,
  "antiquity": "50 to 70 years",
  "amenities": ["air_conditioner", "furnished"],
  "neighborhood": "Ambroz",
  "district": "Vicálvaro",
  "city": "Madrid",
  "province": "Madrid",
  "postalCode": "28032",
  "latitude": 40.41038779220395,
  "longitude": -3.612049594620763,
  "publishedAt": "2026-10-15T20:21:02Z",
  "description": "Agencia inmobiliaria de MADRID zona VICALVARO - VALDEBERNARDO - VALDERRIBAS …",
  "imageCount": 20,
  "images": ["https://static.fotocasa.es/images/ads/6d6d8912-e945-4e39-abf4-a11102df11b5?rule=original"],
  "isNewConstruction": false,
  "agencyName": "TECNOCASA VICALVARO",
  "agencyType": "professional",
  "agencyUrl": "https://www.fotocasa.es/es/pro/tecnocasa-vicalvaro/",
  "phone": "+34910075021",
  "searchLabel": "madrid-capital / buy / viviendas",
  "source": "Fotocasa",
  "scrapedAt": "2026-10-15T18:21:16Z"
}
```

Every row also has `priceFormatted`, `pricePeriod`, `buildingSubtype`, `floor`/`floorLabel`, `hasTerrace`, `hasParking`,
`hasHeating`, `condition`, `orientation`, `location`, `region`, `hasVideo`, `hasVirtualTour`, `isPromotion`, `isTop`,
`isOpportunity` and `isOccupied`. The run's **OUTPUT** record lists, per search, how many listings were saved and how many
pages were read; **INPUT_STATUS** says whether each place or URL was found, not found or could not be checked.

### Run it on a schedule and connect it to your tools

**Schedule:** in Apify Console open *Schedules → Create*, pick this actor with `sortBy: newest` and run it every morning
to follow new listings and price drops in your cities. Each run returns the full, current result set as a new dataset.

**Integrations** (Actor → *Integrations* tab, no code):

- **Google Sheets** — append every run's listings to a sheet.
- **Make, Zapier, n8n** — start the actor from a scenario/zap/workflow and push listings to your CRM.
- **Webhook** — get a POST to your endpoint when a run succeeds, then download the dataset.
- **Slack / email** — notify your team when a scheduled run finishes.

**AI agents (MCP)** — Claude, ChatGPT, Cursor, VS Code or any MCP client can run it as a tool: add the Apify MCP
server `https://mcp.apify.com?actors=kalilfagundes.w/fotocasa-scraper` (sign in with your Apify account) and ask for the
data in plain language. The agent fills the input from the input schema and reads the dataset back.

**API** — call it from your code (`pip install apify-client` / `npm i apify-client`):

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("kalilfagundes.w/fotocasa-scraper").call(run_input={
    "locations": ["Barcelona"],
    "transactions": ["rent"],
    "propertyTypes": ["viviendas"],
    "maxResultsPerSearch": 300,
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["price"], item["rooms"], item["surfaceM2"], item["district"], item["url"])
```

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('kalilfagundes.w/fotocasa-scraper').call({
  locations: ['Barcelona'],
  transactions: ['rent'],
  propertyTypes: ['viviendas'],
  maxResultsPerSearch: 300,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### Pricing

Pay per result, platform usage included:

| Event | Price |
|---|---|
| Listing saved | **$0.75 per 1,000 listings** |
| Run start | $0.002 |

Example: 10,000 listings ≈ $7.50. Apify subscribers get tier discounts automatically. Set `maxItems` to cap the cost of a run.

### FAQ and limits

- **Does it need a Fotocasa login or API key?** No. Fotocasa has no public API: this reads the listing data the search pages already contain.
- **How many listings can I get?** All of a search: pages are read until the last one. Very large searches (all of Spain has
  480,000 homes for sale) take time; raise the run timeout or narrow by place, price or type.
- **Is a detail page needed for the description or images?** No, they come with the search data, which keeps runs fast and cheap.
- **Why is a feature `null`?** The listing does not mention it. `null` means unknown, not "no".
- **A place returns "not found"?** Use the Fotocasa spelling of the town, or paste the search URL from your browser.
- **Contact data:** only agencies' public business contacts are saved; private sellers' names and phones never are.
- **Fair use:** use the data in line with Fotocasa's terms and the GDPR; keep schedules reasonable.

### En español

Este actor extrae anuncios de Fotocasa de cualquier ciudad, provincia o de toda España: pisos y casas en venta y en
alquiler, oficinas, locales, garajes y terrenos. Precio, rebaja, habitaciones, baños, superficie, planta, ascensor,
terraza, garaje, antigüedad, estado, barrio, distrito, código postal con coordenadas, fecha de publicación, descripción,
fotos y la inmobiliaria con su teléfono. Sin límite de resultados, sin iniciar sesión y sin clave de API. Filtra por
precio, habitaciones y superficie, ordena por los más nuevos y programa la ejecución para seguir el mercado. Exporta a
Excel, CSV o JSON.

### Related actors

- [Zap Imóveis, VivaReal & QuintoAndar Scraper - Imóveis Brasil](https://apify.com/kalilfagundes.w/imoveis-brasil-scraper)

### Feedback

Found a missing field or a place that returns nothing? Open an issue on the Actor page and it will be looked at.

# Actor input Schema

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

One per line: a city or province such as "Madrid", "Barcelona", "Getafe", "Madrid provincia". A provincial capital means the city (Madrid = madrid-capital); add "provincia" for the whole province. Every location is searched for each transaction and property type below.

## `transactions` (type: `array`):

Listings for sale, for rent, or both.

## `propertyTypes` (type: `array`):

What to search for. Default: all homes. Rentals exist for homes, commercial premises, offices and garages.

## `searchUrls` (type: `array`):

Optional. Search pages copied from your browser, e.g. https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l?maxPrice=300000. Filters in the URL are kept. Used together with the locations above.

## `maxResultsPerSearch` (type: `integer`):

Stop after this many listings for each location, transaction and property type (0 = all of them). A big city has more than 10,000: every page is reachable.

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

Hard cap for the whole run (0 = no cap). Keeps the cost predictable.

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

Minimum price (monthly rent for rentals) in EUR.

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

Maximum price (monthly rent for rentals) in EUR.

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

Minimum number of rooms.

## `minBathrooms` (type: `integer`):

Minimum number of bathrooms.

## `minSurface` (type: `integer`):

Minimum surface in square metres.

## `maxSurface` (type: `integer`):

Maximum surface in square metres.

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

Sort order of the search. "Newest first" is the one for monitoring new listings with a schedule.

## `maxImages` (type: `integer`):

How many image links to include per listing (0 = none; imageCount always holds the total).

## `maxConcurrency` (type: `integer`):

How many result pages are fetched at the same time. Keep it low: pages are about 1.4 MB.

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

Default: no proxy, fastest and cheapest. If Fotocasa refuses requests the scraper switches to Apify residential proxies by itself. Choose a proxy group to use it from the start.

## Actor input object example

```json
{
  "locations": [
    "Madrid"
  ],
  "transactions": [
    "buy"
  ],
  "propertyTypes": [
    "viviendas"
  ],
  "maxResultsPerSearch": 50,
  "maxItems": 1000,
  "sortBy": "relevance",
  "maxImages": 5,
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

No description

## `summary` (type: `string`):

OUTPUT record: per search the number of results Fotocasa reports, listings saved and pages read.

# 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 = {
    "locations": [
        "Madrid"
    ],
    "maxResultsPerSearch": 50,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("kalilfagundes.w/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 = {
    "locations": ["Madrid"],
    "maxResultsPerSearch": 50,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("kalilfagundes.w/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 '{
  "locations": [
    "Madrid"
  ],
  "maxResultsPerSearch": 50,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call kalilfagundes.w/fotocasa-scraper --silent --output-dataset

```

## MCP server setup

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