# Idealista Scraper (`one-api/idealista-scraper`) Actor

Scrape Idealista property listings across Spain, Italy, and Portugal. Look up properties by adId or URL, search by location name, ZIP, coordinates, polygon, or Idealista URL, and pull agency profiles + the geographies they list in.

- **URL**: https://apify.com/one-api/idealista-scraper.md
- **Developed by:** [ONE API](https://apify.com/one-api) (community)
- **Categories:** Lead generation, Real estate
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 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.

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

## 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

## Idealista Scraper

Scrape Idealista property listings across **Spain, Italy, and Portugal**. Look up properties by adId or URL, search by location name, ZIP, coordinates, polygon, or Idealista URL, and pull full agency profiles plus the geographies they list in.

### What it does

- **Property Details** — auto-detects each input as `adId` (digits) or `idealista.com` URL; returns the full record (price, beds/baths, size, photos, agent contact, energy rating, multimedia URLs).
- **5 search modes** — by location name, ZIP, coordinates, polygon, or Idealista URL. Country, operation (sale / rent / share), property type, price/beds/size filters all apply.
- **Agency profiles** — for each microsite shortName: one row with `/agent/details` (commercial name, phone, address, totals) plus one row per province / municipality the agency lists in, via `/agent/locations`.

### Output

- **One flat dataset row per listing** / agent / agent-location — sortable, filterable, CSV-exportable.
- Columns: `Mode`, `Country`, `Property ID`, `URL`, `Address`, `City`, `District`, `Neighborhood`, `Price`, `Currency`, `Beds`, `Baths`, `Size m²`, `PropertyType`, `Operation`, `Latitude`, `Longitude`, `Cover Photo`, `Listing URL`.
- Full upstream JSON kept in the `Raw` column for power users.

### Inputs

- Each section is independent — fill only the ones you need.
- Multiple inputs per section: one per line.
- Country / operation / propertyType / price-bed-size filters apply to every search and every agency call.

### Pricing

- Pay per result: **$3 per 1,000 dataset items** — same rate on every Apify plan tier.
- Apify start fee: $0.00005 per run.

### Notes

- Idealista caps each search page at ~50 results — increase `pages` to fetch more.
- `/agent/locations` uses the **operation + propertyType filter** above to scope which geographies the agency lists in (e.g. "where does this agency list homes for sale?").
- Spain, Italy, and Portugal each have their own `idealista.com` / `.it` / `.pt` site — set `country` accordingly.

### Errors

- Failures land in the dataset as rows with `Mode = "ERROR"` and the upstream error message in `Agent Name` — nothing is silently dropped.

# Actor input Schema

## `property_inputs` (type: `array`):

Auto-detects each entry and calls the right endpoint:
• Digits only (e.g. `106387165`) → `/details/byid`
• `https://www.idealista.com/...` (or `.it` / `.pt`) → `/details/byurl`

Each row in the dataset = one full property record (address, price, beds/baths, size, photos, agent contact).
## `search_inputs` (type: `array`):

Auto-detects each entry and routes to the right `/search/*` endpoint:
• `https://www.idealista.com/...` → `/search/byurl`
• 5-digit ZIP (e.g. `28001`) → `/search/byzip`
• `lat,lng` or `lat,lng,radius` (e.g. `40.4168,-3.7038,2`) → `/search/bycoordinates`
• `lng lat,lng lat,...` (≥4 vertices, space-separated pair, comma-delimited list) → `/search/bypolygon`
• Anything else (city / region name, e.g. `Madrid`) → `/search/bylocation`

Filters below apply to every search call. Each hit returns one row per listing.
## `agency_shortnames` (type: `array`):

Idealista agency microsite shortNames (e.g. `walterhauschamberi`). For each shortName the actor fetches `/agent/details` (one summary row) plus `/agent/locations` (one row per province / municipality the agency lists in).
## `country` (type: `string`):

Idealista marketplace. Spain (`es`), Italy (`it`), or Portugal (`pt`).
## `searchType` (type: `string`):

What kind of listings to fetch in `/search/*`.
## `propertyType` (type: `string`):

Which Idealista typology to search.
## `priceRange` (type: `string`):

Format: `min:200000,max:600000` — or just `min:200000` / `max:600000`.
## `bedsRange` (type: `string`):

Format: `min:1,max:3`. Studio = `0`.
## `sqftRange` (type: `string`):

Format: `min:60,max:120`.
## `pages` (type: `integer`):

How many pages to fetch for each `/search/*` query.
## `resultCount` (type: `integer`):

Idealista caps each search page at ~50 results.

## Actor input object example

```json
{
  "property_inputs": [
    "106387165",
    "https://www.idealista.com/inmueble/106387165/"
  ],
  "search_inputs": [
    "Madrid",
    "Barcelona"
  ],
  "agency_shortnames": [],
  "country": "es",
  "searchType": "For_Sale",
  "propertyType": "homes",
  "priceRange": "",
  "bedsRange": "",
  "sqftRange": "",
  "pages": 1,
  "resultCount": 50
}
````

# 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 = {
    "property_inputs": [
        "106387165",
        "https://www.idealista.com/inmueble/106387165/"
    ],
    "search_inputs": [
        "Madrid",
        "Barcelona"
    ],
    "agency_shortnames": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("one-api/idealista-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 = {
    "property_inputs": [
        "106387165",
        "https://www.idealista.com/inmueble/106387165/",
    ],
    "search_inputs": [
        "Madrid",
        "Barcelona",
    ],
    "agency_shortnames": [],
}

# Run the Actor and wait for it to finish
run = client.actor("one-api/idealista-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 '{
  "property_inputs": [
    "106387165",
    "https://www.idealista.com/inmueble/106387165/"
  ],
  "search_inputs": [
    "Madrid",
    "Barcelona"
  ],
  "agency_shortnames": []
}' |
apify call one-api/idealista-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Idealista Scraper",
        "description": "Scrape Idealista property listings across Spain, Italy, and Portugal. Look up properties by adId or URL, search by location name, ZIP, coordinates, polygon, or Idealista URL, and pull agency profiles + the geographies they list in.",
        "version": "1.0",
        "x-build-id": "WMUuevaqvoRmbiOfR"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/one-api~idealista-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-one-api-idealista-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/one-api~idealista-scraper/runs": {
            "post": {
                "operationId": "runs-sync-one-api-idealista-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/one-api~idealista-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-one-api-idealista-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": {
                    "property_inputs": {
                        "title": "Property adId or Idealista URL (one per line)",
                        "type": "array",
                        "description": "Auto-detects each entry and calls the right endpoint:\n• Digits only (e.g. `106387165`) → `/details/byid`\n• `https://www.idealista.com/...` (or `.it` / `.pt`) → `/details/byurl`\n\nEach row in the dataset = one full property record (address, price, beds/baths, size, photos, agent contact).",
                        "items": {
                            "type": "string"
                        }
                    },
                    "search_inputs": {
                        "title": "Search query (one per line)",
                        "type": "array",
                        "description": "Auto-detects each entry and routes to the right `/search/*` endpoint:\n• `https://www.idealista.com/...` → `/search/byurl`\n• 5-digit ZIP (e.g. `28001`) → `/search/byzip`\n• `lat,lng` or `lat,lng,radius` (e.g. `40.4168,-3.7038,2`) → `/search/bycoordinates`\n• `lng lat,lng lat,...` (≥4 vertices, space-separated pair, comma-delimited list) → `/search/bypolygon`\n• Anything else (city / region name, e.g. `Madrid`) → `/search/bylocation`\n\nFilters below apply to every search call. Each hit returns one row per listing.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "agency_shortnames": {
                        "title": "Agency microsite shortName (one per line)",
                        "type": "array",
                        "description": "Idealista agency microsite shortNames (e.g. `walterhauschamberi`). For each shortName the actor fetches `/agent/details` (one summary row) plus `/agent/locations` (one row per province / municipality the agency lists in).",
                        "items": {
                            "type": "string"
                        }
                    },
                    "country": {
                        "title": "Country",
                        "enum": [
                            "es",
                            "it",
                            "pt"
                        ],
                        "type": "string",
                        "description": "Idealista marketplace. Spain (`es`), Italy (`it`), or Portugal (`pt`).",
                        "default": "es"
                    },
                    "searchType": {
                        "title": "Operation",
                        "enum": [
                            "For_Sale",
                            "For_Rent",
                            "For_Share"
                        ],
                        "type": "string",
                        "description": "What kind of listings to fetch in `/search/*`.",
                        "default": "For_Sale"
                    },
                    "propertyType": {
                        "title": "Property type",
                        "enum": [
                            "homes",
                            "offices",
                            "premises",
                            "garages",
                            "lands",
                            "storageRooms",
                            "buildings",
                            "newDevelopments"
                        ],
                        "type": "string",
                        "description": "Which Idealista typology to search.",
                        "default": "homes"
                    },
                    "priceRange": {
                        "title": "Price range (€)",
                        "type": "string",
                        "description": "Format: `min:200000,max:600000` — or just `min:200000` / `max:600000`.",
                        "default": ""
                    },
                    "bedsRange": {
                        "title": "Bed range",
                        "type": "string",
                        "description": "Format: `min:1,max:3`. Studio = `0`.",
                        "default": ""
                    },
                    "sqftRange": {
                        "title": "Size range (m²)",
                        "type": "string",
                        "description": "Format: `min:60,max:120`.",
                        "default": ""
                    },
                    "pages": {
                        "title": "Pages per search",
                        "minimum": 1,
                        "maximum": 50,
                        "type": "integer",
                        "description": "How many pages to fetch for each `/search/*` query.",
                        "default": 1
                    },
                    "resultCount": {
                        "title": "Results per page",
                        "minimum": 1,
                        "maximum": 200,
                        "type": "integer",
                        "description": "Idealista caps each search page at ~50 results.",
                        "default": 50
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
