# Fotocasa Scraper (`jooah-code/fotocasa-es-scraper`) Actor

\[💰$1 / 1K] ⚡ Fast, cheap Fotocasa scraper for Spain property listings. No login, no API key. Homes, rooms, garages, offices and land for sale or rent by location or search/listing URL. Get price, rooms, m², floor, energy rating, amenities, GPS, photos and agency phone.

- **URL**: https://apify.com/jooah-code/fotocasa-es-scraper.md
- **Developed by:** [jooah code](https://apify.com/jooah-code) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 1,000 results

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

![Fotocasa Scraper](https://i.ibb.co/TjVRkcX/fotocasa-es-banner.png)

> Scrape Spanish property listings for sale and rent from [Fotocasa](https://www.fotocasa.es/) and download them as JSON, CSV, Excel, or HTML. No account or login required.

### What does Fotocasa Scraper do?

**Fotocasa Scraper** turns Fotocasa property listings into a clean, structured dataset. Paste a Fotocasa search or listing URL, or simply type a location like "Valencia" and pick your filters, and you get the price, bedrooms, bathrooms, size, floor, energy rating, amenities, full address with GPS coordinates, photos, and the advertiser's name and phone number for each property.

[Fotocasa](https://www.fotocasa.es/) is a major Spanish real estate portal where agencies and private owners advertise homes, rooms, garages, offices, shops, and land, both for sale and for rent. Its listings show what sellers and landlords are asking across Spanish cities and neighborhoods. The scraper collects the same public details you see in your browser, so you can run it once, put it on a schedule, or plug it into your own tools.

### Features

- **Locations or URLs**: type a city, district, or neighborhood, or paste any Fotocasa search page or single listing.
- **Keeps your filters**: price, bedrooms, size, and sort order set on the website stay in the results.
- **Built-in filters for locations**: choose operation, property type, price, bedrooms, bathrooms, size, and sort order without building a URL.
- **Full details in one run**: floor, energy certificate, amenities, and advertiser phone are included by default.
- **Clean data**: prices and sizes are numbers, dates follow one standard format, and text has no HTML.
- **Small, cheap runs**: set a result limit per URL or location and pay only for what you need.
- **Automation ready**: schedule runs, export to Google Sheets, or connect to Make, Zapier, and n8n.

### Data fields

1. **Listing**: `url`, `id`, `title`, `transactionType`, `propertyType`, `propertySubtype`, `description`, `reference`, `publishedAt`
2. **Price**: `price`, `priceCurrency`, `pricePeriod`, `priceDrop`
3. **Size and layout**: `rooms`, `bathrooms`, `size`, `floor`, `orientation`
4. **Building and condition**: `condition`, `buildingAge`, `heating`, `hotWater`, `constructionType`, `isNewConstruction`
5. **Energy certificate**: `energyRating`, `energyConsumption`, `emissionsRating`, `emissionsValue`
6. **Amenities**: `amenities`
7. **Location**: `street`, `neighborhood`, `district`, `city`, `province`, `region`, `zipCode`, `country`, `latitude`, `longitude`
8. **Media**: `images`, `imageCount`, `hasVideo`, `hasVirtualTour`, `hasFloorPlans`
9. **Occupancy and sale status**: `occupancyStatus`, `isBareOwnership`, `isOccupied`, `isAuctioned`, `isRentedWithTenants`, `isTemporaryRental`
10. **Advertiser**: `advertiserName`, `advertiserId`, `advertiserType`, `advertiserPhone`, `advertiserUrl`, `advertiserLogo`

### Who uses this Fotocasa scraper?

- **Real estate analysts** follow asking prices, rents, and price per square meter by city or neighborhood.
- **Investors** look for price drops, auctions, and properties sold with tenants in place.
- **Sales teams** build contact lists of real estate agencies with their phone numbers and active listings.
- **Property platforms** keep their own catalog of Spanish properties with photos and map coordinates.
- **Data and AI teams** load ready-to-use listing data into spreadsheets, dashboards, or AI workflows.

### How to use Fotocasa Scraper

**Step 1.** Paste one or more Fotocasa URLs into **Start URLs**, or type places into **Locations** and set the filters you need.

**Step 2.** Set **Maximum number of results** to how many listings you want per URL or per location.

**Step 3.** Click **Start** and wait for the run to finish.

**Step 4.** Download the data in JSON, CSV, Excel, or HTML from the **Output** tab.

### Input parameters

- `startUrls` (**Start URLs**): Fotocasa URLs to scrape. Supported pages: search result pages (any location, operation, and property type) and single listing pages. Filters applied on the website are kept, and a search page opened at a later page number continues from there.
- `searchQueries` (**Locations**): places to search, one per line, such as a city, province, district, or neighborhood ("Barcelona", "Málaga", "Chamberí"). Each location is scraped separately.
- `operation` (**Operation**): buy, rent, share, or transfer. Default: buy. Used for locations only.
- `propertyType` (**Property type**): homes, garages, commercial premises, offices, land, storage rooms, or buildings. Default: homes. Used for locations only.
- `minPrice` (**Minimum price (€)**) and `maxPrice` (**Maximum price (€)**): price range in euros. Used for locations only.
- `minRooms` (**Minimum bedrooms**) and `maxRooms` (**Maximum bedrooms**): bedroom range. Used for locations only.
- `minBathrooms` (**Minimum bathrooms**): lowest number of bathrooms. Used for locations only.
- `minSize` (**Minimum size (m²)**) and `maxSize` (**Maximum size (m²)**): surface range in square meters. Used for locations only.
- `sortBy` (**Sort by**): relevance, newest first, price low to high or high to low, size large to small or small to large. Default: relevance. Used for locations only.
- `includeDetails` (**Include full listing details**): on by default. Opens each listing to add the title, floor, orientation, condition, building age, heating, energy certificate, reference, street, and all amenities. Turn it off for a quicker run with only the data shown in search results.
- `maxResults` (**Maximum number of results**): how many listings to collect for each start URL or location. Default: 5. Set 0 for no limit.

Start URLs and locations can be combined in one run.

### Example input

#### Scrape a Fotocasa search page

```json
{
  "startUrls": [
    {
      "url": "https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l"
    }
  ],
  "includeDetails": true,
  "maxResults": 5
}
```

#### Search by location

```json
{
  "searchQueries": ["Barcelona"],
  "operation": "buy",
  "propertyType": "homes",
  "sortBy": "relevance",
  "includeDetails": true,
  "maxResults": 5
}
```

### Sample output

Every listing becomes one dataset item, for example:

```json
{
  "url": "https://www.fotocasa.es/es/comprar/vivienda/madrid-capital/calefaccion-ascensor-no-amueblado/191011544/d",
  "id": "191011544",
  "title": "Piso en venta en Avenida de la Reina Victoria",
  "transactionType": "Sale",
  "propertyType": "Home",
  "propertySubtype": "Flat",
  "price": 1095000,
  "priceCurrency": "EUR",
  "pricePeriod": null,
  "priceDrop": null,
  "rooms": 3,
  "bathrooms": 2,
  "size": 149,
  "floor": "5th floor",
  "orientation": "Northwest",
  "condition": "Good",
  "buildingAge": "Between 70 and 100 years",
  "heating": "Gas natural",
  "hotWater": "Gas natural",
  "constructionType": "Second hand",
  "occupancyStatus": "Rented",
  "energyRating": "G",
  "energyConsumption": 999,
  "emissionsRating": "G",
  "emissionsValue": 999,
  "amenities": [
    "Porter service",
    "Armored door",
    "Equipped kitchen",
    "Heating",
    "Elevator",
    "Not furnished"
  ],
  "description": "Madecasa vende este magnífico piso en la misma Avda. de Reina Victoria, una quinta planta exterior, con ascensor y portería. Destaca la fantástica luz...",
  "street": "Avenida de la Reina Victoria",
  "neighborhood": "Vallehermoso",
  "district": "Chamberí",
  "city": "Madrid",
  "province": "Madrid",
  "region": "Madrid",
  "zipCode": "28003",
  "country": "España",
  "latitude": 40.446457695319815,
  "longitude": -3.711298097655455,
  "images": [
    "https://static.fotocasa.es/images/ads/87863f85-ec88-45c5-8f33-8e6a1b842639?rule=original",
    "https://static.fotocasa.es/images/ads/125cd231-4fb5-45d2-8914-bce1d4c9b8fc?rule=original"
  ],
  "imageCount": 20,
  "hasVideo": false,
  "hasVirtualTour": false,
  "hasFloorPlans": false,
  "isNewConstruction": false,
  "isBareOwnership": false,
  "isOccupied": false,
  "isAuctioned": false,
  "isRentedWithTenants": true,
  "isTemporaryRental": false,
  "reference": "p1830",
  "advertiserName": "MADECASA ASESORES INMOBILIARIOS",
  "advertiserId": "500180115652",
  "advertiserType": "Professional",
  "advertiserPhone": "+34917992080",
  "advertiserUrl": "https://www.fotocasa.es/es/pro/madecasa-asesores-inmobiliarios/",
  "advertiserLogo": "https://static.fotocasa.es/images/client/8eacaab9-ae47-4704-ba25-b89c35fb8cb8/20250906092230?rule=original",
  "publishedAt": "2026-10-03T10:41:43.233Z"
}
```

Export the dataset as JSON, CSV, Excel, XML, or HTML, or read it through the Apify API.

### Good to know

- Only Fotocasa search result pages and single listing pages are supported; any other URL is skipped.
- A location that Fotocasa does not recognize is skipped, and the log shows a warning.
- The location filters (operation, property type, price, bedrooms, bathrooms, size, sort order) do not change start URLs; those keep the filters already in the URL.
- When **Include full listing details** is off, the title, floor, orientation, condition, building age, heating, hot water, construction type, occupancy status, energy certificate, street, and reference come back as `null`.
- Titles and descriptions stay in Spanish, as the advertiser wrote them. Listings opened from a page in another language (for example `/en/`) keep that language in their URL.
- Every search page shows one promoted listing; it is saved only once and never counted twice.
- Some advertisers hide the exact address, phone number, or energy certificate, so those fields are `null` for their listings.
- Listings already removed from Fotocasa are skipped.

### Frequently asked questions

**How many results can I scrape?**

Any number you set in **Maximum number of results**, or 0 for no limit. The scraper stops at your limit or at the last page of the search. For bigger datasets, split a broad search by city, district, or price range.

**Do I need a Fotocasa account?**

No. Only public listing data is collected, so you do not need to log in or share any account details.

**Can I run it on a schedule?**

Yes. Apify Schedules can run it every hour, day, or week, so new listings arrive automatically.

**Why are some fields empty?**

Not every listing shows every detail. A field that is missing on the website is returned as `null`.

**Can you add a new filter or input?**

Yes. The scraper supports start URLs, locations, and the filters above today. Other inputs, such as publication date or specific amenities, can be added on request.

**Can I get a custom or private version?**

Yes. It can be adapted to your workflow, delivered as a private version, or a new scraper can be built for another website. See the contact details below.

### Support and custom scrapers

Need another field, a private version, or a scraper for a different website? Get in touch:

- Email: jooah.code@gmail.com
- Apify profile: [joaah-code](https://apify.com/joaah-code)

### Image credit

Banner: screenshot of [Fotocasa](https://www.fotocasa.es/).

# Actor input Schema

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

Fotocasa URLs: search results pages (any location, property type and filters set on the website) or single listing pages.

## `searchQueries` (type: `array`):

Locations to search, e.g. "Valencia", "Málaga", "Chamberí" or "Ibiza". Each location is scraped separately with the filters below.

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

Listings for sale, for rent, rooms to share or business transfers. Applies to locations only; start URLs keep their own filters.

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

Type of property. Applies to locations only.

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

Only listings with at least this price. Applies to locations only.

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

Only listings up to this price. Applies to locations only.

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

Only listings with at least this many bedrooms. Applies to locations only.

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

Only listings with at most this many bedrooms. Applies to locations only.

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

Only listings with at least this many bathrooms. Applies to locations only.

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

Only listings with at least this surface in square meters. Applies to locations only.

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

Only listings up to this surface in square meters. Applies to locations only.

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

Order of the results. Applies to locations only.

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

Open every listing to add the title, floor, orientation, condition, building age, heating, energy certificate, reference and full amenities. Turn off for a faster run with the data shown in search results.

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

Maximum number of listings to scrape per start URL or location. Set 0 for no limit.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l"
    }
  ],
  "searchQueries": [
    "Barcelona"
  ],
  "operation": "buy",
  "propertyType": "homes",
  "sortBy": "relevance",
  "includeDetails": true,
  "maxResults": 5
}
```

# Actor output Schema

## `overview` (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 = {
    "startUrls": [
        {
            "url": "https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l"
        }
    ],
    "searchQueries": [
        "Barcelona"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("jooah-code/fotocasa-es-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 = {
    "startUrls": [{ "url": "https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l" }],
    "searchQueries": ["Barcelona"],
}

# Run the Actor and wait for it to finish
run = client.actor("jooah-code/fotocasa-es-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 '{
  "startUrls": [
    {
      "url": "https://www.fotocasa.es/es/comprar/viviendas/madrid-capital/todas-las-zonas/l"
    }
  ],
  "searchQueries": [
    "Barcelona"
  ]
}' |
apify call jooah-code/fotocasa-es-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jooah-code/fotocasa-es-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/RFtS7ZJghnhBopLVh/builds/S1POVKhK6KWHLKqVs/openapi.json
