# Rental yield in Madrid by district and bedrooms

**Use case:** 

Gross rental yield for every district and bedroom count in Madrid, from all Habitaclia flats for sale and for long-term rent. Medians in EUR, sample sizes and confidence.

## Input

```json
{
  "cities": [
    "madrid"
  ],
  "mode": "yieldReport",
  "bedrooms": [
    "0",
    "1",
    "2",
    "3",
    "4+"
  ],
  "areaMin": 15,
  "areaMax": 250,
  "minScore": 0,
  "maxScoredListings": 1000,
  "maxListingsPerSide": 0,
  "minSaleSample": 15,
  "minRentSample": 10,
  "onlyNewOrChanged": false,
  "watchlistName": "default",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "ES"
  }
}
```

## Output

```json
{
  "city": {
    "label": "City",
    "format": "string"
  },
  "district": {
    "label": "District",
    "format": "string"
  },
  "bedrooms": {
    "label": "Bedrooms",
    "format": "integer"
  },
  "grossYieldPct": {
    "label": "Gross yield (%)",
    "format": "number"
  },
  "salePricePerM2Eur.median": {
    "label": "Median sale EUR/m²",
    "format": "number"
  },
  "rentPerM2MonthlyEur.median": {
    "label": "Median rent EUR/m²/month",
    "format": "number"
  },
  "saleCount": {
    "label": "Sale listings",
    "format": "integer"
  },
  "rentCount": {
    "label": "Rent listings",
    "format": "integer"
  },
  "confidence": {
    "label": "Confidence",
    "format": "string"
  },
  "groupLevel": {
    "label": "Compared at",
    "format": "string"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Habitaclia Scraper with Rental Yield & Deal Score – Spain Actor is ready to run with the inputs already set for "Rental yield in Madrid by district and bedrooms". [Sign up or log in](https://console.apify.com/create-task-from-example/1cGYuclvBaIVT8MkP) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Rental yield in Madrid by district and bedrooms" task

The Habitaclia Scraper with Rental Yield & Deal Score – Spain Actor will start running based on the input automatically. You can also change all the input fields, like cities, what to return, and more, to match your specific use case.

### 3. Receive the "Rental yield in Madrid by district and bedrooms" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as city, district, bedrooms, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Rental yield in Madrid by district and bedrooms" task via API](https://apify.com/data-nest/habitaclia-rental-yield.md).

## FAQ

### What does this task return?

One row per district and bedroom group in Madrid (studio to 4+ bedrooms): median asking price per m², median asking rent per m² per month, gross rental yield, number of listings and a confidence level. Prices in EUR.

### How much does a run cost?

You pay $0.03 per yield group with high or medium confidence (Free plan price; lower on paid plans). Low-confidence groups are free. Our test run on 27 November 2026 returned 61 paid groups, which is $1.83.

### How long does a run take?

The task reads the whole Madrid market, district by district: about 680 result pages at one request per second. Plan for at least 12 minutes.

### What was the gross yield in Madrid?

In our run on 27 November 2026 the city-wide gross yield was 5.79% (6,216 EUR/m² to buy, 30.0 EUR/m² a month to rent). It ranged from 8.88% (2 bedrooms, Puente de Vallecas) to 2.88% (3 bedrooms, Barrio de Salamanca).

### Are holiday or temporary rentals included?

No. Listings that the portal marks as temporary rentals are kept out of all medians, because they would push the yield up. In Madrid they were 31% of rent listings.

### Are these the yields an investor will actually get?

They are gross yields from asking prices and asking rents. Yields based on signed contracts are typically lower, and costs such as taxes, fees and vacancy are not deducted. Studios show the highest yields, so treat them with extra care.

### Can I get the individual listings instead?

Yes. Set mode to listings to get every flat for sale and for rent with a deal score, estimated rent and estimated yield, at $0.001 per listing (Free plan price).

## About this Actor

This example demonstrates how to use [Habitaclia Scraper with Rental Yield & Deal Score – Spain](https://apify.com/data-nest/habitaclia-rental-yield.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/data-nest/habitaclia-rental-yield.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

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 full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/data-nest/habitaclia-rental-yield.md

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`).
