# Fotocasa Scraper - Spain Property Listings, Prices & Agents (`scrapersdelight/fotocasa-scraper`) Actor

Scrape Fotocasa.es listings for sale or rent anywhere in Spain: price, price drops, €/m², rooms, baths, m², decoded floor, 8-level location, GPS, photos, agency and phone. Optional energy certificate, street and agency leads. Search by place or URL, past the 10,000 cap, monitor mode. No login.

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

## Pricing

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

### What does Fotocasa Scraper do?

**Fotocasa Scraper** extracts property listings from [fotocasa.es](https://www.fotocasa.es), Spain's large real estate portal, for sale, rent, room share, rent-to-buy and business transfer. Type a place ("Madrid", "Chamberí", "Marbella") or paste a Fotocasa search URL, and every listing becomes one row: price and price drops, €/m², bedrooms, bathrooms, m², floor, the full location tree with coordinates, photos, and the agency with its phone. Built for investors, agencies, valuers, proptech teams and market researchers.

Fotocasa scraper · Fotocasa API alternative · Spain property data · pisos en venta y alquiler

- **Every listing field Fotocasa publishes:** price, previous price and drop, €/m², rooms, baths, m², floor, condition, lift, air conditioning, heating, terrace, balcony, garden, pool, parking, photos with room tags, videos, virtual tours, floor plans
- **The location tree, not just a town name:** neighbourhood, district, municipality, comarca, province and autonomous community, with Fotocasa's ids for each level, plus latitude/longitude
- **Floors you can sort by:** Fotocasa stores the floor as a code (8 means 3rd floor); this actor decodes it to `"3rd floor"` and `floorNumber: 3`
- **Past the 10,000-result cap:** Fotocasa serves at most ~9,800 rows of one search; bigger searches are split into districts (then price bands) and each piece is read completely (Madrid city: 12,184 of 12,184 listings in one run)
- **Optional details per listing:** energy certificate (letter, kWh/m², CO₂), street and number, agency reference, legal agency name, website and email, construction type, heating and hot-water fuel, building age, orientation, occupancy, furnished, full equipment list
- **Agency leads:** one row per agency in your searches with its phone, profile, listing counts and price range
- **Monitor mode:** schedule it and get only new listings and price changes, plus the ids of listings that disappeared
- **No login, no cookies, no browser:** reads Fotocasa's own JSON gateway; ~1 request per 200 listings
- **Export anywhere:** JSON, CSV, Excel, XML; API, schedules, webhooks, Make, Zapier, n8n, Google Sheets, MCP

### What data can you get from Fotocasa?

<table>
<tr><td>🔗 Listing URL and id</td><td>💶 Price (`price`), currency, rent period</td><td>📉 Previous price, drop, drop %</td></tr>
<tr><td>📐 Size m², €/m² (`pricePerM2`)</td><td>🛏️ Bedrooms, 🛁 bathrooms</td><td>🏢 Floor + floor number</td></tr>
<tr><td>🏠 Type and subtype (flat, attic, duplex…)</td><td>🔧 Condition, new build</td><td>✅ Lift, A/C, heating, terrace, pool…</td></tr>
<tr><td>📍 Address, street, zip code</td><td>🗺️ Neighbourhood → autonomous community</td><td>🧭 Latitude, longitude, exact or approximate</td></tr>
<tr><td>📝 Description</td><td>📅 Published at, days on portal</td><td>🖼️ Photos with room tags, videos, tours, plans</td></tr>
<tr><td>🏢 Agency name, id, profile, logo</td><td>☎️ Agency phone</td><td>👤 Agency or private seller</td></tr>
<tr><td>⚡ Energy rating, kWh/m², CO₂ (details)</td><td>🔖 Agency reference, legal name, web, email (details)</td><td>🔥 Heating, hot water, age, orientation (details)</td></tr>
<tr><td>🏗️ Development name and units</td><td>🔁 Monitor: new / priceDrop / priceRise</td><td>📇 Agency leads rows</td></tr>
</table>

### How to scrape Fotocasa with Fotocasa Scraper

1. [Create a free Apify account](https://console.apify.com/sign-up) (it comes with monthly free credit).
2. Open **Fotocasa Scraper** and type one or more places in **Locations**, or paste Fotocasa search URLs.
3. Pick the operation (buy, rent…), property type and any filters: price, size, bedrooms, features, condition, published within.
4. Set **Max listings** and switch on **Listing details** or **Agency leads** if you need them.
5. Click **Start**, then download the dataset as JSON, CSV or Excel, or read it through the API.

### ⬇️ Input

| Parameter | Type | What it does |
|---|---|---|
| `locations` | list | Place names as you type them on Fotocasa, or URL slugs (`madrid-capital`, `barcelona-capital/eixample`). One search each. Prefill: `["Madrid"]` |
| `locationType` | select | Which match to use when a name fits several places (city vs province…). Default: Fotocasa's first suggestion |
| `startUrls` | list | Fotocasa search URLs; their own operation, type and filters are used |
| `listingUrls` | list | Single listing links or ids, read in full with the details block |
| `operation` | select | `buy` (default), `rent`, `share`, `rentBuyOption`, `transfer` |
| `propertyType` | select | `home` (default), `newHome`, `premises`, `garages`, `office`, `boxRoom`, `land`, `building` |
| `propertySubtypes` | list | flat, apartment, house, semi-detached, terraced, attic, duplex, penthouse duplex, loft, studio, ground floor with garden, country house |
| `minPrice` / `maxPrice` | integer | Euros (monthly rent for rentals) |
| `minSize` / `maxSize` | integer | m² |
| `minRooms` / `maxRooms`, `minBathrooms` / `maxBathrooms` | integer | Bedrooms / bathrooms |
| `publicationDate` | select | Any, last 24 h, 48 h, week, month |
| `features` | list | Must have: lift, terrace, A/C, pool, parking, storage room, furnished, sea views… (19) |
| `conditions` | list | almost new, very good, good, to renovate, refurbished |
| `priceDropOnly`, `subsidizedOnly`, `withVideoOrTourOnly` | boolean | Fotocasa's own "bajada de precio", "con ayudas", video/tour filters |
| `keyword` | text | Fotocasa's text search inside the ads, e.g. `piscina` |
| `agencyIds` | list | One agency's listings (its `agencyId`, or its Fotocasa page URL) |
| `rentalTypes` | list | Rentals: long-term or temporary |
| `occupancy` | list | Homes for sale: available, occupied, with tenant, bare ownership, auction |
| `sortBy` | select | `rating` (default), `latest`, `cheapest`, `mostExpensive`, `cheapestPerM2`, `biggest`, `smallest` |
| `sellerType` | select | All, agencies only, private sellers only |
| `latitude`, `longitude`, `distanceKm` | number | Keep listings within a radius of a point (rows get `distanceKm`) |
| `includeDetails` | boolean | Add the details block to each listing (charged per row that carries it) |
| `includeAgencyLeads`, `maxAgencyLeads` | boolean, integer | Also deliver agency rows (default 100 max) |
| `monitorMode`, `monitorKey`, `webhookUrl` | boolean, text | Only new and re-priced listings; optional memory name and a webhook |
| `maxItems` | integer | Most listing rows per run. Default 100, prefill 20 |
| `maxItemsPerSearch` | integer | Most rows per place / URL / agency. 0 = no per-search cap |
| `splitLargeSearches` | boolean | Read past the ~9,800-row cap of one search (default on) |
| `compact` | boolean | Core fields only (no photo list, description, links, location ids) |
| `proxyConfiguration` | proxy | Optional. Default: a direct connection; only when Fotocasa refuses it does the actor move to a datacenter proxy (where available), then Spanish residential proxies, then Apify's Unblocker |

#### Input JSON

```json
{
  "locations": ["Valencia"],
  "operation": "buy",
  "maxPrice": 500000,
  "minRooms": 2,
  "features": ["lift", "terrace"],
  "includeDetails": true,
  "maxItems": 100
}
```

#### Pick the place the way Fotocasa does

A name can match several places: "Madrid" is a city, a province and a region. The actor takes Fotocasa's first suggestion (the city) and lists the others in the log. Set **Location type** to `province` for the whole province, or paste the search URL you see in your browser, which always resolves exactly.

#### Filters that read search pages

Rental duration and occupancy are applied by Fotocasa's search pages, not its JSON gateway, so those searches read 30 listings per request instead of 200. Every other filter runs inside Fotocasa before anything is read.

### ⬆️ Output

One row per listing (`type: "listing"`); with Agency leads on, also one row per agency (`type: "agency"`). A real row from a 100-listing Valencia run with Listing details on (2026-10-14, trimmed):

```json
{
  "id": "189788009",
  "operation": "buy", "propertyType": "home", "propertySubtype": "flat",
  "price": 440000, "previousPrice": 445000, "priceDrop": 5000, "pricePerM2": 6470.59,
  "rooms": 2, "bathrooms": 2, "sizeM2": 68, "floor": "1st floor", "floorNumber": 1,
  "address": "C. de Campos Crespo, Patraix", "zipCode": "46014",
  "neighborhood": "Safranar", "district": "Patraix", "municipality": "Valencia Capital", "province": "Valencia",
  "latitude": 39.455276, "longitude": -0.39774883,
  "publishedAt": "2026-05-26T17:02:30.050Z", "daysOnPortal": 140, "imageCount": 43,
  "advertiserType": "agency", "agencyName": "aProperties Real Estate Valencia", "agencyPhone": "+34960179239",
  "energyRating": "A", "energyConsumptionKwhM2": 13, "energyCertificateStatus": "available",
  "agencyReference": "VV2605056", "agencyLegalName": "APROPERTIES REAL ESTATE ASSETS VALENCIA",
  "heating": "electricity", "buildingAge": "1-5 years", "orientation": "southeast", "occupancyStatus": "available",
  "equipment": ["air conditioning", "private garage", "private garden", "terrace", "storage room", "lift", "community pool"]
}
```

#### Fields and how often they are filled

Measured on local runs on 2026-10-14: Madrid, 1,000 listings for sale (no details) and Valencia, 100 for sale + Barcelona, 100 for rent (details on). A field is empty when the ad does not publish it.

| Field | Madrid 1,000 | Valencia / Barcelona with details |
|---|---|---|
| id, url, price, sizeM2, address, zipCode, neighbourhood → province, latitude, longitude, publishedAt, images | 99-100% | 100% |
| rooms / bathrooms | 98% / 99% | 94-100% / 98-99% |
| floor (decoded) | 83% | 69-86% |
| previousPrice / priceDrop | 36% | 15-35% |
| agencyName / agencyPhone (agency ads) | 100% / 94% | 100% / 85-100% |
| hasLift / hasAirConditioning / hasHeating | 75% / 65% / 85% | 71-82% / 63-94% / 76-91% |
| condition | 54% | 27-42% |
| videoUrls / virtualTourUrls | 39% / 23% | 54-62% / 17-27% |
| energyRating + kWh/m² (details) | - | 34% / 76% (the rest: certificate not provided) |
| agencyReference / agencyLegalName (details) | - | 99-100% |
| agencyWebsite / agencyEmail (details) | - | 38-93% / 0-8% |
| street / streetNumber (details) | - | 57-75% / 2-13% |
| heating, hot water, building age, orientation (details) | - | 21-74% |
| furnished / equipment (details) | - | 47-85% / 99% |

Fotocasa shows a missing or pending energy certificate as "G" with a value of 999. Those rows get `energyRating: null` and `energyCertificateStatus: "not provided"` instead of a G that was never issued. Private sellers publish only a first name, so for them `agencyName` and `agencyPhone` stay empty.

### How can I use Fotocasa data?

- 📈 **Investors and analysts:** price per m², price drops and days on portal by district, for comps and yield models
- 🏢 **Agencies:** watch competitors' stock (`agencyIds`), new listings in your zone every morning (monitor mode)
- 🧮 **Valuers and banks:** energy rating, building age, floor and condition next to the asking price
- 📇 **Proptech sales teams:** agency leads with phone, website and listing volume per city
- 🗺️ **Data teams:** location ids and coordinates join cleanly with INE, cadastre or your own maps
- 🤖 **AI agents:** compact rows through the API or MCP for "find me 3-bedroom flats under €400k in Valencia"

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

Pay per result, no start fee:

| Event | Price | When |
|---|---|---|
| Listing | $0.00036 per listing ($0.36 per 1,000) | every listing row |
| Listing details | $0.00072 per listing | only rows that carry the details block (Listing details on, or a listing link) |
| Agency lead | $0.0018 per agency | only with Agency leads on |

| Run | Cost |
|---|---|
| 20 listings (the prefilled demo) | $0.0072 |
| 100 listings | $0.036 |
| 100 listings with details | $0.108 |
| 1,000 listings | $0.36 |

The free monthly credit on an Apify account covers thousands of listings.

### Integrations, API, scheduling and MCP

Run it on a **schedule** (daily at 08:00, for example) with **monitor mode** to receive only new and re-priced listings. Send results to **Google Sheets, Slack, Make, Zapier or n8n**, or use **webhooks**. Call it from your code with the [Python](https://apify.com/scrapersdelight/fotocasa-scraper/api/python) or [JavaScript](https://apify.com/scrapersdelight/fotocasa-scraper/api/javascript) client, or connect AI assistants through the [MCP server](https://apify.com/scrapersdelight/fotocasa-scraper/api/mcp).

### More real estate scrapers

- 🇪🇸 [Kyero Property Scraper](https://apify.com/scrapersdelight/kyero-property-scraper) — Spanish property for international buyers, with estate-agent contacts
- 🇬🇧 [Rightmove Scraper](https://apify.com/scrapersdelight/rightmove-scraper) — UK listings and agents
- 🇺🇸 [Trulia Scraper](https://apify.com/scrapersdelight/trulia-scraper) — US listings, agents and prices
- 🔨 [Habitissimo Spain Contractors Scraper](https://apify.com/scrapersdelight/habitissimo-spain-contractors-scraper) — Spanish renovation contractors with phones
- 🏢 [Crexi Scraper](https://apify.com/scrapersdelight/crexi-scraper) — commercial real estate listings and brokers

All our actors: [apify.com/scrapersdelight](https://apify.com/scrapersdelight).

### Limits and empty runs

- One Fotocasa search serves about 9,800 listings. With **Read past the 10,000 cap** on (default), bigger searches are split into sub-places, then price bands. A few listings with no price and no sub-place can stay out; `RUN_SUMMARY` says how many.
- Speed on a direct connection: 1,000 listings in about 10 seconds; details add one request per listing (100 in about 2 seconds).
- Radius and seller-type filters are applied to the listings Fotocasa returns, so a narrow filter reads more pages before it fills **Max listings**.
- An empty run (no listing matches) costs nothing. `RUN_SUMMARY` lists, per search, Fotocasa's own count, the rows read and delivered, and places that could not be found.
- Agency emails come from the ad itself; the actor does not crawl agency websites.
- If only Apify's Unblocker reaches Fotocasa during a run, listings are delivered without the details block, and the details event is not charged for them.

### ❓ FAQ

#### How much does Fotocasa Scraper cost?

$0.36 per 1,000 listings, plus $0.72 per 1,000 for the optional details block and $1.80 per 1,000 agency rows. There is no start fee.

#### How many listings can Fotocasa Scraper get?

As many as Fotocasa lists for your search. A single search returns up to ~9,800; with splitting on, the whole of Madrid city (12,184 homes for sale on 2026-10-14) came back complete in one run.

#### Can Fotocasa Scraper monitor new listings and price drops?

Yes. Turn on **Monitor mode** and schedule the run. Each run delivers only listings that are new or whose price changed since the last run (`changeType`, `previousSeenPrice`), and lists removed listings in the run's OUTPUT record.

#### Does Fotocasa Scraper need a login, cookies or an API key?

No. It reads the same public data a visitor sees, with no account.

#### Can I use Fotocasa Scraper with the Apify API?

Yes. Start runs and read datasets with the Apify API or its Python and JavaScript clients; every input field above is a JSON key.

#### Can AI agents use Fotocasa Scraper through MCP?

Yes. Add it to the Apify MCP server and let your assistant run searches; the `compact` option keeps rows short.

#### Why did Fotocasa Scraper return no results?

Usually the filters exclude everything, or the place name matched a different place. Open `RUN_SUMMARY`: it shows Fotocasa's own count per search and any place it could not find. Paste a Fotocasa search URL to be exact.

#### Does Fotocasa Scraper get the energy certificate?

Yes, with **Listing details** on: letter, kWh/m² and CO₂. When the advertiser has not provided one, the row says "not provided" instead of copying Fotocasa's placeholder G.

#### Does Fotocasa Scraper return private sellers' contacts?

No. Private sellers publish only a first name and no phone on Fotocasa; those fields stay empty. Agency names and phones are included.

#### Is it legal to scrape Fotocasa?

Web scraping may be subject to legal restrictions (for example GDPR for personal data in the EU). Make sure your use has a legitimate purpose and follows Fotocasa's terms; when in doubt, ask your legal advisor.

#### Your feedback

Found a bug or need a field? Open an issue on the [Issues tab](https://apify.com/scrapersdelight/fotocasa-scraper/issues/open); we read every one.

# Actor input Schema

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

Places as you would type them on Fotocasa: a region, province, city, district or neighbourhood, e.g. "Madrid", "Barcelona", "Chamberí", "Marbella". A Fotocasa URL slug works too ("madrid-capital", "barcelona-capital/eixample"). Each place is one search.

## `locationType` (type: `string`):

Which match to use when a name fits several places ("Madrid" is a city, a province and a region). Empty takes Fotocasa's first suggestion; RUN_SUMMARY lists the others.

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

Search pages copied from fotocasa.es, with the filters you set there, e.g. "https://www.fotocasa.es/es/alquiler/viviendas/barcelona-capital/todas-las-zonas/l?maxPrice=1500". A URL's own operation, type and filters are used (the filter fields below apply to place names only).

## `listingUrls` (type: `array`):

Single listings to read in full, e.g. "https://www.fotocasa.es/es/comprar/vivienda/madrid-capital/.../189382740/d" or "189382740". Each row carries the details block (energy certificate, street, agency reference).

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

Buy, rent, room share, rent with option to buy, or business transfer (traspaso).

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

Homes, new-build homes (obra nueva), commercial premises, garages, offices, storage rooms, land or whole buildings.

## `propertySubtypes` (type: `array`):

Only these kinds of home, e.g. flats and attics. Empty = all.

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

Lowest price in euros (monthly rent for rentals). 0 = no minimum.

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

Highest price in euros (monthly rent for rentals). 0 = no maximum.

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

Smallest surface in square metres. 0 = no minimum.

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

Largest surface in square metres. 0 = no maximum.

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

Fewest bedrooms. 0 = any.

## `maxRooms` (type: `integer`):

Most bedrooms. 0 = any.

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

Fewest bathrooms. 0 = any.

## `maxBathrooms` (type: `integer`):

Most bathrooms. 0 = any.

## `publicationDate` (type: `string`):

Only listings Fotocasa published in this window.

## `features` (type: `array`):

Only listings with all of these, e.g. a lift and a terrace. Empty = no requirement.

## `conditions` (type: `array`):

Only these states of repair. Empty = all.

## `priceDropOnly` (type: `boolean`):

Only listings whose price was lowered (Fotocasa's "bajada de precio").

## `subsidizedOnly` (type: `boolean`):

Only listings eligible for housing aid ("con ayudas").

## `withVideoOrTourOnly` (type: `boolean`):

Only listings with a video or a virtual tour.

## `keyword` (type: `string`):

Fotocasa's own text search inside the ads, e.g. "piscina", "ático", "vistas al mar".

## `agencyIds` (type: `array`):

Only listings of these agencies: the agencyId from a row, or a Fotocasa agency page URL ending in its id (e.g. ".../inmobiliarias/name-9202756368671"). With no location, the agency's whole stock in Spain.

## `rentalTypes` (type: `array`):

Rentals only: long-term or temporary lets. Pick one to filter; empty or both = all. Read from Fotocasa's search pages (30 listings per page).

## `occupancy` (type: `array`):

Homes for sale by occupancy status: available, occupied, with a tenant, bare ownership, at auction. Empty = all. Read from Fotocasa's search pages (30 listings per page).

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

The order Fotocasa returns listings in. "Latest" pairs well with Max items for fresh-listing runs.

## `sellerType` (type: `string`):

Agencies only, private sellers only, or both.

## `latitude` (type: `number`):

Centre of a radius filter, e.g. 40.4168. Needs Longitude and Distance; applies to the listings of the locations above.

## `longitude` (type: `number`):

Centre of a radius filter, e.g. -3.7038.

## `distanceKm` (type: `number`):

Keep listings within this many kilometres of Latitude/Longitude (rows get a distanceKm field). 0 = off.

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

Adds each listing's energy certificate (rating, kWh/m², CO₂), street and number, agency reference, legal agency name, website and email, construction type, plot size, heating and hot-water fuel, building age, orientation, occupancy, furnished and the full equipment list. One extra request per listing; charged per row that carries it.

## `includeAgencyLeads` (type: `boolean`):

Also delivers one row per agency seen in the searches (type "agency"): name, phone, profile, logo, listings in the run, sale/rent split, price range, median €/m², municipalities. With Listing details on, also the legal name, website and email. Charged per agency row.

## `maxAgencyLeads` (type: `integer`):

Most agency rows to deliver, busiest agencies first.

## `monitorMode` (type: `boolean`):

Delivers only listings not delivered by an earlier run of the same search, or whose price changed since (changeType new / priceDrop / priceRise, previousSeenPrice, firstSeenAt). When every search is read to its end, listings that disappeared are listed in the OUTPUT record (removedListingIds), free.

## `monitorKey` (type: `string`):

Optional name for the memory, so two schedules with the same search keep separate memories. Empty = one memory per search.

## `webhookUrl` (type: `string`):

Optional: a URL that receives one JSON POST per run with the counts (new, price drops, removed ids) and the dataset id. Sent only when something was delivered or removed.

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

Most listing rows to deliver in the run, across all searches. One Fotocasa query serves ~9,500 listings; bigger searches are split into price bands automatically.

## `maxItemsPerSearch` (type: `integer`):

Most rows per location / URL / agency. 0 = only Max listings applies.

## `splitLargeSearches` (type: `boolean`):

When a search holds more than ~9,500 listings and you ask for more, split it into price bands and read each completely.

## `compact` (type: `boolean`):

Core fields only (no photo list, description, video/tour/plan links, location ids): smaller rows for spreadsheets and AI tools.

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

Optional. By default the actor connects directly; only if Fotocasa refuses a connection does it move to Apify's datacenter proxy (where the account has one), then Spanish residential proxies, then the Apify Unblocker, each under a small per-run budget. Set your own proxy here to use it instead.

## Actor input object example

```json
{
  "locations": [
    "Madrid"
  ],
  "locationType": "",
  "operation": "buy",
  "propertyType": "home",
  "publicationDate": "",
  "priceDropOnly": false,
  "subsidizedOnly": false,
  "withVideoOrTourOnly": false,
  "sortBy": "rating",
  "sellerType": "all",
  "includeDetails": false,
  "includeAgencyLeads": false,
  "maxAgencyLeads": 100,
  "monitorMode": false,
  "maxItems": 20,
  "maxItemsPerSearch": 0,
  "splitLargeSearches": true,
  "compact": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Listing rows and agency rows (field "type").

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

Per search: Fotocasa's own count, rows read, delivered, filtered, split pieces, transport used and billing.

## `output` (type: `string`):

Delivered counts and, in monitor mode, the ids of listings removed since the last run.

# 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"
    ],
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapersdelight/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"],
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("scrapersdelight/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"
  ],
  "maxItems": 20
}' |
apify call scrapersdelight/fotocasa-scraper --silent --output-dataset

```

## MCP server setup

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