# Fotocasa Scraper - Spain Property Listings & Prices (`sian.agency/fotocasa-property-scraper`) Actor

Scrape fotocasa.es property listings across Spain: asking price, m2, rooms, GPS, zip code, photos, full description and the listing agency's phone number.

- **URL**: https://apify.com/sian.agency/fotocasa-property-scraper.md
- **Developed by:** [SIÁN OÜ](https://apify.com/sian.agency) (community)
- **Categories:** Real estate, Lead generation, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.79 / 1,000 property searches

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Fotocasa Scraper: Spain Property Listings, Prices & Agency Contacts 🏠

[![Actor](https://img.shields.io/badge/Apify-Actor-00b0b0)](https://apify.com/sian.agency/fotocasa-property-scraper)
[![Coverage](https://img.shields.io/badge/coverage-all%20of%20Spain-e2725b)](https://apify.com/sian.agency/fotocasa-property-scraper)
[![Pricing](https://img.shields.io/badge/pay%20per-listing-14b8a6)](https://apify.com/sian.agency/fotocasa-property-scraper)
[![Support](https://img.shields.io/badge/support-issues-0f766e)](https://apify.com/sian.agency/fotocasa-property-scraper/issues)

#### 🇪🇸 Type a Spanish place name. Get the listings.

##### Every other Fotocasa scraper makes you build a search on the site and paste the URL back. This one takes `Madrid`.

Fotocasa is one of Spain's three big property portals. This actor turns any Spanish place into clean listing
rows: a city, a province, a district, a single neighbourhood. Asking price, price per
square metre, built area, bedrooms, bathrooms, floor, postcode, GPS, the advertiser's full Spanish
description, every photo, and the listing agency's phone number.

### 🔎 What is the Fotocasa Property Scraper — and when should you use it?

The **Fotocasa Property Scraper** turns Spanish property listings from fotocasa.es, by place name into clean, structured rows you can filter, export and feed straight into a spreadsheet, database or AI agent. No account, no portal API key, no browser automation to maintain.

**Use it when you need:** Spanish sale, rent, room-share, business-transfer or rent-to-own listings with asking price, price per square metre, built area, bedrooms, bathrooms, floor, postcode, GPS coordinates, the advertiser's full Spanish description and every photo. The listing agency's name, phone number and fotocasa profile come attached to each row at no extra charge. Input is a plain place name (a city, province, district or neighbourhood), so no search URL has to be built first. A separate agency mode returns everything one estate agency currently has on the market.

**Use something else when:** you need a different European market. Use [Immobiliare Property Scraper](https://apify.com/sian.agency/immobiliare-property-scraper?fpr=sian) for Italian sale and rent listings with price, surface, rooms and agency contacts. Use [SeLoger Property Scraper](https://apify.com/sian.agency/seloger-property-scraper?fpr=sian) for French sale and rent listings across every departement. Use [ImmobilienScout24 Property Scraper](https://apify.com/sian.agency/immobilienscout24-property-scraper?fpr=sian) for German sale and rent listings with Kaltmiete, Wohnflaeche and energy data. This actor covers fotocasa.es only, which is Spain only.

### 🤖 Use with AI agents

Already connected to the [Apify MCP server](https://mcp.apify.com)? Just ask for this Actor by name: sian.agency/fotocasa-property-scraper

**Your agent can pay for its own runs.** This Actor is eligible for [agentic payments](https://docs.apify.com/platform/actors/publishing/monetize), so an agent can discover it, run it and settle the bill over [x402](https://www.x402.org/) (USDC on Base) or [Skyfire](https://www.skyfire.xyz/) — without an Apify account or API token of its own. Billing is the same either way: per successful row, never for errors.

Otherwise copy this prompt into Claude, ChatGPT, Cursor or any MCP-enabled assistant:

```text
I want Spanish property listings from Fotocasa using the Apify Actor `sian.agency/fotocasa-property-scraper`.

Use it when I need: Spanish sale, rent, room-share, business-transfer or rent-to-own listings with asking price, price per square metre, built area, bedrooms, bathrooms, floor, postcode, GPS coordinates, the advertiser's full Spanish description and every photo. The listing agency's name, phone number and fotocasa profile come attached to each row at no extra charge. Input is a plain place name (a city, province, district or neighbourhood), so no search URL has to be built first. A separate agency mode returns everything one estate agency currently has on the market.

Don't use it when: you need a different European market — use immobiliare-property-scraper or seloger-property-scraper or immobilienscout24-property-scraper instead.

How to call it: pick an `operation`: `search` (a place name or a pasted fotocasa search URL) or `agency` (fotocasa agency page URLs); set `location` to any Spanish place (`Madrid`, `Barcelona`, `Malaga`, `Barrio de Salamanca`) and add more in `locations`; choose `transactionType` (`sale`, `rent`, `share`, `transfer`, `rent-to-own` or `all`); narrow with `propertyType`, `minPrice`/`maxPrice`, `minRooms`, `minBathrooms`, `minSurface`/`maxSurface` or `newConstruction`; order with `sortBy` and cap the run with `maxResults`.

Start with this input:
{
  "operation": "search",
  "location": "Madrid",
  "transactionType": "sale",
  "propertyType": "homes",
  "minPrice": 200000,
  "maxPrice": 500000,
  "maxResults": 120
}

Ask me which Spanish place, and whether they want listings for sale, to rent, room shares, or one agency's whole portfolio, then run the Actor and summarise the results as a table.
```

**Things you can ask your agent for:**

- *Pull flats for sale in Barrio de Salamanca between 500k and 800k and rank them by price per square metre.*
- *Compare median rent per square metre across Madrid, Barcelona and Valencia.*
- *Build a contact list of estate agencies advertising in Marbella, with their phone numbers.*

Machine-readable API, MCP config and OpenAPI definition for this Actor are published at [apify.com/sian.agency/fotocasa-property-scraper.md](https://apify.com/sian.agency/fotocasa-property-scraper.md).

### 📋 Overview

Give it a place and a market. It resolves the place against Fotocasa's own location index, pages
through the results, and writes one row per listing.

| | |
|---|---|
| **Source** | fotocasa.es (Spain) |
| **Operations** | Property Search · Agency Listings |
| **Markets** | For sale · For rent · Room share · Business transfer · Rent to own · All at once |
| **Property types** | Homes · Garages · Land · Commercial premises · Offices · Storage rooms · Whole buildings |
| **Rows per request** | 30 |
| **Ceiling** | 505 pages (~15,150 listings) per query. Fotocasa's own limit, not ours |
| **Setup** | None. No key, no login, no proxy |

### ✨ Features

- **Place names, not URLs.** `Madrid`, `Málaga`, `Palma de Mallorca`, `Barrio de Salamanca`. The
  run log prints which place matched, so you can see it picked the right one before you trust the data.
- **The agency's phone number on every row.** Name, phone, Fotocasa profile and whether the seller
  is an agency, a developer or a private owner. Included, not an add-on.
- **The full Spanish description.** The advertiser's own text, untrimmed and untranslated.
  That is where the energy rating, the community fees and the "reformado en 2019" usually live.
- **All five markets.** Sale and rent are table stakes. Fotocasa also runs room share, with over 14,000
  live ads in Madrid alone, plus business transfers and rent-to-own. Or set one option and take
  every market at once.
- **Every photo, room-tagged.** A typical listing carries 20–30 images.
- **Price per square metre, computed.** Asking price ÷ built area, already in the row.
- **Multi-place runs.** Add as many places as you like; they run in one job and land in one dataset.
- **Agency portfolios.** Paste an agency's Fotocasa page and get everything they have listed.
- **Honest totals.** The log reports how many listings actually match, so you know when a query is
  bigger than Fotocasa will serve in one search.

### 🎬 Quick Start

```json
{ "operation": "search", "location": "Madrid", "transactionType": "sale", "maxResults": 90 }
```

That is a complete input. Press **Start** and you get 90 Madrid properties for sale.

### 🚀 Getting Started (3 Simple Steps)

#### Step 1: Name a place

Type it into **📍 Place in Spain**: `Valencia`, `Marbella`, `Bilbao`, `Barrio de Salamanca`. Add
more places in **🗺️ More places** and they all run in the same job. A Fotocasa search URL works too:
paste it and the place and market are read straight off it.

#### Step 2: Choose the market and narrow it

**🤝 Sale or rent** picks the market. Then set whatever matters: price band, minimum bedrooms,
minimum size, property type, new builds only.

#### Step 3: Press Start

Rows appear as they arrive. Set **🔢 Max listings** to cap what you spend.

### 📥 Input Configuration

| Field | Type | Default | What it does |
|---|---|---|---|
| `operation` | select | `search` | `search` for listings by place, `agency` for one agency's portfolio |
| `location` | string | `Madrid` | Any Spanish place name, or a fotocasa.es search URL |
| `locations` | array | `[]` | More places, searched in the same run |
| `agencyUrls` | array | `[]` | Fotocasa agency pages, used by the Agency Listings operation |
| `transactionType` | select | `sale` | `sale`, `rent`, `share`, `transfer`, `rent-to-own`, or `all` |
| `propertyType` | select | `all` | Homes, garages, land, commercial, offices, storage, buildings |
| `newConstruction` | boolean | `false` | New builds only |
| `minPrice` / `maxPrice` | integer | `0` | Price band in EUR. For rentals this is monthly rent. `0` = no bound |
| `minRooms` | integer | `0` | Fewest bedrooms |
| `minBathrooms` | integer | `0` | Fewest bathrooms |
| `minSurface` / `maxSurface` | integer | `0` | Built area in m². `0` = no bound |
| `sortBy` | select | `relevance` | `relevance`, `newest`, `price-low`, `price-high` |
| `maxResults` | integer | `90` | Stop after this many listings across every place |

There is nothing to configure about *how* the actor fetches. No proxy picker, no concurrency, no
retry counts. Those are our decisions and they are already made.

### 📤 Output

One row per listing. A sale listing in Madrid:

```json
{
  "propertyId": 189625641,
  "listingUrl": "https://www.fotocasa.es/es/comprar/vivienda/madrid-capital/.../189625641/d",
  "propertyType": "Home",
  "propertySubtype": "Penthouse",
  "transactionType": "For sale",
  "price": 1620000,
  "pricePerSqm": 12462,
  "surfaceSqm": 130,
  "rooms": 3,
  "bathrooms": 2,
  "floor": 12,
  "listingDescription": "Ático situado en Madrid, en la exclusiva zona de Salamanca…",
  "publishedAt": "2026-05-08T15:08:35.443Z",
  "address": "Alcalá, Barrio de Salamanca",
  "neighborhood": "Goya",
  "district": "Barrio de Salamanca",
  "city": "Madrid Capital",
  "province": "Madrid",
  "region": "Madrid, Zona de",
  "zipCode": "28006",
  "latitude": 40.427853,
  "longitude": -3.6726794,
  "agencyName": "ESPÍGUL IMMOBILIARIA",
  "agencyPhone": "+34913439848",
  "agencyId": 9202775531783,
  "agencyUrl": "https://www.fotocasa.es/inmobiliarias/espigul-immobiliaria-9202775531783",
  "advertiserType": "Estate agency",
  "isNewConstruction": false,
  "isFeatured": true,
  "hasVirtualTour": false,
  "features": { "rooms": 3, "bathrooms": 2, "surface": 130, "floor": 12, "elevator": 1, "terrace": 1, "air_conditioner": 1, "heater": 1, "conservationState": 1 },
  "imageUrl": "https://static.fotocasa.es/images/ads/f8a5ccd4-…?rule=original",
  "imageCount": 28,
  "searchedLocation": "Madrid, Madrid",
  "status": "success"
}
```

| Field | Notes |
|---|---|
| `price` | Asking price in EUR. For rentals, the amount per `pricePeriod` |
| `pricePeriod` | `month` on rentals; absent on sales |
| `pricePerSqm` | Computed from price and built area |
| `features` | Fotocasa's own raw feature map: lift, terrace, heating, air conditioning, condition code |
| `agencyPhone` | Present wherever Fotocasa publishes one |
| `imageUrls` | Every photo on the listing |
| `errorMessage` | Only on `status: "error"` rows. Says what to change |

Export as JSON, CSV, Excel or XML, or read it from the API.

### 💼 Use Cases & Examples

#### 1. Spanish property market analysis

Pull a whole city at one snapshot and compute what the portal will not show you: median €/m² by
neighbourhood, how a 2-bed in Salamanca prices against the same flat in Tetuán, how the mix moves
month over month when you schedule it.

#### 2. Estate agency lead lists

Every row carries the agency's name, phone and profile. Take a district, dedupe by `agencyId`, and
you have the local agency map with contact details.

#### 3. Investment and yield screening

Run one district twice, once `sale` and once `rent`. Price, size and room count are on both rows, so
gross yield per neighbourhood falls out of a join.

#### 4. Relocation and comparison tools

Feed a portal or relocation service with live Spanish stock: coordinates, postcode, photos and the
full Spanish description, ready to render.

#### 5. Competitor inventory monitoring

Watch a rival agency's listing count, price changes and how long stock sits. Agency Listings with
`transactionType: "all"` returns their whole portfolio.

#### 6. Room-share and student-housing research

Room share is a separate market with its own pricing, and most listing exports skip it entirely.
`transactionType: "share"` puts it in the same schema as everything else.

### 🔗 Integration Examples

#### JavaScript/Node.js

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

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });

const run = await client.actor('sian.agency/fotocasa-property-scraper').call({
    operation: 'search',
    location: 'Barcelona',
    transactionType: 'rent',
    propertyType: 'homes',
    maxPrice: 1500,
    maxResults: 300,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
const byNeighbourhood = {};
for (const row of items) {
    (byNeighbourhood[row.neighborhood] ||= []).push(row.pricePerSqm);
}
console.log(byNeighbourhood);
```

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

run = client.actor("sian.agency/fotocasa-property-scraper").call(run_input={
    "operation": "search",
    "location": "Madrid",
    "locations": ["Barcelona", "Valencia"],
    "transactionType": "sale",
    "minSurface": 80,
    "maxResults": 600,
})

rows = list(client.dataset(run["defaultDatasetId"]).iterate_items())
agencies = {r["agencyId"]: (r["agencyName"], r.get("agencyPhone")) for r in rows if r.get("agencyId")}
print(f"{len(rows)} listings from {len(agencies)} agencies")
```

#### cURL

```bash
curl -X POST "https://api.apify.com/v2/acts/sian.agency~fotocasa-property-scraper/runs?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"operation":"search","location":"Marbella","transactionType":"sale","maxResults":90}'
```

#### Automation Workflows (N8N / Zapier / Make)

Run it on a schedule and push new listings straight into your own stack. In **N8N**, an Apify node
triggered daily on `sortBy: "newest"` feeds a Postgres insert or a Slack alert when something under
your price ceiling appears. **Zapier** and **Make** both connect the same way. The dataset is plain
JSON, so any HTTP step can read it.

### 📊 Performance & Pricing

Pay per listing. Nothing is charged for a row that fails.

#### FREE Tier

Up to 25 rows per run, so you can see the shape of the data before you commit.

#### PAID Tier

No row cap. One request returns 30 listings, and a run of a few hundred rows finishes in seconds.
Volume tiers reduce the per-listing price automatically as your monthly usage grows. See the
**Pricing** tab on the Store page for the current table.

### ❓ Frequently Asked Questions

**Do I need an API key, a login or a proxy?**
No. Type a Spanish place name and press Start.

**What can I put in the place field?**
Any Spanish place: a city (`Madrid`), a province (`Málaga`), a region, a district
(`Barrio de Salamanca`) or a neighbourhood. A Fotocasa search URL also works. The run log prints
which place was matched.

**How many listings can one search return?**
Fotocasa serves at most 505 pages of 30, so about 15,150 rows per query. Madrid alone has more than
15,000 flats for sale, so for a whole big city split the run by district or price band. The log
reports the true match count, so you always know when that applies.

**Is the agency's phone number really included?**
Yes, on every row where Fotocasa publishes one, at no extra charge. It is part of the listing
record, not a separate step.

**How do I get everything one agency has listed?**
Put their Fotocasa agency page URL in **🏢 Agency page URLs**, switch **🎯 Operation** to Agency
Listings, and set **🤝 Sale or rent** to **Every market**. You get their sales, rentals and room
shares in one dataset.

**Does it cover rentals and room shares as well as sales?**
All five markets Fotocasa runs: sale, rent, room share, business transfer and rent-to-own.

**Are the descriptions in Spanish?**
Yes. It is the advertiser's own text exactly as it appears on Fotocasa, neither translated nor trimmed.

**Can I get energy certificates or cadastral references?**
No. Those live on surfaces this actor does not read. What you get is what the listing record
carries, and the `features` map shows exactly which attributes Fotocasa published for each property.

**Does it return sold prices or price history?**
Fotocasa publishes live asking prices only. Build a history by scheduling this actor and keeping the
snapshots. One run cannot produce a past.

### 🔧 Troubleshooting

**"Fotocasa has no place called …"**
The place name did not match Fotocasa's index. Try the city or province on its own, without the
region: `Malaga`, not `Malaga province`. Accents are optional.

**Zero rows and a "no listings match" row**
The filters are too tight for that place. Widen the price band, drop the minimum size, or switch
property type to Everything. A district plus a narrow price band plus a bedroom minimum can genuinely
have no stock.

**Fewer rows than I asked for**
Either the search has fewer matches than your `maxResults`, or you hit Fotocasa's 505-page ceiling.
The log prints the real match count, so compare it against what you asked for.

**Rows returned but no `agencyPhone`**
Fotocasa does not publish a number for every advertiser, mostly on private-owner ads. Check
`advertiserType` to see which kind of seller it is.

**A run stopped at 25 rows**
That is the FREE tier cap. Add a payment method in Apify Console → Billing.

**"Fotocasa is rate limiting right now"**
It retries on its own with backoff. If a whole run fails this way, wait a few minutes and re-run;
running several large jobs at once against the same source is the usual cause.

### ⚖️ Legal

Fotocasa is a trademark of Adevinta Spain S.L.U. This actor is not affiliated with, endorsed by, or
sponsored by Fotocasa or Adevinta.

This actor reads listing data that Fotocasa publishes openly, with no login and no paywall. You are
responsible for how you use it: respect the GDPR when handling advertiser contact details, do not
use agency phone numbers for unsolicited marketing where local law forbids it, and check Fotocasa's
terms before republishing listing content or photos. Data is provided as-is; asking prices change
constantly and a snapshot is a snapshot.

### 💬 Support

- **Issues and feature requests:** https://apify.com/sian.agency/fotocasa-property-scraper/issues
- **Leave a review:** https://apify.com/sian.agency/fotocasa-property-scraper/reviews
- **More actors:** https://apify.com/sian.agency?fpr=sian

Other property portals in the same family: [SeLoger (France)](https://apify.com/sian.agency/seloger-property-scraper),
[Immobiliare (Italy)](https://apify.com/sian.agency/immobiliare-property-scraper),
[ImmobilienScout24 (Germany)](https://apify.com/sian.agency/immobilienscout24-property-scraper),
[Funda (Netherlands)](https://apify.com/sian.agency/funda-property-scraper),
[Rightmove (UK)](https://apify.com/sian.agency/rightmove-property-scraper).

***

#### Keywords for LLM Discovery

fotocasa scraper, fotocasa api, scrape fotocasa, fotocasa data extraction, spain real estate
scraper, spanish property listings, spain property data, pisos en venta, pisos de alquiler, casas en
venta españa, inmobiliaria scraper, spain housing data, madrid property listings, barcelona property
data, valencia real estate, marbella property listings, malaga property data, sevilla real estate,
bilbao property listings, spanish rental market data, spain property prices, price per square metre
spain, spanish estate agency contacts, real estate lead generation spain, property investment spain,
rental yield spain, room share spain, habitacion en alquiler, obra nueva españa, new build spain,
spanish property market analysis, real estate scraper, property listings api, european property
data, iberian real estate data, spain relocation data, costa del sol property, balearic property
listings, spanish property comparables, fotocasa alquiler, fotocasa venta

# Actor input Schema

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

Pick one per run. Property Search takes Spanish place names (or fotocasa search URLs) and returns listing rows; Agency Listings takes fotocasa agency page URLs and returns everything that agency currently has on the market.

## `location` (type: `string`):

A Spanish place name — city, province, region, district or neighbourhood. Madrid, Barcelona, Valencia, Marbella, Palma de Mallorca, Barrio de Salamanca. A fotocasa search URL works too and its own location is read off it. The name is matched against fotocasa's own place index and the run log prints exactly which place was matched.

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

Extra places to search in the same run. Each one runs its own search, but Max listings caps the run as a whole, so raise it when you add places or the first place spends the whole budget. This is also how you get past fotocasa's 505-page ceiling on any single query: split a huge city into its districts.

## `agencyUrls` (type: `array`):

Used by the Agency Listings operation: fotocasa agency pages, e.g. https://www.fotocasa.es/inmobiliarias/espigul-immobiliaria-9202775531783. The numeric id at the end of the URL is the agency, so a bare id works too. Set 'Sale or rent' to 'Every market' to pull the agency's entire portfolio in one run.

## `transactionType` (type: `string`):

Which market to search. Room share covers ads for a single room in a shared flat — a large, separately-priced market fotocasa carries and most listing exports ignore. 'Every market' returns all of them at once, which is what you want on Agency Listings to see an agency's whole portfolio rather than just its sales.

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

Narrow to one kind of property. 'Everything' returns all of them — verified: the seven types sum exactly to the unfiltered total.

## `newConstruction` (type: `boolean`):

Restrict to new-construction stock. Off returns both new and resale.

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

Lowest asking price to include. For rentals this is the monthly rent. 0 means no lower bound.

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

Highest asking price to include. For rentals this is the monthly rent. 0 means no upper bound.

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

Fewest bedrooms to accept. 0 means no minimum.

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

Fewest bathrooms to accept. 0 means no minimum.

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

Smallest built area in square metres. 0 means no minimum.

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

Largest built area in square metres. 0 means no maximum.

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

Newest first is what you want when running this on a schedule — the new stock lands on page 1.

## `maxResults` (type: `integer`):

Stop after this many listings across every place searched. Each call returns 30 rows, so the run stops at the first call that crosses your limit. Fotocasa serves at most 505 pages (~15,150 rows) per query.

## Actor input object example

```json
{
  "operation": "search",
  "location": "Madrid",
  "locations": [
    "Barcelona",
    "Valencia"
  ],
  "agencyUrls": [],
  "transactionType": "sale",
  "propertyType": "all",
  "newConstruction": false,
  "minPrice": 0,
  "maxPrice": 0,
  "minRooms": 0,
  "minBathrooms": 0,
  "minSurface": 0,
  "maxSurface": 0,
  "sortBy": "relevance",
  "maxResults": 90
}
```

# Actor output Schema

## `fotocasaListings` (type: `string`):

Every listing this run returned.

## `scrapingSummary` (type: `string`):

HTML summary showing successful and failed results with key metrics

# 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 = {
    "operation": "search",
    "location": "Madrid",
    "locations": [
        "Barcelona",
        "Valencia"
    ],
    "agencyUrls": [],
    "transactionType": "sale",
    "propertyType": "all",
    "newConstruction": false,
    "minPrice": 0,
    "maxPrice": 0,
    "minRooms": 0,
    "minBathrooms": 0,
    "minSurface": 0,
    "maxSurface": 0,
    "sortBy": "relevance",
    "maxResults": 90
};

// Run the Actor and wait for it to finish
const run = await client.actor("sian.agency/fotocasa-property-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 = {
    "operation": "search",
    "location": "Madrid",
    "locations": [
        "Barcelona",
        "Valencia",
    ],
    "agencyUrls": [],
    "transactionType": "sale",
    "propertyType": "all",
    "newConstruction": False,
    "minPrice": 0,
    "maxPrice": 0,
    "minRooms": 0,
    "minBathrooms": 0,
    "minSurface": 0,
    "maxSurface": 0,
    "sortBy": "relevance",
    "maxResults": 90,
}

# Run the Actor and wait for it to finish
run = client.actor("sian.agency/fotocasa-property-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 '{
  "operation": "search",
  "location": "Madrid",
  "locations": [
    "Barcelona",
    "Valencia"
  ],
  "agencyUrls": [],
  "transactionType": "sale",
  "propertyType": "all",
  "newConstruction": false,
  "minPrice": 0,
  "maxPrice": 0,
  "minRooms": 0,
  "minBathrooms": 0,
  "minSurface": 0,
  "maxSurface": 0,
  "sortBy": "relevance",
  "maxResults": 90
}' |
apify call sian.agency/fotocasa-property-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,sian.agency/fotocasa-property-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/XowmANmhtDgXBDntb/builds/LwKl0Piu8PSNZxyKN/openapi.json
