# Idealista Rental Yield Finder - Spain, Portugal, Italy (`amitaviv/idealista-rental-yield-finder`) Actor

Gross rental yield and market stats per area and per district from live idealista sale and rent listings (Spain, Portugal, Italy): median and quartile price per m², asking price and rent, yield by rooms, price drops, new listings. Comparison sorted by yield. $0.05 per area report.

- **URL**: https://apify.com/amitaviv/idealista-rental-yield-finder.md
- **Developed by:** [Amit Aviv](https://apify.com/amitaviv) (community)
- **Categories:** Real estate, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $40.00 / 1,000 area reports

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

## Idealista Rental Yield Finder - Spain, Portugal, Italy

Gross rental yield and market statistics for any area of idealista.com, idealista.pt or idealista.it: give an area (a search URL or a location slug) and get one report with the median price per m² for sale and for rent, quartiles, median asking price and rent, gross yield, the same split by rooms, price drops and new listings, computed from the live sale and rent listings of that area. You pay per report delivered, and a run that delivers nothing because of an error ends as Failed, never as a green empty run.

### What you get

- **One report per area**, and optionally one per sub-area (a city's districts, a district's neighbourhoods, a Portuguese municipality's parishes): the comparison investors want, in one run.
- **Yield**: gross rental yield `12 × median rent per m² ÷ median sale price per m²` and the price-to-rent ratio in years.
- **Sale and rent side each**: number of listings, median, 25th and 75th percentile of the asking price and of the price per m², median size, share of listings with a price drop and the median drop in %, listings published in the last 7 days (count and share), share of private sellers / landlords (a percentage only, no names).
- **By rooms** (0-1, 2, 3, 4+): sample size, median price, median price per m² and yield for each band.
- **Rentals**: long-term lets only by default (idealista's own filter); the report also gives the number of rentals of every kind and the share of seasonal / temporary lets.
- **Honesty fields**: `saleSampled` / `rentSampled`, `saleSampleSize` / `rentSampleSize`, `lowSample`, a `method` sentence saying how many listings were read, and `warnings`.
- A **comparison table** of all areas of the run sorted by yield, with `lowSample` areas last (`COMPARISON` in the run's key-value store), and a run summary (`OUTPUT_SUMMARY`): what was requested, delivered and charged, pages read per area, inputs that failed or were ignored, why the run stopped.

What it does not return: individual listings, addresses, photos, contact data or any personal data (only aggregated figures), rental yields net of costs, sold prices (idealista shows asking prices), anything behind a login.

### How to use

1. Open idealista, search homes for sale or for rent in the area you want (a city, district or neighbourhood, optionally with filters such as flats only or 2 bedrooms), and copy the URL. Or type a slug such as `madrid-madrid`, `madrid/centro`, `pt:lisboa`, `it:milano-milano`.
2. Paste it into **Areas**. Several areas are fine; each gets its own report.
3. Turn on **Also report every sub-area** to get one report per district or neighbourhood.
4. Press Start. Download the reports from the Output tab (JSON, CSV, Excel) or open the comparison table.

### Input

| Field | Type | Default | What it does |
|---|---|---|---|
| `areas` | list of text | none (required) | idealista homes search URLs (sale or rent, any of the three sites) or location slugs. For each area the matching sale and rent searches are read: a sale URL gives its rent counterpart and the other way round. Filters in the URL (rooms, size, type, features) apply to both sides; price and publication-date filters are dropped (and said so in `warnings`). Map views, page numbers and sort orders are ignored; URLs without https:// and slugs with accents (`madrid/chamartín`) are accepted. Offices, premises, garages, land and new-build searches are refused with a reason. |
| `country` | ES / PT / IT | ES | Site of a slug without a `pt:` / `it:` prefix. |
| `includeSubAreas` | yes/no | no | One more report per place idealista lists one level below the area. Each is charged like an area report. |
| `maxSubAreas` | number | 50 | At most this many sub-area reports per area, in idealista's order. |
| `propertyType` | homes / flats / houses | homes | idealista's flats or houses filter on both sides. |
| `rooms` | list | none | Only homes with these rooms: 0, 1, 2, 3, 4+. Spain and Portugal count bedrooms (0 = studio, T0); Italy counts rooms including the living room (1 = monolocale). |
| `minSizeM2`, `maxSizeM2` | number | none | Size band. idealista offers 60, 80, 100, 120, 140, 160, 180, 200, 300, 400 m²; a minimum is rounded down and a maximum up to these; a minimum below 60 or a maximum above 400 is not applied. The report says so in both cases. |
| `rentType` | long-term / all | long-term | Long-term lets only (recommended for yield), or all rentals including seasonal / temporary lets. |
| `sampleSize` | number | 240 | Listings read per side of a large area (60 to 360). See "How the numbers are computed". |
| `debug` | yes/no | no | Saves the first results pages to the key-value store. |

```json
{
  "areas": ["https://www.idealista.com/venta-viviendas/madrid/centro/"],
  "includeSubAreas": true
}
```

This input gave 7 reports (Centro and its 6 neighbourhoods) in 172 s in run `VA9vXTAfo5BL2SnFd` on 2026-10-14.

### Example result

From run `x2pXZIxMwJUdOfVty` on 2026-10-14 (input `{"areas": ["pt:lisboa/ajuda"]}`), unedited:

```json
{
  "id": "idealista.pt/casas/lisboa/ajuda|sale:|rent:arrendamento-longa-duracao",
  "area": "Ajuda",
  "level": "area",
  "parentArea": null,
  "locationId": "0-EU-PT-11-06-001-01",
  "site": "idealista.pt",
  "country": "PT",
  "grossYieldPct": 5,
  "priceToRentYears": 20,
  "lowSample": false,
  "saleListings": 169,
  "saleSampleSize": 157,
  "saleSampled": false,
  "saleMedianPrice": 555000,
  "saleP25Price": 369500,
  "saleP75Price": 606750,
  "saleMedianPricePerM2": 5278,
  "saleP25PricePerM2": 4091,
  "saleP75PricePerM2": 6881,
  "saleMedianSizeM2": 94,
  "salePriceDropSharePct": 8.9,
  "saleMedianPriceDropPct": 3.4,
  "saleNewLast7Days": 10,
  "saleNewLast7DaysSharePct": 5.9,
  "salePrivateSellerSharePct": 13.4,
  "rentListings": 81,
  "rentListingsAllLetTypes": 104,
  "rentSeasonalLetListings": 23,
  "rentSeasonalLetSharePct": 22.1,
  "rentSampleSize": 81,
  "rentSampled": false,
  "rentMedianPrice": 1350,
  "rentP25Price": 1167,
  "rentP75Price": 1600,
  "rentMedianPricePerM2": 22,
  "rentP25PricePerM2": 17.86,
  "rentP75PricePerM2": 25.03,
  "rentMedianSizeM2": 65,
  "rentPriceDropSharePct": 11.1,
  "rentMedianPriceDropPct": 6.9,
  "rentNewLast7Days": 12,
  "rentNewLast7DaysSharePct": 14.8,
  "rentPrivateLandlordSharePct": 30.9,
  "roomsCountedAs": "bedrooms",
  "byRooms": [
    { "rooms": "0-1", "saleSampleSize": 25, "saleMedianPrice": 315000, "saleMedianPricePerM2": 6044, "rentSampleSize": 38, "rentMedianPrice": 1162, "rentMedianPricePerM2": 24.38, "grossYieldPct": 4.84 },
    { "rooms": "2", "saleSampleSize": 53, "saleMedianPrice": 485000, "saleMedianPricePerM2": 5795, "rentSampleSize": 35, "rentMedianPrice": 1500, "rentMedianPricePerM2": 20, "grossYieldPct": 4.14 },
    { "rooms": "3", "saleSampleSize": 33, "saleMedianPrice": 540000, "saleMedianPricePerM2": 4947, "rentSampleSize": 8, "rentMedianPrice": 1998, "rentMedianPricePerM2": 17.69, "grossYieldPct": 4.29 },
    { "rooms": "4+", "saleSampleSize": 46, "saleMedianPrice": 555000, "saleMedianPricePerM2": 4269, "rentSampleSize": 0, "rentMedianPrice": null, "rentMedianPricePerM2": null, "grossYieldPct": null }
  ],
  "rentType": "long-term",
  "filters": { "sale": [], "rent": ["arrendamento-longa-duracao"] },
  "saleUrl": "https://www.idealista.pt/comprar-casas/lisboa/ajuda/",
  "rentUrl": "https://www.idealista.pt/arrendar-casas/lisboa/ajuda/com-arrendamento-longa-duracao/",
  "method": "Sale: all 169 listings read; Rent: all 81 listings read.",
  "warnings": ["12 sale listings read were left out as not a free-market price (bare ownership, occupied or tenanted, auction)."],
  "currency": "EUR",
  "reportedAt": "2026-10-14T16:12:17.119Z"
}
```

| Field | Meaning |
|---|---|
| `id` | Site, place and filters of each side; stable between runs. |
| `area`, `level`, `parentArea`, `locationId` | Name as idealista shows it; `area` or `sub-area`; the area a sub-area belongs to; idealista's location id. |
| `grossYieldPct` | 12 × `rentMedianPricePerM2` ÷ `saleMedianPricePerM2` × 100 (unrounded medians). `null` when either side has fewer than 5 listings with price and size. |
| `priceToRentYears` | Sale price per m² ÷ 12 months of rent per m². |
| `lowSample` | `true` when either side has fewer than 30 listings with price and size: the figures are indicative. |
| `saleListings`, `rentListings` | Listings idealista counts for the search (the results page total). |
| `saleSampleSize`, `rentSampleSize` | Listings actually used for the price per m² figures (free-market price and a size of at least 10 m²). |
| `saleSampled`, `rentSampled` | `false`: every listing was read (exact). `true`: a sample was read (see below). |
| `…MedianPrice`, `…P25Price`, `…P75Price` | Asking price (sale) or monthly rent, in EUR. |
| `…MedianPricePerM2`, `…P25PricePerM2`, `…P75PricePerM2` | Price per m² (sale, whole euros) or monthly rent per m² (two decimals). |
| `…PriceDropSharePct`, `…MedianPriceDropPct` | Share of listings showing a reduced price, and the median reduction in %. |
| `…NewLast7Days`, `…NewLast7DaysSharePct` | Listings idealista's "published in the last week" filter returns, and their share of the side. |
| `salePrivateSellerSharePct`, `rentPrivateLandlordSharePct` | Share of listings not advertised by a professional. |
| `rentListingsAllLetTypes`, `rentSeasonalLetListings`, `rentSeasonalLetSharePct` | With long-term lets: rentals of every kind, and seasonal / temporary lets among them. |
| `roomsCountedAs` | `bedrooms` (Spain, Portugal) or `rooms incl. living room` (Italy): how the `byRooms` bands count. |
| `byRooms` | The same figures per rooms band. A band's yield needs at least 5 listings on each side. |
| `method`, `warnings` | How many listings were read on how many pages; small samples, dropped filters, listings left out. |

Fields that cannot be computed are `null`, never missing.

### How the numbers are computed

- Only results pages are read (cards: price, previous price, size, rooms, tags), never property pages. Pages are read sorted by price, cheapest first.
- **Small sides are read in full** (exact figures, `saleSampled: false`): up to `sampleSize` listings plus 4 more results pages (120 listings). At the default 240, that is every side of up to 360 listings.
- **Larger sides are sampled** (`saleSampled: true`): `sampleSize` listings on results pages at evenly spaced positions across the price-sorted list, cheapest to dearest, each page weighted by the share of the list it stands for. idealista shows at most 60 pages per search; deeper positions are reached with a price floor whose total gives each page's exact position. Against a full read of the same Madrid neighbourhood (374 listings for sale, 2026-10-14) the sample's median sale price per m² was 1.9% off and the yield 0.07 points off; for rooms bands the error can be about 10%.
- Sale listings that are not a free-market price are left out and counted in `warnings`: bare ownership, occupied, tenanted (tagged "Alquilada", "Arrendada", "Affittata") and auctions. Seasonal lets are left out of the long-term rent side.
- New-listing counts come from idealista's own "last week" filter (top-level areas: one extra page per side; sub-areas: from the same page's breadcrumb counts, no extra request).
- Gross yield is before costs, vacancy and taxes, from asking prices and asking rents.

### Pricing

Pay per event. You pay for reports delivered, not for time or proxy traffic.

| Event | Free | Bronze | Silver | Gold and above |
|---|---|---|---|---|
| Actor start (per GB of memory, 2 GB by default) | $0.0042 | $0.0035 | $0.00315 | $0.0028 |
| Area report delivered (area or sub-area) | $0.06 | $0.05 | $0.045 | $0.04 |

Worked example (Bronze): Madrid Centro with its 6 neighbourhoods = 7 reports × $0.05 + 2 × $0.0035 = $0.357.

- An area that idealista lists no homes for gives no report and is not charged. A failed area is not charged.
- The maximum total charge you set for a run is respected: the actor stops before it would go over, keeps what was delivered, and says so in the status message (run `lnRGa4T24gfG0sBi4`: limit $0.108, 2 reports delivered and charged).
- The price is the same for every `sampleSize`.

### Reliability and failure behaviour

| What happened | Run status | Status message |
|---|---|---|
| Reports delivered | Succeeded | `Scraped 7 area reports from 1 query` |
| idealista lists no homes for the area and filters | Succeeded | `0 results: idealista has no area reports for this query — idealista lists no homes for sale or rent matching …` |
| Some areas worked, some failed | Succeeded | `Scraped 1 area report from 2 queries — 1 of 2 queries failed (…)` |
| Nothing delivered because of errors or blocking | **Failed** | `No area reports delivered: idealista blocked every attempt; try again later. No reports were charged (the start fee applies).` |
| Input the actor cannot use | **Failed**, within seconds | `Nothing to do: none of the 2 entries in the input is usable (…). Add at least one entry to "areas", e.g. …` |
| A place idealista does not know | **Failed** | `… idealista has no results page at … (HTTP 404): check the location (copy it from an idealista search URL)` |
| Maximum charge reached | Succeeded | `Scraped 2 area reports from 1 query — stopped at the maximum charge set for this run` |

- The reason a run ended is also always in the run log and in `OUTPUT_SUMMARY` (`stopReason`, `failedInputs`, and `ignoredInputs` with every unusable entry and why).

- idealista is protected by an anti-bot service. Each run uses a real Firefox browser through a residential proxy of the site's country and reads one page at a time. A refused browser session is replaced (up to 6 in a row per page, 25 per run); run `t7hPmmmqWscRTZHRa` met 3 refused sessions and delivered all 7 reports.

- Reports are saved one by one. A run that is aborted, times out or is restarted keeps what was delivered and never delivers or charges the same report twice (live check: run `j0S934tp13HcIeCJe` was restarted after 2 reports and charged 5 reports for 5 delivered).

- On 2026-10-14, 12 of 12 test runs on the final code (builds 0.1.4 and 0.1.5) ended as intended (10 with reports on all three sites, 1 with 0 results, 1 refused input).

### Limits

- Figures come from asking prices and asking rents, not transactions.
- Large areas are sampled (240 listings per side by default, 360 at most): medians are estimates, rooms bands more so. Small sub-areas often have few rentals: check `lowSample` and `rentSampleSize`.
- Speed: under a minute for one small area (17-31 s measured), about 3 minutes for a district with 6 sub-areas, about 5 minutes for 11 reports.
- In Italy many sale listings are auctions ("Asta") and are left out, so `saleSampleSize` can be well below the listings read (Torino: 75 of 240 left out). The count is in `warnings`.
- Italy has no studio band of its own ("0" is not a filter there): monolocali count as 1 room.
- Spain, Portugal and Italy only (the three idealista sites). Homes only.

### FAQ

**Why is the yield of a neighbourhood missing?** Fewer than 5 listings with price and size on one side. The other figures are still given, and the report is ranked last in the comparison table.

**Why does `saleSampleSize` differ from `saleListings`?** Large areas are sampled; and listings without a size, or not at a market price (auctions, bare ownership, tenanted), are left out of the per-m² figures.

**Can I run it from code or on a schedule?** Yes: the API, the Apify clients for JavaScript and Python, schedules, and integrations such as Make, Zapier and n8n. A monthly schedule per city gives a market tracker.

**What happens when idealista changes its pages?** A page that cannot be read fails the area loudly (`could not be read … idealista may have changed its layout`) instead of returning empty figures. Report the run id under Issues.

### Legal and responsible use

This actor reads listing data that idealista shows publicly without a login and returns only aggregated statistics per area. It returns no personal data: no names, phone numbers, emails, photos or user ids of sellers or landlords, only the share of listings by private advertisers.

You are responsible for how you use the data: respect idealista's terms, copyright and database rights, and data-protection law in your country. The figures are not investment advice.

### Changelog

- 2026-10-14: first version. Studios counted in the 0-1 rooms band in Spain; tenanted homes left out in all three countries; `lowSample` and `roomsCountedAs` fields; no yield from fewer than 5 listings on a side; sides up to sample size + 120 listings read in full.

### Related actors

Other actors by the same developer:

- [Idealista Scraper](https://apify.com/amitaviv/idealista-scraper): the individual listings behind these figures, from any idealista search URL in Spain, Portugal or Italy, with price, price drop, size, rooms, agency and, optionally, full details and coordinates. Use it to shortlist properties in the areas with the best yield.
- [Fotocasa Scraper](https://apify.com/amitaviv/fotocasa-scraper): sale and rent listings from fotocasa.es, another of Spain's main property portals, with price per m² and price drops.
- [Immobiliare.it Scraper](https://apify.com/amitaviv/immobiliare-it-scraper): sale, rent and auction listings from immobiliare.it, for Italian areas.
- [Listing Status Checker](https://apify.com/amitaviv/property-listing-status-checker): re-checks saved Fotocasa, ImmoScout24 and Kleinanzeigen listing URLs (among others) for online, sold or removed status and price changes. It does not check idealista URLs.

### Support

Open an issue on the actor's **Issues** tab with the run id.

# Actor input Schema

## `areas` (type: `array`):

One area per line: an idealista homes search URL (sale or rent, e.g. https://www.idealista.com/venta-viviendas/madrid/centro/) or a location slug as it appears in idealista URLs (madrid-madrid, madrid/centro, barcelona-barcelona; prefix pt: or it: for Portugal or Italy, e.g. pt:lisboa, it:milano-milano). The matching sale and rent searches are read for each area. Filters in the URL (rooms, size, type, features) are applied to both sides; price and publication-date filters are not applied. Map views, page numbers and sort orders are ignored, and URLs without https:// are accepted. Offices, premises, garages, land and new-build (obra nueva) searches are not supported. Each area gives one report (one charged 'area-report' event).

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

Which idealista site a slug without a pt: / it: prefix belongs to: ES (default), PT or IT. URLs carry their own site.

## `includeSubAreas` (type: `boolean`):

One more report for each place idealista lists one level below the area (a city's districts, a district's neighbourhoods, a Portuguese municipality's parishes). Each sub-area report is charged like an area report. Example: madrid/centro with this on gave 7 reports (Centro and its 6 neighbourhoods). Default off: one report per area.

## `maxSubAreas` (type: `integer`):

Only with sub-areas on. Caps the number of sub-area reports (and so the cost) per area, 1 to 200; default 50. Sub-areas are taken in idealista's order (alphabetical).

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

homes (default): every home type. Flats: idealista's 'pisos' (ES), 'apartamentos' (PT), 'appartamenti' (IT) filter. Houses: 'chalets' (ES), 'moradias' (PT), 'case indipendenti' (IT).

## `rooms` (type: `array`):

Optional: only homes with these numbers of rooms, any of 0, 1, 2, 3, 4+ (one per line). Spain and Portugal count bedrooms (0 = studio, T0); Italy counts all rooms including the living room (1 = monolocale; 0 is not available there). Every report also splits its figures by rooms (0-1, 2, 3, 4+) without this filter; the field roomsCountedAs says which way the rooms were counted.

## `minSizeM2` (type: `integer`):

Optional, in square metres, e.g. 80. idealista offers 60, 80, 100, 120, 140, 160, 180, 200, 300, 400 m²: other values are rounded down to the nearest of these; below 60 no minimum is applied (the report says so).

## `maxSizeM2` (type: `integer`):

Optional, in square metres, e.g. 120. Rounded up to the nearest value idealista offers (60 to 400 m²); above 400 no maximum is applied (the report says so).

## `rentType` (type: `string`):

Seasonal and temporary lets ask much higher monthly rents. By default the rent side uses idealista's own long-term filter, and the report also gives the number of rentals of every kind.

## `sampleSize` (type: `integer`):

Sides (sale or rent) with up to this many listings plus 120 (4 more results pages) are read in full, so their figures are exact: at the default 240, sides of up to 360 listings. Larger sides are sampled: this many listings on results pages spread evenly over the price range, weighted by the share of the list each page stands for. 60 to 360; larger samples are more precise and take longer, the price per report is the same.

## `debug` (type: `boolean`):

Default off; not needed for normal use. Saves the first results pages and any block page to the key-value store and logs session details.

## Actor input object example

```json
{
  "areas": [
    "https://www.idealista.com/venta-viviendas/madrid/centro/"
  ],
  "country": "ES",
  "includeSubAreas": false,
  "maxSubAreas": 50,
  "propertyType": "homes",
  "rentType": "long-term",
  "sampleSize": 240,
  "debug": false
}
```

# Actor output Schema

## `results` (type: `string`):

All delivered reports, one object per area or sub-area. Main fields: area, level (area or sub-area), parentArea, site, grossYieldPct (gross rental yield, %), priceToRentYears, lowSample, saleListings and rentListings (idealista's totals), saleSampleSize and rentSampleSize (listings used), saleMedianPrice (EUR), rentMedianPrice (EUR per month), saleMedianPricePerM2 (EUR/m²), rentMedianPricePerM2 (EUR/m² per month), 25th and 75th percentiles, salePriceDropSharePct, saleNewLast7Days, byRooms (the same figures per rooms band 0-1, 2, 3, 4+), method and warnings.

## `resultsCsv` (type: `string`):

All delivered reports as a CSV file, one row per area or sub-area.

## `comparison` (type: `string`):

Every area and sub-area of the run in one table, highest gross yield first; areas with fewer than 30 listings on a side (lowSample), or with no yield, last.

## `summary` (type: `string`):

What was requested, delivered and charged; pages read per area; inputs that failed or were ignored; why the run stopped.

# 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 = {
    "areas": [
        "https://www.idealista.com/venta-viviendas/madrid/centro/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("amitaviv/idealista-rental-yield-finder").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 = { "areas": ["https://www.idealista.com/venta-viviendas/madrid/centro/"] }

# Run the Actor and wait for it to finish
run = client.actor("amitaviv/idealista-rental-yield-finder").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 '{
  "areas": [
    "https://www.idealista.com/venta-viviendas/madrid/centro/"
  ]
}' |
apify call amitaviv/idealista-rental-yield-finder --silent --output-dataset

```

## MCP server setup

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

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/bJkue1iMxsqedAsnJ/builds/GFKjfyZsBjWNedYZ2/openapi.json
