# Idealista Scraper: Spain Homes & Rooms for Sale or Rent (`nextgensda/idealista-listings`) Actor

Scrape idealista.com listings for many Spanish cities, districts and towns in one run: homes, new builds, rooms, offices, premises, garages, land and buildings, for sale or rent. Price, price drops, size, bedrooms, floor, agency, photos and links.

- **URL**: https://apify.com/nextgensda/idealista-listings.md
- **Developed by:** [Tauqeer Abbas](https://apify.com/nextgensda) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 searches

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

## Idealista Scraper: Spain Homes & Rooms for Sale or Rent

![Idealista Scraper: homes and rooms for sale or rent across Spain, with pay-per-event pricing on a balcony sign](https://api.apify.com/v2/key-value-stores/rnJnHhJ9gjLNLAt1f/records/banner.png?signature=11Yy97YUbYUjlXDhhLhTj)

Scrape **idealista.com listings for many places in Spain in one run**: homes,
new builds, rooms, offices, commercial premises, garages, land, storage rooms
and buildings, for sale or for rent. Every listing comes with its title,
address, district and coordinates, price (and the previous price after a
drop), size, price per m², bedrooms, bathrooms, floor, features, condition,
description, agency with its phone, photos and link.

### Why this scraper

- **Many searches per run.** List searches (place + filters), give places
  with one set of filters, or paste search URLs from idealista with any
  filters it offers.
- **Type place names as on idealista.** "Marbella", "Chamberí, Madrid",
  "Gràcia, Barcelona": they're matched to idealista's own locations.
- **Every property type**, for sale or rent, in the same run.
- **Up to 2,500 listings per search**, every listing once, in idealista's
  order.
- **Rich records**: coordinates, district and neighbourhood, bathrooms,
  terrace, lift, pool, air conditioning, parking, condition, and the agency's
  phone number.
- **Fast and light.** No browser: 50 listings per request.
- **Pay only for results.** A search that finds nothing costs nothing.

### Input

| Field | What it does |
|---|---|
| **Searches** | One search per entry (examples below). Unset filters take the run-wide values. |
| **Locations** | Many places with the run-wide filters. |
| **Search URLs** | idealista.com search result URLs, with any filters the site offers. |
| **Operation** | Buy (for sale) or Rent. |
| **Property type** | Homes, new builds (sale), rooms (rent), offices, premises, garages, land, storage rooms, buildings. |
| **Min / Max price, Min / Max size, Min bedrooms, Sort** | Run-wide filters. Prices are EUR (per month for rent); bedrooms apply to homes. |
| **Max listings per search / in total** | Caps your cost. |
| **Proxy** | Keep the default (Apify residential, Spain), or your own `http://` or `socks5://` proxy URLs. |

A location is a city, town, district or neighbourhood as you'd type it on
idealista; add the city after a comma when the name is ambiguous
("Salamanca, Madrid" is the Madrid district, "Salamanca" the city). You can
also give idealista's own location path from a search URL (`madrid-madrid`,
`madrid/chamberi`, `marbella-malaga`).

#### Example: rentals in Madrid and family homes in Marbella

```json
{
  "searches": [
    {"location": "Chamberí, Madrid", "operation": "rent", "maxPrice": 2000},
    {"location": "Marbella", "operation": "sale", "minBedrooms": 3, "maxPrice": 900000}
  ],
  "maxItemsPerSearch": 300
}
```

#### Example: rooms to rent in many cities, newest first

```json
{
  "locations": ["Madrid", "Barcelona", "Valencia", "Sevilla"],
  "operation": "rent",
  "propertyType": "rooms",
  "sort": "newest",
  "maxItemsPerSearch": 200
}
```

#### Example: your own search URL

```json
{
  "startUrls": [{"url": "https://www.idealista.com/alquiler-viviendas/barcelona/gracia/con-terraza/"}]
}
```

### Output

One item per listing:

```json
{
  "id": "112767091",
  "url": "https://www.idealista.com/inmueble/112767091/",
  "title": "Piso en Calle de José Ortega y Gasset, Lista, Madrid",
  "propertyType": "flat",
  "propertySubtype": null,
  "operation": "rent",
  "price": 6700,
  "currency": "EUR",
  "pricePeriod": "month",
  "previousPrice": null,
  "priceDrop": null,
  "priceDropPercent": null,
  "pricePerM2": 45,
  "size": 150,
  "bedrooms": 3,
  "bathrooms": 2,
  "floor": "2",
  "exterior": true,
  "lift": true,
  "parking": false,
  "parkingIncluded": null,
  "terrace": false,
  "swimmingPool": false,
  "airConditioning": true,
  "garden": false,
  "storageRoom": false,
  "condition": "good",
  "newDevelopment": false,
  "address": "Piso en Calle de José Ortega y Gasset, Lista, Madrid",
  "neighborhood": "Lista",
  "district": "Barrio de Salamanca",
  "municipality": "Madrid",
  "province": "Madrid",
  "locationId": "0-EU-ES-28-07-001-079-04-005",
  "latitude": 40.429603,
  "longitude": -3.6784107,
  "exactAddress": false,
  "description": "Benjamín Cousiño Propiedades presenta un exclusivo piso de alquiler en la prestigiosa Call...",
  "tags": ["Lujo"],
  "agency": "Benjamín Cousiño propiedades",
  "contactName": "Benjamín Cousiño",
  "phone": "+34919385061",
  "advertiserType": "professional",
  "professional": true,
  "agencyUrl": "https://www.idealista.com/pro/benjamin-cousino-propiedades/",
  "externalReference": "BC-1675",
  "photos": 32,
  "image": "https://img4.idealista.com/s/v1/yLv6QcFaPGY...?Expires=1791525966&Signature=...",
  "images": ["https://img4.idealista.com/s/v1/yLv6QcFaPGY...?Expires=1791525966&Signature=...", "..."],
  "hasFloorPlan": true,
  "hasVirtualTour": false,
  "hasVideo": false,
  "highlighted": false,
  "search": "homes for rent in Salamanca, Madrid",
  "searchUrl": null,
  "searchIndex": 0
}
```

- `price` is in euros; `pricePeriod` is `month` for rentals; `pricePerM2`
  follows it (per month for rentals).
- `previousPrice`, `priceDrop` and `priceDropPercent` fill in when the price
  was lowered.
- `exactAddress` is false when the advertiser hides the exact address: the
  coordinates are then approximate.
- `agency`, `contactName` and `phone` are given for professional advertisers
  (agencies, developers); private advertisers' contact details are left out.
- **Photo links expire after about a day.** Download the photos you need
  during that time; `url` and `id` are permanent.

### Pricing

Pay per event, platform usage included:

| Event | Price |
|---|---|
| Run start | $0.005 |
| Search that returned listings | $0.001 per search |
| Listing | $0.80 per 1,000 |

Examples:

| Run | Cost |
|---|---|
| 1 search, 100 listings | about $0.09 |
| 4 searches, 200 listings each | about $0.65 |
| 10 searches, 2,500 each (25,000 listings) | about $20.02 |

A search with no listings is not charged, and the run stops at your
spending limit without charging for anything it didn't deliver.

### Tips

- **Keep the default proxy** (Apify residential, Spain). If idealista refuses
  an IP, the run moves to a new one and carries on where it stopped.
- **More than 2,500 results?** Split the search by district, property type or
  price range.
- **Market monitoring?** Schedule the same input daily and compare by `id`;
  `previousPrice` shows price drops.

### FAQ

**Which listings are included?** The ones idealista shows for your search, in
its order.

**Portugal or Italy?** Not yet: this Actor covers idealista.com (Spain).

**Can I run it on a schedule or through the API?** Yes, like any Apify Actor:
schedules, the Apify API, webhooks and integrations (Make, Zapier, Google
Sheets and others).

**Is it legal?** The Actor collects publicly shown listings; it doesn't log
in, and it leaves out private advertisers' contact details. You are
responsible for using the data in line with idealista's terms and the privacy
laws that apply to you.

# Actor input Schema

## `searches` (type: `array`):

One search per entry: <code>{"location": "Chamberí, Madrid", "operation": "rent"}</code>. Optional per search: <code>operation</code> (sale, rent), <code>propertyType</code>, <code>minPrice</code>, <code>maxPrice</code>, <code>minSize</code>, <code>maxSize</code>, <code>minBedrooms</code>, <code>sort</code>; unset ones take the run-wide filters below. A location is a city, town, district or neighbourhood in Spain as you'd type it on idealista ("Marbella", "Gràcia, Barcelona"), or idealista's own path from a search URL ("madrid-madrid", "madrid/chamberi").

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

Shortcut for many locations with the filters below.

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

idealista.com search result URLs, with any filters the site offers (e.g. https://www.idealista.com/alquiler-viviendas/barcelona/gracia/con-terraza/).

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

Listings for sale or for rent.

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

What to search for.

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

EUR (per month for rent).

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

EUR (per month for rent).

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

At least this many square metres.

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

At most this many square metres.

## `minBedrooms` (type: `integer`):

Homes only: at least this many bedrooms (4 = four or more).

## `sort` (type: `string`):

Order of the results.

## `maxItemsPerSearch` (type: `integer`):

idealista serves up to 2,500 per search (50 pages of 50). Split a big area into districts, or use price ranges, to get more.

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

The run stops after this many listings.

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

Spanish residential proxies are recommended. Custom proxy URLs can be http:// or socks5:// (socks5://user:pass@host:port); several URLs rotate when idealista refuses one.

## Actor input object example

```json
{
  "searches": [
    {
      "location": "Chamberí, Madrid",
      "operation": "rent"
    },
    {
      "location": "Marbella",
      "operation": "sale",
      "minBedrooms": 3,
      "maxPrice": 900000
    }
  ],
  "operation": "sale",
  "propertyType": "homes",
  "sort": "relevance",
  "maxItemsPerSearch": 150,
  "maxItems": 1000,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "ES"
  }
}
```

# Actor output Schema

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

One row per listing: photo, title, price, size, bedrooms, floor, agency and link.

## `allFields` (type: `string`):

Every field of every item, including the description, price drops, tags and all photos.

# 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 = {
    "searches": [
        {
            "location": "Chamberí, Madrid",
            "operation": "rent"
        },
        {
            "location": "Marbella",
            "operation": "sale",
            "minBedrooms": 3,
            "maxPrice": 900000
        }
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "ES"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("nextgensda/idealista-listings").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 = {
    "searches": [
        {
            "location": "Chamberí, Madrid",
            "operation": "rent",
        },
        {
            "location": "Marbella",
            "operation": "sale",
            "minBedrooms": 3,
            "maxPrice": 900000,
        },
    ],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "ES",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("nextgensda/idealista-listings").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 '{
  "searches": [
    {
      "location": "Chamberí, Madrid",
      "operation": "rent"
    },
    {
      "location": "Marbella",
      "operation": "sale",
      "minBedrooms": 3,
      "maxPrice": 900000
    }
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "ES"
  }
}' |
apify call nextgensda/idealista-listings --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nextgensda/idealista-listings"
        }
    }
}
```

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/N3rqnpp7oVlUhtpzT/builds/qJ84G3HBmhujbvPjf/openapi.json
