# Fotocasa Scraper — Spain Rent & Sale Listings (`friendly_keelboat/fotocasa-scraper`) Actor

Scrape new Fotocasa rental listings or homes for sale in Spain: Madrid, Barcelona, Valencia, Málaga, Balearic and Canary Islands and more. Filters, 41 fields, publication date, €/m².

- **URL**: https://apify.com/friendly_keelboat/fotocasa-scraper.md
- **Developed by:** [Casa Radar](https://apify.com/friendly_keelboat) (community)
- **Categories:** Real estate, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.10 / actor start

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 Rent & Sale Listings

Get **only NEW Fotocasa rental listings or homes for sale** in Spain — scheduled, filtered and ready for your spreadsheet, CRM or AI agent.

Fotocasa is one of the largest property portals in Spain. This Actor reads Fotocasa data directly, without a browser, so runs are fast and stable: a typical run takes 1–2 minutes.

### What you get

- **Rent or sale** — `operation: "rent"` (default) or `"sale"`
- **Only new listings** — the Actor remembers what you have already received and returns only fresh ones on the next run
- **Filters** — `minPrice`, `maxPrice`, `minRooms`, `minSize`, `maxSize`. The Actor filters the results after fetching them.
- **41 fields per listing** — GPS, photos, rooms, bathrooms, size, floor, district, address, description, agency, phone, elevator, parking, AC, furnished, terrace, pool, publication date
- **Price per m²** (`pricePerM2`) in every result
- **No Fotocasa account, API key or approval needed**

### Areas

- `barcelona`
- `madrid`
- `sevilla`
- `valencia`
- `alicante`
- `malaga` — province of Málaga: Málaga city and the Costa del Sol (Marbella, Estepona, Fuengirola…)
- `bilbao` — province of Bizkaia
- `baleares` — Balearic Islands: Mallorca, Menorca, Ibiza, Formentera
- `tenerife` — province of Santa Cruz de Tenerife: Tenerife, La Palma, La Gomera, El Hierro
- `las-palmas` — province of Las Palmas: Gran Canaria, Fuerteventura, Lanzarote

### Input example

```json
{"city": "madrid", "operation": "rent", "maxPrice": 1500, "minRooms": 2}
```

| Field | Default | Description |
|-------|---------|-------------|
| `city` | `madrid` | Area to scrape |
| `operation` | `rent` | `rent` or `sale` |
| `minPrice` / `maxPrice` | — | Price range in EUR (monthly rent or asking price) |
| `minRooms` | — | At least this many bedrooms |
| `minSize` / `maxSize` | — | Size range in m² |
| `maxItems` | `50` | Max listings per run (1-200) |
| `onlyNew` | `true` | Return only listings you have not received before |

Rent and sale keep separate "already seen" lists, so you can schedule both for the same area.

### Ready-made workflows

**New Fotocasa listings in Google Sheets every hour** — schedule the Actor every hour with `onlyNew: true`. In n8n, Make or Zapier, use the Apify app ("Actor run finished" → "Get dataset items") and append each item to a Google Sheet.

**Alert for a good deal** — run with your filters and send each new item to Telegram, Slack or email from n8n or Make. Use `pricePerM2` to keep only homes below the area average.

**One API call:**

```bash
curl -X POST "https://api.apify.com/v2/acts/friendly_keelboat~fotocasa-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"city": "madrid", "operation": "sale"}'
```

### Use with AI agents (MCP)

Add `friendly_keelboat/fotocasa-scraper` to the [Apify MCP server](https://mcp.apify.com) and ask your agent (Claude, ChatGPT, Cursor, n8n AI Agent) things like "Find 2-bedroom Fotocasa rentals in Madrid under €1,500 posted today". It is a practical Fotocasa API alternative for Spain property data.

### Need more portals?

The [Spain & Portugal multi-source scraper](https://apify.com/friendly_keelboat/spain-portugal-real-estate) returns Idealista + Fotocasa + Milanuncios for Spain and Idealista + Supercasa for Portugal in one run, for the same price per run. It removes duplicates across portals and links the same home on other portals (`alsoListedOn`).

### Pricing

**$0.10 per run** (pay per event, default memory). No monthly fee, no per-result charge.

| Schedule | Cost/day | Cost/month |
|----------|----------|------------|
| Every 4 hours | $0.60 | $18 |
| Every hour | $2.40 | $72 |

### Feedback

Found a problem or need another area? Open an issue on the **Issues** tab. We read every issue.

If the Actor works well for you, please leave a review on the **Reviews** tab. It helps other users find it.

# Actor input Schema

## `city` (type: `string`):

Area to scrape on Fotocasa: barcelona, madrid, sevilla, valencia, alicante, malaga (province of Málaga: Málaga city and the Costa del Sol (Marbella, Estepona, Fuengirola…)), bilbao (province of Bizkaia), baleares (Balearic Islands: Mallorca, Menorca, Ibiza, Formentera), tenerife (province of Santa Cruz de Tenerife: Tenerife, La Palma, La Gomera, El Hierro), las-palmas (province of Las Palmas: Gran Canaria, Fuerteventura, Lanzarote).

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

rent = rental listings (monthly rent). sale = homes for sale (asking price). Each operation keeps its own 'already seen' list, so you can schedule both for the same city.

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

Maximum listings to fetch (1-200)

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

Only listings at or above this price. Monthly rent for rent, asking price for sale. Leave empty for no limit.

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

Only listings at or below this price. Leave empty for no limit.

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

Only listings with at least this many bedrooms. Leave empty for no limit.

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

Only listings at least this large. Leave empty for no limit.

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

Only listings at most this large. Leave empty for no limit.

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

Return only listings not seen in previous runs. Uses Apify Key-Value Store to track seen IDs between runs. Perfect for scheduled scraping.

## `proxyUrl` (type: `string`):

Custom proxy URL. If empty, uses built-in residential proxy.

## Actor input object example

```json
{
  "city": "madrid",
  "operation": "rent",
  "maxItems": 50,
  "onlyNew": true
}
```

# Actor output Schema

## `listings` (type: `string`):

Deduplicated rental or for-sale listings with 41 fields: price, GPS, photos, rooms, features, agency, and more.

# 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 = {};

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

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

```

## MCP server setup

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