# Fotocasa Scraper - Spain Listings, Pay Per Result (`gio21/fotocasa-scraper`) Actor

Scrape Fotocasa.es listings: price, area, rooms, features, agency, images. Direct search URL support overrides any filter. Sale, rent, shared room and vacation rental across homes, offices, land. $0.005 per listing, $0.05 minimum.

- **URL**: https://apify.com/gio21/fotocasa-scraper.md
- **Developed by:** [Gio](https://apify.com/gio21) (community)
- **Categories:** Real estate
- **Features:** Limited permissions
- **Stats:** 43 total users, 5 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

$5.00 / 1,000 listing scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Fotocasa Scraper - Spain Listings, Pay Per Result

### Why use this scraper

Fotocasa is one of Spain's leading property portals for buying and renting
homes, offices, land and commercial space, but like most listing sites it
has no public API for bulk access. Anyone building a PropTech product,
tracking a local market, or sourcing leads from agency listings needs the
data in a structured form, not a page designed for a single visitor
scrolling through photos. Manually copying listings is slow and does not
scale past a handful of properties, and most teams end up either paying for
an expensive data feed they do not fully need or building and maintaining
their own scraper against a site that changes its front end without notice.
This actor searches Fotocasa by operation, property type and location and
returns every matching listing as clean JSON: price, size, rooms, features,
agency and images, ready to load into a spreadsheet, CRM or pricing model,
without writing or maintaining a single line of scraping code.

### Overview

Give the actor an operation (buy, rent, shared room or vacation rental), a
property type and a location slug, or a direct Fotocasa search URL, and it
returns one record per listing matched, up to your `maxItems` cap. A search
for a city the size of Madrid typically returns the first page of results
within seconds; larger pulls scale with `maxPages`, roughly 30 listings per
page. Pricing is pay-per-result: a fee per listing returned, nothing charged
for pages that return no matches. Because the actor reads listing fields
directly from Fotocasa's own search result pages, the data reflects whatever
is published at the moment the run executes, including price changes and
new listings added since your previous run.

### Supported inputs

- **Operation (`operation`)** - `comprar` (sale), `alquiler` (rent),
  `alquiler-habitacion` (shared room) or `alquiler-vacacional` (vacation
  rental).
- **Property type (`propertyType`)** - `viviendas` (homes), `oficinas`
  (offices), `locales` (commercial), `naves` (warehouses), `garajes`
  (garages), `trasteros` (storage) or `terrenos` (land).
- **Location (`location`)** - a Fotocasa location slug such as
  `madrid-capital`, `barcelona-capital`, `valencia-capital` or
  `sevilla-capital`.
- **Custom search URL (`startUrl`)** - an optional direct Fotocasa search
  URL that overrides operation, property type and location for searches with
  filters not exposed as separate input fields (price range, specific
  features, etc, as configured directly on fotocasa.es).
- **Max listings (`maxItems`)** - up to 500 per run.
- **Max pages (`maxPages`)** - how many search result pages to walk, about
  30 listings each.

### Use cases

- **PropTech and CRM feeds.** Pipe Fotocasa listings directly into a
  property-comparison tool, CRM or client portal, refreshed on a schedule.
- **Investment and yield research.** Pull every sale listing in a district
  to calculate average price per square meter and spot under-priced
  properties relative to the neighborhood.
- **Relocation services.** Build a shortlist of rental listings matching a
  client's budget and city before they arrive in Spain.
- **Agency and competitor monitoring.** Track which agencies are most
  active in a given city or property type, and at what price points, by
  reading the `agency` field across a full search.
- **Vacation rental market analysis.** Use `alquiler-vacacional` to compare
  short-term rental pricing and availability across tourist areas.
- **Lead generation for movers, renovators and mortgage brokers.** Pull
  freshly listed properties in a target area and reach out to new sellers or
  buyers before competitors working from manual searches do.
- **Portfolio tracking for landlords and small investors.** Re-run the same
  search periodically to see how a specific set of listings changes price or
  disappears from the market, without manually revisiting each listing page.

### How it works

The actor submits your search filters (or your direct URL) to Fotocasa's
search pages the same way a visitor would, then walks the paginated result
list up to `maxPages` or `maxItems`, reading each listing card directly from
the search results. Every field returned (price, area, rooms, images, URL)
comes from the listing as published on the page at scrape time.

### Input configuration

**Homes for sale in Madrid:**

```json
{ "operation": "comprar", "propertyType": "viviendas", "location": "madrid-capital", "maxItems": 100 }
```

**Rentals in Barcelona, limited pages:**

```json
{
  "operation": "alquiler",
  "propertyType": "viviendas",
  "location": "barcelona-capital",
  "maxItems": 60,
  "maxPages": 2
}
```

**Direct search URL with Fotocasa's own filters applied:**

```json
{
  "operation": "comprar",
  "location": "valencia-capital",
  "startUrl": "https://www.fotocasa.es/es/comprar/viviendas/valencia-capital/todas-las-zonas/l",
  "maxItems": 50
}
```

### Output sample

Real listings from a production run (homes for sale, Madrid):

```json
{
  "listingId": "190412393",
  "title": "Piso con 2 baños en Torrejón de Ardoz, Madrid",
  "propertyType": "Vivienda",
  "operation": "comprar",
  "price": 374600,
  "currency": "EUR",
  "area": 105,
  "rooms": 3,
  "bathrooms": 2,
  "location": "Madrid",
  "images": ["https://static.fotocasa.es/images/ads/c56dd5b3-7649-4207-8af8-fd9a148fafc6?rule=original"],
  "url": "https://www.fotocasa.es/es/comprar/vivienda/torrejon-de-ardoz/aire-acondicionado-calefaccion-parking-terraza-ascensor/190412393/d",
  "scrapedAt": "2026-09-30T17:54:31.435Z"
}
```

```json
{
  "listingId": "190399711",
  "title": "Piso con 1 baño en Madrid, Madrid",
  "propertyType": "Vivienda",
  "operation": "comprar",
  "price": 489000,
  "currency": "EUR",
  "area": 43,
  "rooms": 1,
  "bathrooms": 1,
  "location": "Madrid",
  "url": "https://www.fotocasa.es/es/comprar/vivienda/madrid/calefaccion-ascensor-amueblado/190399711/d",
  "scrapedAt": "2026-09-30T17:54:31.435Z"
}
```

### Key output fields

| Field | Type | Description |
|-------|------|-------------|
| `listingId` | string | Fotocasa internal listing ID |
| `title` | string | Listing headline as published |
| `propertyType` | string | e.g. `Vivienda` |
| `operation` | string | Matches the requested operation (`comprar`, `alquiler`, etc) |
| `price` | number | Listing price in EUR |
| `pricePerSqm` | number | Price per square meter, when Fotocasa publishes it |
| `area` | number | Size in square meters |
| `rooms`, `bathrooms` | number | Room counts |
| `location`, `neighborhood` | string | City and area |
| `features` | array | Amenities such as terrace, lift, AC, pool, when listed |
| `agency` | string | Listing agency name, when the listing is agency-managed |
| `images` | array | Listing photo URLs |
| `url` | string | Direct Fotocasa listing URL |

### Pricing

Pay per event:

| Event | Price |
|-------|-------|
| Listing scraped | $0.005 |

Minimum charge per run: $0.05.

### What makes this richer than the competition

Two other Store listings reach far more Fotocasa users than this actor
today, both at a lower price. `igolaizola/fotocasa-scraper` ("Fotocasa
Scraper - Real Estate data for Spain", 71 users/30 days) charges around
$0.001 per actor start plus $0.001 per result, and covers sale, rent,
shared, rent-to-buy and transfer across homes, offices, commercial, garages,
land and buildings. `azzouzana/fotocasa-es-search-results-scraper-by-search-url-ppr`
(39 users/30 days) charges $0.005 actor start plus $0.001 per result. Both
are meaningfully cheaper per listing than our $0.005 flat fee. Where this
actor holds its own is simplicity for direct-URL searches: a single
`startUrl` input overrides every filter at once, so any search already built
on fotocasa.es (including filters with no dedicated input field here) can be
scraped without mapping every Fotocasa filter into this actor's schema.

### Notes & limitations

- `pricePerSqm`, `neighborhood`, `agency` and `description` come back `null`
  when Fotocasa does not display them on a given listing; the actor never
  estimates a missing value.
- `startUrl` overrides `operation`, `propertyType` and `location` entirely;
  set it only when you need filters not exposed as separate inputs.
- Coverage is mainland Spain and the islands as published on fotocasa.es;
  the actor does not cover Fotocasa's Italy or other country sites.
- Energy certificate and full description text are not currently captured
  as structured fields; only what is listed in the Key Output Fields table
  above is returned.
- This actor is not affiliated with or endorsed by Fotocasa. It extracts
  publicly available listing data for research and business use.
- Results depend on Fotocasa's own search ranking and pagination; running
  the same search twice in quick succession can return overlapping but not
  byte-identical result sets if new listings were published in between.

### FAQ

**Can I search a neighborhood instead of a whole city?**
Use a more specific `location` slug if Fotocasa has one for that area, or
build the search directly on fotocasa.es and pass the resulting URL as
`startUrl`.

**What happens when a search returns fewer listings than `maxItems`?**
The actor returns every matching listing and stops; you are only charged
for listings actually returned.

**Does this cover rentals as well as sales?**
Yes, set `operation` to `alquiler` for rent, `alquiler-habitacion` for
shared rooms, or `alquiler-vacacional` for vacation rentals.

**Why is `agency` sometimes empty?**
Some Fotocasa listings are posted directly by the owner rather than through
an agency; in that case the field is `null` rather than guessed.

**Is this affiliated with Fotocasa?**
No. This is an independent tool for extracting publicly available listing
data. Please respect Fotocasa's terms of service when using the data.

### For AI Agents & LLM Apps

This actor is available over the Apify MCP server (`mcp.apify.com`) for any
MCP-compatible agent to call as a tool, and can be called synchronously from
any backend via `run-sync-get-dataset-items`:

```bash
curl "https://api.apify.com/v2/acts/gio21~fotocasa-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -X POST -H "Content-Type: application/json" \
  -d '{"operation": "comprar", "propertyType": "viviendas", "location": "madrid-capital", "maxItems": 30}'
```

### Disclaimer

Fotocasa is a trademark of its respective owner. This actor is an
independent tool, not affiliated with, endorsed by or sponsored by
Fotocasa. It extracts publicly available listing data for research and
business use; respect Fotocasa's terms of service.

### SEO Keywords

Fotocasa scraper, Fotocasa API, Spain real estate scraper, property data
Spain, Fotocasa listings scraper.

# Actor input Schema

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

Listing type

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

Type of property

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

Fotocasa location slug (e.g. madrid-capital, barcelona-capital, valencia-capital, sevilla-capital)

## `startUrl` (type: `string`):

Optional: direct Fotocasa search URL. Overrides operation/propertyType/location when set.

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

Maximum number of listings to return. Each listing costs $0.005. Capped at 500 per run.

## `maxPages` (type: `integer`):

Maximum search result pages (~30 listings per page).

## Actor input object example

```json
{
  "operation": "comprar",
  "propertyType": "viviendas",
  "location": "madrid-capital",
  "maxItems": 20,
  "maxPages": 3
}
```

# Actor output Schema

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

Property listings with price, area, rooms, features, agency, images and URL.

# 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": "comprar",
    "propertyType": "viviendas",
    "location": "madrid-capital",
    "maxItems": 20,
    "maxPages": 3
};

// Run the Actor and wait for it to finish
const run = await client.actor("gio21/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 = {
    "operation": "comprar",
    "propertyType": "viviendas",
    "location": "madrid-capital",
    "maxItems": 20,
    "maxPages": 3,
}

# Run the Actor and wait for it to finish
run = client.actor("gio21/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 '{
  "operation": "comprar",
  "propertyType": "viviendas",
  "location": "madrid-capital",
  "maxItems": 20,
  "maxPages": 3
}' |
apify call gio21/fotocasa-scraper --silent --output-dataset

```

## MCP server setup

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