# Idealista Location ID Finder: Areas, IDs & Listing Counts (`axlymxp/idealista-location-scraper`) Actor

Find Idealista location IDs by place name or prefix in Spain, Italy and Portugal. Returns each area's locationId, name, level (province, municipality, district, neighbourhood) and active listing count, ready to feed into other Idealista actors. No login.

- **URL**: https://apify.com/axlymxp/idealista-location-scraper.md
- **Developed by:** [axly](https://apify.com/axlymxp) (community)
- **Categories:** Real estate, Developer tools
- **Security:** Limited permissions
- **Stats:** 85 total users, 0 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 dataset items

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 Location ID Finder

Turn place names into **Idealista location IDs**. Type a city, district or just the first letters of a name and get back the matching areas in Spain, Italy or Portugal: the `locationId`, the area level (province, municipality, district, neighbourhood) and how many listings are active there right now.

This actor does not return property listings. It is the lookup step you run first, so that a listing scraper can search an exact area instead of guessing from a text name.

### What you get

| Field | Description |
| --- | --- |
| `locationId` | Idealista location ID, e.g. `0-EU-ES-28-07-001-079` |
| `name` | Area name, with the parent town for districts and neighbourhoods |
| `level` | Area level in Idealista's wording (Provincia, Municipio, Distrito, Barrio ...) |
| `divisible` | Whether the area splits into sub-areas |
| `suggestedLocationId` | Numeric id used in Idealista's suggestion list |
| `activeListings` | Active listings in the area for the chosen property type and operation at run time |
| `query`, `country`, `propertyType`, `operation` | What was searched |

### Use cases

- Feed exact `locationId` values into other Idealista scrapers.
- Rank areas by number of active listings to see where supply is.
- List every district or neighbourhood whose name starts with a prefix.
- Check how deep the market is for rent versus sale, or homes versus offices.

### Input

- `prefixes`: place names or name prefixes (each returns up to 10 areas).
- `country`: `es`, `it` or `pt`.
- `propertyType`: homes, offices, premises, garages, new developments, land, storage rooms, buildings.
- `operation`: sale or rent.
- `proxyConfiguration`: optional; normally not needed.

```json
{
  "prefixes": ["Barcelona", "Sevilla"],
  "country": "es",
  "propertyType": "homes",
  "operation": "sale"
}
```

### Example output

```json
{
  "locationId": "0-EU-ES-08-13-001-019",
  "name": "Barcelona, Barcelona",
  "level": "Municipio",
  "divisible": true,
  "suggestedLocationId": 25309,
  "activeListings": 13180,
  "query": "Barcelona",
  "country": "es",
  "propertyType": "homes",
  "operation": "sale"
}
```

### Scheduling

Run it on a schedule and compare `activeListings` between runs to track how supply in an area changes. Results are available through the Apify API, webhooks and integrations.

### FAQ

**Does it return listings or prices?** No, only areas and listing counts. Use a listing scraper with the returned IDs.

**Why only 10 areas per query?** The lookup returns the 10 best matches for each text. Use a more specific name or several prefixes to reach others.

**Does it need a login or proxy?** No. A proxy option exists in case the site temporarily blocks the run's IP.

**Why is a count different from the website?** Counts are a live snapshot and change as listings are added or removed.

# Actor input Schema

## `prefixes` (type: `array`):

One or more place names or the first letters of a name, for example Barcelona, Sant or Costa. Each entry returns up to 10 matching areas. (The older single 'prefix' field is still accepted through the API.)

## `country` (type: `string`):

Idealista site to search.

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

Property type the active-listing counts refer to.

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

Operation the active-listing counts refer to.

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

Optional. Normally not needed. If Idealista soft-blocks the run's IP, enable Apify Proxy and the actor rotates the exit.

## Actor input object example

```json
{
  "prefixes": [
    "Barcelona",
    "Sevilla"
  ],
  "country": "es",
  "propertyType": "homes",
  "operation": "sale",
  "proxyConfiguration": {}
}
```

# Actor output Schema

## `results` (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 = {
    "prefixes": [
        "Barcelona",
        "Sevilla"
    ],
    "country": "es",
    "propertyType": "homes",
    "operation": "sale"
};

// Run the Actor and wait for it to finish
const run = await client.actor("axlymxp/idealista-location-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 = {
    "prefixes": [
        "Barcelona",
        "Sevilla",
    ],
    "country": "es",
    "propertyType": "homes",
    "operation": "sale",
}

# Run the Actor and wait for it to finish
run = client.actor("axlymxp/idealista-location-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 '{
  "prefixes": [
    "Barcelona",
    "Sevilla"
  ],
  "country": "es",
  "propertyType": "homes",
  "operation": "sale"
}' |
apify call axlymxp/idealista-location-scraper --silent --output-dataset

```

## MCP server setup

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