# Fotocasa Scraper — Spain Real Estate Listings & Prices (`studio-amba/fotocasa-scraper`) Actor

Scrape real estate listings from fotocasa.es — Spain's leading property portal. Extract prices, photos, GPS coordinates, property details, and agency info for apartments, houses, and more. No login required.

- **URL**: https://apify.com/studio-amba/fotocasa-scraper.md
- **Developed by:** [Studio Amba](https://apify.com/studio-amba) (community)
- **Categories:** E-commerce
- **Stats:** 2 total users, 1 monthly users, 25.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

### What does Fotocasa Scraper do?

**Fotocasa Scraper** extracts real estate listings from [Fotocasa.es](https://www.fotocasa.es) — one of Spain's largest and most popular property portals. It collects **prices, property details, photos, GPS coordinates, agency info**, and more for apartments, houses, chalets, penthouses, and other property types across all Spanish cities. No login or cookies required.

Use the Apify platform to run this scraper on a schedule, access results via API, or integrate with tools like Google Sheets, Slack, Zapier, and Make.

### Why use Fotocasa Scraper?

- **Market research** — Track property prices across Spanish cities, compare neighborhoods, and identify market trends
- **Lead generation** — Collect real estate agency listings for B2B outreach or partnership opportunities
- **Price monitoring** — Set up scheduled runs to track price changes for specific cities or property types
- **Data analysis** — Export structured data to CSV, JSON, or Excel for portfolio analysis and investment decisions
- **Competitive intelligence** — Monitor competitor listings, pricing strategies, and market positioning
- **Relocation planning** — Compare rental prices and property availability across Spanish cities

### How to scrape Fotocasa data

1. Go to the [Fotocasa Scraper](https://apify.com/jelledesramaults/fotocasa-scraper) page on Apify
2. Click **Try for free** to open the actor in Apify Console
3. Enter a city name (e.g., "Madrid", "Barcelona", "Valencia")
4. Select listing type: **For Sale** or **For Rent**
5. Optionally filter by property type (apartment, house, chalet, etc.)
6. Optionally set a price range
7. Set the maximum number of results you need
8. Click **Start** and wait for the scraper to finish
9. Download your data in JSON, CSV, Excel, or HTML format

### Input

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `searchQuery` | String | No | City or location to search (default: "Madrid"). Examples: "Barcelona", "Valencia", "Sevilla", "Malaga" |
| `listingType` | String | No | "sale" (default) or "rent" |
| `propertyType` | String | No | Filter: "pisos" (apartments), "casas" (houses), "chalets", "aticos" (penthouses), "duplex", "estudios" (studios), "lofts", or "all" (default) |
| `minPrice` | Integer | No | Minimum price in EUR. Leave empty for no minimum |
| `maxPrice` | Integer | No | Maximum price in EUR. Leave empty for no maximum |
| `maxResults` | Integer | No | Maximum listings to return (default: 100) |
| `proxyConfiguration` | Object | No | Proxy settings. Residential proxies with Spain targeting strongly recommended |

### Output

Each listing contains:

| Field | Type | Example |
|-------|------|---------|
| `title` | String | `"Piso en venta en calle Gran Via"` |
| `price` | Number | `350000` |
| `currency` | String | `"EUR"` |
| `listingType` | String | `"sale"` |
| `propertyType` | String | `"piso"` |
| `address` | String | `"Calle Gran Via, 25"` |
| `city` | String | `"Madrid"` |
| `postalCode` | String | `"28013"` |
| `latitude` | Number | `40.4200` |
| `longitude` | Number | `-3.7025` |
| `bedrooms` | Number | `3` |
| `bathrooms` | Number | `2` |
| `surface` | Number | `95` |
| `buildYear` | Number | `1975` |
| `imageUrl` | String | Main listing photo URL |
| `imageUrls` | Array | All listing photo URLs |
| `description` | String | Full property description text |
| `agencyName` | String | `"Tecnocasa Madrid Centro"` |
| `url` | String | Full listing URL on Fotocasa |
| `scrapedAt` | String | `"2026-05-27T10:30:00.000Z"` |

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

### Example output

```json
{
    "title": "Piso en venta en calle Gran Via",
    "price": 350000,
    "currency": "EUR",
    "listingType": "sale",
    "propertyType": "piso",
    "address": "Calle Gran Via, 25",
    "city": "Madrid",
    "postalCode": "28013",
    "latitude": 40.42,
    "longitude": -3.7025,
    "bedrooms": 3,
    "bathrooms": 2,
    "surface": 95,
    "buildYear": 1975,
    "imageUrl": "https://static.fotocasa.es/images/ads/...",
    "imageUrls": [
        "https://static.fotocasa.es/images/ads/...",
        "https://static.fotocasa.es/images/ads/..."
    ],
    "description": "Luminoso piso en pleno centro de Madrid con 3 habitaciones...",
    "agencyName": "Tecnocasa Madrid Centro",
    "url": "https://www.fotocasa.es/es/comprar/vivienda/madrid-capital/calefaccion-ascensor/12345678/d",
    "scrapedAt": "2026-05-27T10:30:00.000Z"
}
````

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

Fotocasa requires browser-based scraping with residential proxies due to its JavaScript rendering. Estimated costs:

- **~20 listings** per run: ~0.3 compute units (~$1.50)
- **~100 listings** per run: ~1 compute unit (~$5)
- **~500 listings** across multiple pages: ~4 compute units (~$20)

Costs vary based on proxy usage and the number of pages scraped. Use the `maxResults` parameter to control run costs.

### Tips for best results

- **Use residential proxies** — Fotocasa works best with residential proxies targeted at Spain. This is preconfigured in the default proxy settings.
- **Start small** — Test with `maxResults: 10` before running large jobs
- **Use specific cities** — Searching by city name gives the most reliable results
- **Schedule runs** — Set up daily or weekly schedules to track market changes over time
- **Filter by property type** — Narrow results to reduce costs and get more relevant data
- **Price filters** — Use `minPrice` and `maxPrice` to target specific market segments

### Supported cities

The scraper works with any city in Spain. Popular choices include:
Madrid, Barcelona, Valencia, Sevilla, Malaga, Bilbao, Alicante, Zaragoza, Palma de Mallorca, Las Palmas, Murcia, Granada, Cordoba, Valladolid, San Sebastian, Salamanca, Marbella, Ibiza, Tenerife, and many more.

### FAQ and support

**Is it legal to scrape Fotocasa?**
This actor extracts publicly available data from fotocasa.es. Users are responsible for ensuring their use complies with applicable laws and the website's terms of service.

**Why are some fields empty?**
Not all listings include every detail (e.g., build year, postal code, GPS coordinates). The scraper returns `null` for missing fields.

**The scraper returned 0 results?**
Fotocasa requires JavaScript rendering. Make sure you are using residential proxies with Spain country targeting in the proxy configuration. Also verify the city name is spelled correctly.

**Can I scrape commercial properties?**
This scraper focuses on residential listings (viviendas). Commercial properties, garages, and storage units follow different URL patterns and may not be fully supported.

**Need a custom solution?**
If you need modifications or a custom scraper, open an issue on the [Issues tab](https://apify.com/jelledesramaults/fotocasa-scraper/issues) or contact the developer.

# Actor input Schema

## `searchQuery` (type: `string`):

City or location to search (e.g., 'Madrid', 'Barcelona', 'Valencia'). Uses Fotocasa's location-based URL routing.

## `listingType` (type: `string`):

Type of listing to search for.

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

Filter by property type. Leave as 'all' for all types.

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

Minimum price filter in EUR. Leave empty for no minimum.

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

Maximum price filter in EUR. Leave empty for no maximum.

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

Maximum number of listings to return.

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

Proxy settings. Residential proxies with Spain country targeting are strongly recommended for reliable results.

## Actor input object example

```json
{
  "searchQuery": "Madrid",
  "listingType": "sale",
  "propertyType": "all",
  "maxResults": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "ES"
  }
}
```

# 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 = {
    "searchQuery": "Madrid",
    "maxResults": 20,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "ES"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("studio-amba/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 = {
    "searchQuery": "Madrid",
    "maxResults": 20,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "ES",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("studio-amba/fotocasa-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searchQuery": "Madrid",
  "maxResults": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "ES"
  }
}' |
apify call studio-amba/fotocasa-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=studio-amba/fotocasa-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Fotocasa Scraper — Spain Real Estate Listings & Prices",
        "description": "Scrape real estate listings from fotocasa.es — Spain's leading property portal. Extract prices, photos, GPS coordinates, property details, and agency info for apartments, houses, and more. No login required.",
        "version": "0.1",
        "x-build-id": "BkmPGZjEHqmxC6Zid"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/studio-amba~fotocasa-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-studio-amba-fotocasa-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/studio-amba~fotocasa-scraper/runs": {
            "post": {
                "operationId": "runs-sync-studio-amba-fotocasa-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/studio-amba~fotocasa-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-studio-amba-fotocasa-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "searchQuery": {
                        "title": "Location / City",
                        "type": "string",
                        "description": "City or location to search (e.g., 'Madrid', 'Barcelona', 'Valencia'). Uses Fotocasa's location-based URL routing."
                    },
                    "listingType": {
                        "title": "Listing Type",
                        "enum": [
                            "sale",
                            "rent"
                        ],
                        "type": "string",
                        "description": "Type of listing to search for.",
                        "default": "sale"
                    },
                    "propertyType": {
                        "title": "Property Type",
                        "enum": [
                            "all",
                            "pisos",
                            "casas",
                            "chalets",
                            "aticos",
                            "duplex",
                            "estudios",
                            "lofts"
                        ],
                        "type": "string",
                        "description": "Filter by property type. Leave as 'all' for all types.",
                        "default": "all"
                    },
                    "minPrice": {
                        "title": "Minimum Price (EUR)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Minimum price filter in EUR. Leave empty for no minimum."
                    },
                    "maxPrice": {
                        "title": "Maximum Price (EUR)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum price filter in EUR. Leave empty for no maximum."
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Maximum number of listings to return.",
                        "default": 100
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Proxy settings. Residential proxies with Spain country targeting are strongly recommended for reliable results."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
