# Fotocasa Scraper - Spain Property Listings & Price Drops (`scrapewise/fotocasa-scraper`) Actor

Scrape Fotocasa.es sale and rent listings in Spain: price, price per m², surface, rooms, floor, zone, agency, photos and price cuts. Search by URL or city with filters. Schedule it daily: only new listings and price drops. Error rows are free.

- **URL**: https://apify.com/scrapewise/fotocasa-scraper.md
- **Developed by:** [Scrapewise Data](https://apify.com/scrapewise) (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.51 / 1,000 listing delivereds

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: Spain property listings, price per m² and price drops

Scrape [Fotocasa.es](https://www.fotocasa.es), one of Spain's largest real estate portals, **without an account,
cookies or a browser**. Paste a search URL with your filters, or give a city, town or province with contract (sale,
rent or room share), property type, price, surface, bedrooms and bathrooms. Every listing comes with price,
**price per m²**, surface, bedrooms, bathrooms, floor, district and neighbourhood, coordinates, amenities, the full
description, every photo, the agency and the price cut Fotocasa shows on the listing.

Built for **daily monitoring**: schedule the same search every morning and get **only the listings that are new**,
plus the ones **whose price changed**, with the previous price and the drop in euros and percent. A quiet day costs
nothing.

### At a glance

- **Price per 1,000 listings, Free plan:** US$ 0.60 (down to US$ 0.51 on Gold and above)
- **Full listing page (optional):** US$ 0.60 per 1,000, on top
- **Fee per run start:** None
- **Search by Fotocasa URL or by location + filters:** Yes
- **Sale, rent and room share; homes, garages, land, commercial premises, offices, storage rooms, buildings:** Yes
- **Only new listings since the last run (`onlyNew`):** Yes, free when nothing is new
- **Price tracking between runs (`trackPriceChanges`, `onlyPriceDrops`):** Yes
- **Price per m²:** Yes, on every row
- **Agency or private owner filter (`sellerType`):** Yes, skipped listings are free
- **Advertiser contact data:** Never (see below)
- **Error rows (bad URL, unknown place, no results):** Free, with an `errorCode`

### One real row

From a test run on 2026-10-06 (location "Barcelona", rent, newest first, full listing pages on), shortened:

```json
{
  "type": "listing",
  "id": "191044924",
  "url": "https://www.fotocasa.es/es/alquiler/vivienda/barcelona-capital/aire-acondicionado-parking-ascensor-amueblado-television-se-aceptan-mascotas-internet/191044924/d",
  "title": "Flat for rent in Dreta de l'Eixample, Barcelona",
  "contract": "rent",
  "propertySubtype": "Flat",
  "price": 600,
  "currency": "EUR",
  "pricePeriod": "month",
  "isPriceReduced": false,
  "pricePerSqm": 5.71,
  "surfaceSqm": 105,
  "rooms": 3,
  "bathrooms": 2,
  "floor": "2",
  "amenities": ["air_conditioner", "parking", "elevator", "furnished", "tv", "pets_allowed", "internet"],
  "city": "Barcelona",
  "district": "Eixample",
  "neighbourhood": "Dreta de l'Eixample",
  "province": "Barcelona",
  "region": "Cataluña",
  "zipCode": "08010",
  "street": "Carrer de Pau Claris",
  "latitude": 41.3895676,
  "longitude": 2.1716639,
  "mainPhoto": "https://static.fotocasa.es/images/ads/f4974211-e008-47e5-bd6e-1b1347609f5f?rule=original",
  "photoCount": 9,
  "advertiserType": "agency",
  "agencyName": "Inmobiliaria España",
  "agencyUrl": "https://www.fotocasa.es/es/pro/inmobiliaria-espana/",
  "publishedAt": "2026-10-06T21:17:27",
  "energyCertificateStatus": "exempt",
  "typology": "FLAT",
  "orientation": "EAST",
  "parking": "PRIVATE",
  "elevator": "YES",
  "furnished": "YES",
  "occupancyStatus": "IS_AVAILABLE",
  "constructionType": "secondHand",
  "referenceCode": "MCIMWQZOJST-04",
  "hasDetails": true
}
```

A listing that Fotocasa marks as reduced carries the cut too, for example
`"isPriceReduced": true, "priceReducedBy": 20000, "originalPrice": 895000, "price": 875000`.

### What you can do with it

- **Investors:** watch Madrid, Barcelona or Valencia every morning for new listings under a price per m², and catch
  every price drop on what you already saw (`onlyNew` + `trackPriceChanges`).
- **Agencies and brokers:** follow new listings and price cuts in your area, and see which agencies publish the
  most in each district.
- **Relocation and rental search:** a daily alert of new rentals in Barcelona, Madrid or Malaga that match budget,
  size and bedrooms, straight into Slack, e-mail or Google Sheets.
- **Price per m² research:** median rent or sale price per m² by district and neighbourhood, by property type or
  energy class, for valuation, market reports and dashboards.
- **Datasets and AI:** clean, typed rows (numbers as numbers, dates as ISO) with coordinates, ready for maps and models.

### Input

| Field | What it does |
|---|---|
| `startUrls` | Fotocasa search URLs with your filters (every filter in the URL is kept), or listing URLs (ending in `/<id>/d`, returned with the full page) |
| `locations` | Spanish cities, towns or provinces (`Madrid`, `Barcelona`, `Valencia`, `Marbella`, `Malaga provincia`, `Spain`); one search each |
| `contract` | `sale` (default), `rent` or `roomShare` (rooms in shared flats) |
| `propertyType` | `homes` (all residential, default), `garage`, `land`, `commercial`, `office`, `storage`, `building` |
| `minPrice`, `maxPrice` | Euros (monthly rent for rentals) |
| `minSurface`, `maxSurface` | Square metres |
| `minRooms`, `maxRooms` | Bedrooms |
| `minBathrooms` | Bathrooms |
| `sellerType` | `any` (default), `agency` or `private` |
| `sortBy` | `newest` (default), `relevance`, `priceLowToHigh`, `priceHighToLow` |
| `maxItems` | Listings per search, default 50. 0 = up to 10,000 |
| `includeDetails` | Also read each listing page (energy certificate, features, agency website), charged as a separate event |
| `onlyNew` | Deliver only listings not delivered in earlier runs of the same search |
| `trackPriceChanges` | Add the price from the previous run and the change; with `onlyNew`, also deliver seen listings whose price changed |
| `onlyPriceDrops` | With `onlyNew` and `trackPriceChanges`: of the seen listings, only price drops |
| `proxyConfiguration` | Default Apify Proxy (datacenter) |

Example: new rentals in Barcelona up to 2,000 euros with at least 2 bedrooms, every morning:

```json
{
  "locations": ["Barcelona"],
  "contract": "rent",
  "maxPrice": 2000,
  "minRooms": 2,
  "maxItems": 100,
  "onlyNew": true,
  "trackPriceChanges": true
}
```

Or paste the search from your browser:

```json
{
  "startUrls": ["https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l?maxPrice=400000&minRooms=2"],
  "maxItems": 200
}
```

### How daily monitoring works

The Actor remembers each search (same URL or same location and filters) in a named key-value store in your own
account, `fotocasa-scraper-state`: listing id, last price, first and last time seen.

- **`onlyNew`:** the first run delivers up to `maxItems` and marks everything it read as seen. Later runs read the
  newest listings first and stop when they reach listings already seen. A day with nothing new delivers nothing and
  costs nothing.
- **`trackPriceChanges`:** every row gets `isNewListing`, `previousPrice`, `priceChange`, `priceChangePct`,
  `isPriceDrop`, `firstSeenAt` and `previousSeenAt`. `maxItems` then counts listings checked, so the cost of a daily
  run stays flat.
- **Both on:** you get new listings plus listings seen before whose price changed. Older listings that the first run
  never reached are recorded as a price baseline, not delivered as "new".
- Delete the key-value store to start over.

### Output

Every listing row: `id`, `url`, `title`, `contract` (`sale`, `rent`, `roomShare`), `propertyType`,
`propertySubtype`, `category`, `price`, `currency`, `pricePeriod` (`month` for rentals), `isPriceReduced`,
`priceReducedBy`, `originalPrice`, `pricePerSqm`, `surfaceSqm`, `rooms` (bedrooms), `bathrooms`, `floor`
(`ground floor`, `mezzanine`, `1`, `2`...), `amenities`, `city`, `district`, `neighbourhood`, `province`, `region`,
`zipCode`, `street` (agency listings), `latitude`, `longitude`, `description`, `mainPhoto`, `photos`, `photoCount`,
`hasVideo`, `hasVirtualTour`, `hasFloorPlans`, `advertiserType` (`agency`, `private` or `other`), `agencyName`,
`agencyId`, `agencyUrl`, `agencyLogo`, `isNewConstruction`, `isOccupied`, `isAuction`, `isBareOwnership`,
`isRentedWithTenants`, `isTemporaryRental`, `isOpportunity`, `isHighlighted` (paid placement), `publishedAt`
(Madrid time), `position`, `searchUrl`, `scrapedAt`.

With price tracking: `isNewListing`, `previousPrice`, `priceChange`, `priceChangePct`, `isPriceDrop`, `firstSeenAt`,
`previousSeenAt`.

With full listing pages (`hasDetails: true`): `energyClass`, `energyConsumptionKwhM2Year`, `emissionsClass`,
`emissionsKgCo2M2Year`, `energyCertificateStatus`, `typology`, `orientation`, `parking`, `elevator`, `furnished`,
`occupancyStatus`, `extraFeatures` (Fotocasa's own labels, in Spanish), `constructionType` (`secondHand` or new),
`plotSurfaceSqm`, `agencyWebsite`, `referenceCode`, `createdAt`. If a listing page cannot be read, the row still
comes with `hasDetails: false` and `detailsError`, and only the listing is charged.

**No advertiser contact data, by design.** For agencies (companies) you get the agency's name, id, page and logo.
For private owners you get only `advertiserType: "private"`: never a name, phone or e-mail, and the location stops
at district, neighbourhood and postcode (no street, coordinates rounded to about 1 km), because a private listing
can be the owner's own home. Phone numbers are never returned for anyone, and phone numbers and e-mail addresses
inside the description text are replaced with `[contact removed]`. Use the listing `url` to contact the advertiser
through Fotocasa.

### Error codes (never charged)

| `errorCode` | Meaning |
|---|---|
| `INVALID_INPUT` | A value the Actor does not understand (minimum above maximum, unknown property type, a URL that is not a Fotocasa search or listing) |
| `NOT_FOUND` | Fotocasa has no search page for this place, or the listing was removed |
| `NO_RESULTS` | No listing for this search and filters |
| `BLOCKED` | Fotocasa's firewall refused every attempt on new IPs; run again or use the RESIDENTIAL proxy group |
| `NOT_REACHED` | The run timeout arrived before this search or listing |
| `UNEXPECTED` | A page came in a shape we did not expect; the rest of the run goes on |

### Pricing

| Event | Per 1,000 |
|---|---|
| Listing delivered | US$ 0.60 |
| Full listing page (only with `includeDetails` or listing URLs) | US$ 0.60 |

A daily `onlyNew` run on a busy Madrid search that finds 60 new listings costs about US$ 0.04; with full listing pages,
about US$ 0.07. Error rows, duplicates, listings already seen, listings with an unchanged price and listings filtered out
by `sellerType` are free, and there is no start fee.

### Limitations

- Fotocasa has no agency or private filter in its search, so `sellerType` filters the pages the Actor reads: a
  search for private owners reads more pages to fill `maxItems`.
- Fotocasa sits behind a firewall. On a bad day a search may come back as `BLOCKED` (free): run it again.
- Labels from the listing page (`extraFeatures`) and descriptions are in Spanish, as the advertiser wrote them.
- A city name searches the city itself (Madrid capital, Barcelona capital). For the province, add "provincia"; for a
  district or a drawn area, set it on the site and paste the URL.
- This Actor reads public pages only.

### FAQ

**Do I need a Fotocasa account or a Spanish IP?** No. No login, no cookies, and the default datacenter proxy works.

**Can I paste a search from my browser?** Yes, in Spanish, English, Catalan or German. Price, surface, bedrooms,
bathrooms, zone, property type and sort in the URL are kept.

**How is price per m² computed?** `price / surfaceSqm` as published on the listing. For rentals it is the monthly
rent per m².

**How do I get an alert only when a price drops?** Turn on `onlyNew`, `trackPriceChanges` and `onlyPriceDrops`,
schedule the Task daily and send the dataset to your integration.

**Can I use it from n8n, Make, Zapier or an AI agent?** Yes, through the Apify app or the Apify MCP server. Error
rows are free, so an agent can explore cheaply.

**What if a run is cut by its timeout?** The Actor stops shortly before the limit and ends successfully with what it
delivered, telling you in the status message how to get the rest.

### Changelog

- **0.1 (2026-10-06):** first version. Search by Fotocasa URL or by location with contract, property type, price,
  surface, bedrooms, bathrooms, advertiser type and sort; sale, rent and room share; price per m²; the site's own
  price cuts; optional full listing pages; `onlyNew` and price tracking between runs for daily schedules; free error
  rows.

# Actor input Schema

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

Fotocasa search links copied from your browser after setting the filters on the site, one per line, for example https://www.fotocasa.es/es/alquiler/viviendas/barcelona-capital/todas-las-zonas/l?maxPrice=2000. Every filter in the link is kept. Listing links (ending in /<id>/d) also work and come back with the full listing page. Leave empty to search by location below. Each listing is charged once as 'Listing delivered'.

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

Spanish cities, towns or provinces, one per line, for example Madrid, Barcelona, Valencia or Marbella. A city name searches the city itself; add 'provincia' for the whole province (Barcelona provincia) or use Spain for the whole country. Each location is a separate search with the filters below, and each row says which search found it. Ignored for the links above.

## `contract` (type: `string`):

Operation to search: For sale (default), For rent, or Room in a shared flat (rooms only, homes only). Applies to the location searches.

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

Kind of property: Homes (default; flats, houses, penthouses, duplexes and every other residential type), Garage or parking, Land, Commercial premises, Office, Storage room, or Whole building.

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

Only listings at or above this price in euros, as a whole number (monthly rent for rentals), for example 150000 or 800. Empty = no minimum.

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

Only listings at or below this price in euros, as a whole number (monthly rent for rentals), for example 400000 or 2000. Empty = no maximum.

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

Only listings with at least this many square metres, for example 60. Empty = no minimum.

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

Only listings with at most this many square metres, for example 120. Empty = no maximum.

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

Only listings with at least this many bedrooms, for example 2. Empty = any.

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

Only listings with at most this many bedrooms, for example 4. Empty = any.

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

Only listings with at least this many bathrooms, for example 2. Empty = any.

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

Any (default), Agencies only, or Private owners only. Fotocasa has no such filter in its search, so the Actor filters the pages it reads; skipped listings are not charged.

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

Fotocasa's own orders: Newest first (default, the right choice for daily monitoring), Relevance, Price low to high, or Price high to low. With a limit it also decides which listings you get, for example Price low to high plus 50 returns the 50 cheapest.

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

Stop each search (each link or each location) after this many listings, for example 50 (default). Fotocasa shows 30 per page. 0 = up to 10,000. You pay per listing delivered, so this caps the cost of each search.

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

Off (default): rows come from the search results (price, size, rooms, address, photos, agency). On: also opens each listing's own page and adds the energy certificate (rating and kWh/m² per year), emissions, typology, orientation, parking, lift, furnished, occupancy status, new build or second hand, agency website, reference code and creation date. One extra request per listing, charged as a separate 'Full listing page' event.

## `onlyNew` (type: `boolean`):

For scheduled runs. Remembers which listings each search (with its filters) already returned, in a named key-value store in your account ('fotocasa-scraper-state'), and delivers only listings not seen before. The first run delivers up to the limit and marks everything it read as seen. Seen listings are not delivered and not charged. Forces the newest-first order. Delete the store to start over.

## `trackPriceChanges` (type: `boolean`):

Compares each listing's price with the price seen in your previous runs of the same search (same key-value store) and adds previousPrice, priceChange, priceChangePct, isPriceDrop, isNewListing and firstSeenAt to every row. Together with 'Only new listings' you get new listings plus listings whose price changed. The limit then counts listings checked, so a daily run keeps the same cost.

## `onlyPriceDrops` (type: `boolean`):

With 'Only new listings' and 'Track price changes' both on: of the listings seen before, deliver only those whose price went down. Price increases are skipped and not charged.

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

The default Apify Proxy (datacenter) works. If it keeps being blocked, the Actor moves to the residential group on its own when your account has it, with no extra charge.

## Actor input object example

```json
{
  "locations": [
    "Madrid"
  ],
  "contract": "sale",
  "propertyType": "homes",
  "sellerType": "any",
  "sortBy": "newest",
  "maxItems": 50,
  "includeDetails": false,
  "onlyNew": false,
  "trackPriceChanges": false,
  "onlyPriceDrops": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

No description

## `resultsCsv` (type: `string`):

No description

# 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"
    ]
};

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

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

```

## MCP server setup

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