# Idealista Agency Lead Extractor (`axlymxp/idealista-agency-lead-extractor`) Actor

Build a lead list of real estate agencies on Idealista (Spain, Portugal, Italy): agency name, phones, contact names, listing counts and price ranges per area. No login. Pay only for results.

- **URL**: https://apify.com/axlymxp/idealista-agency-lead-extractor.md
- **Developed by:** [axly](https://apify.com/axlymxp) (community)
- **Categories:** Lead generation, Real estate
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 dataset items

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 Agency Lead Extractor

Build a lead list of **real estate agencies on Idealista** (Spain, Portugal and Italy). Give it the cities you care about and get one row per agency: business name, phone numbers, contact names, how many listings it has in that area, sale and rent price ranges, property types and the Idealista microsite. No Idealista login or API key.

Agencies are found from the live Idealista listings of the area you choose, most active agencies first, so the list reflects who is actually advertising right now.

### What you get

One row per agency:

| Field | Description |
| --- | --- |
| `agency_name`, `agency_id` | Business name and a stable id (the Idealista microsite name) |
| `phones`, `phones_international` | Business phone numbers shown on the agency's ads (national format and `+34...` format) |
| `contact_names` | Contact or agent names shown on the ads |
| `microsite_name`, `microsite_url` | The agency's Idealista microsite name, and its address built from it |
| `logo_url` | Agency logo, when it has one |
| `listings_seen` | How many of the agency's listings were found in the area and listing types you searched |
| `sale_listings`, `rent_listings` | Split by sale and rent |
| `sale_price_min / median / max`, `rent_price_min / median / max` | Price ranges of those listings (euros) |
| `property_types`, `provinces`, `municipalities` | What it lists and where |
| `new_development_listings` | Listings that are new developments |
| `sample_listing_urls` | A few of its listings |
| `searched_locations`, `country`, `scraped_at` | Context |

`listings_seen` counts the listings found in your search, not the agency's total stock on Idealista.

### Use cases

- **B2B sales to agencies**: CRM, website, photography, virtual-tour, staging, mortgage or insurance vendors who need a list of agencies with a phone number.
- **Market mapping**: which agencies are active in a district, how big they are and which price segment they sell.
- **Competitor tracking**: new agencies appearing in your area, and their stock.
- **Partnerships and recruiting**: find agencies that cover a niche such as new developments or rentals.

### Input

| Parameter | What it does |
| --- | --- |
| `country` | `es` (Spain), `pt` (Portugal) or `it` (Italy) |
| `locations` | Place names such as `Madrid`, `Barcelona`, `Lisboa`, `Milano`. Each is matched to Idealista's best location |
| `locationIds` | Exact Idealista location ids, if a name resolves to the wrong area |
| `operation` | `both`, `sale` or `rent` |
| `propertyType` | `homes`, `offices`, `premises`, `garages`, `land` or `all` |
| `maxAgencies` | Stop after this many agencies (1-5,000) |
| `minListings` | Only agencies with at least this many listings in the search |
| `proxyConfiguration` | Residential proxy, used only when Idealista briefly blocks an IP |

#### Example input

```json
{
    "country": "es",
    "locations": ["Valencia", "Alicante"],
    "operation": "both",
    "propertyType": "homes",
    "maxAgencies": 200,
    "minListings": 2
}
```

#### Example output

```json
{
    "agency_id": "apropertiesbarcelona",
    "agency_name": "aProperties Real Estate Barcelona",
    "phones": ["936 17 40 47"],
    "phones_international": ["+34936174047"],
    "microsite_url": "https://www.idealista.com/pro/apropertiesbarcelona/",
    "listings_seen": 253,
    "sale_listings": 253,
    "rent_listings": 0,
    "sale_price_min": 169000,
    "sale_price_median": 750000,
    "sale_price_max": 4400000,
    "municipalities": ["Barcelona"]
}
```

(Values from a real run; some fields shortened.)

### Scheduling

Run it weekly for the same places to spot new agencies and growing stock, and connect a webhook, Zapier, Make or Google Sheets to receive the rows.

### FAQ

**Do I need an Idealista account?** No.

**Does it include private sellers?** No. Private owners are skipped on purpose; only professional agencies are returned.

**How many agencies can I get?** A large city has hundreds. The actor reads the most active agencies first and, when you ask for more than one search slice holds, splits the area by price to dig deeper.

**Is the `microsite_url` always reachable?** It is built from the agency's microsite name. Idealista may ask for a browser check when you open it.

**Is this legal to use?** The actor reads publicly visible advertising data. Agency names and business phone numbers are business contact data; you are responsible for how you use them, including marketing and data-protection rules such as GDPR and anti-spam law in the countries you contact.

# Actor input Schema

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

Idealista site to search.

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

City, district or province names, for example Madrid, Barcelona, Valencia. Each name is matched to Idealista's best location. Use 'Location IDs' for an exact area.

## `locationIds` (type: `array`):

Exact Idealista location ids such as 0-EU-ES-28-07-001-079, for when a place name resolves to the wrong area.

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

Which listings to read agencies from.

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

Which kind of listings to read agencies from. 'All types' reads each type in turn.

## `maxAgencies` (type: `integer`):

Stop after this many agencies (most active first).

## `minListings` (type: `integer`):

Only return agencies with at least this many listings in the area you searched. Raise it to keep larger agencies only.

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

Idealista sometimes blocks cloud IPs for a short while. The actor runs without a proxy and switches to a fresh Residential IP only when that happens.

## Actor input object example

```json
{
  "country": "es",
  "locations": [
    "Valencia"
  ],
  "locationIds": [],
  "operation": "both",
  "propertyType": "homes",
  "maxAgencies": 50,
  "minListings": 1,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# 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 = {
    "country": "es",
    "locations": [
        "Valencia"
    ],
    "locationIds": [],
    "operation": "both",
    "propertyType": "homes",
    "maxAgencies": 50,
    "minListings": 1,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("axlymxp/idealista-agency-lead-extractor").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 = {
    "country": "es",
    "locations": ["Valencia"],
    "locationIds": [],
    "operation": "both",
    "propertyType": "homes",
    "maxAgencies": 50,
    "minListings": 1,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("axlymxp/idealista-agency-lead-extractor").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 '{
  "country": "es",
  "locations": [
    "Valencia"
  ],
  "locationIds": [],
  "operation": "both",
  "propertyType": "homes",
  "maxAgencies": 50,
  "minListings": 1,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call axlymxp/idealista-agency-lead-extractor --silent --output-dataset

```

## MCP server setup

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

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/NZMxHItdFShPuguUs/builds/wVpSzH6JFDPdshJHd/openapi.json
