Real estate6 min readBy Purrkey team

How to compare Idealista sale listings in Madrid

Build a table of Idealista sale listings in Madrid with price, size, rooms and location. One call returns up to 20 results, and the guide covers the input fields, the output fields that drive a shortlist and the cost ceiling

On this page

You need to compare 20 homes for sale in Madrid before shortlisting neighborhoods for a relocation brief, and you want their price, size, rooms and location in one table. A single call to apify.idealista.search returns up to 20 Idealista results, so one request covers the whole job

The table below is a design. No run has been executed for this article, so the values are placeholders and the shape is what matters

The Madrid search and the shortlist table

Example input, invented for this guide and to be replaced with your own search:

FieldValue
operationsale
locationMadrid
propertyTypehomes
countryes
limit20

The deliverable is one row per listing, with the comparison columns first and the identification columns behind them. Values here are placeholders showing the shape

propertyCodepricesizeSquareMetersroomsneighborhoodpricePerSquareMetershortlistFlag
(string)(number or null)(number or null)(integer or null)(string or null)(number or null)keep or review

The full row also carries url, title, priceSuffix, bathrooms, municipality, province and agency

shortlistFlag is your own rule, not a field the tool returns. Set a budget and a minimum size, mark a row keep when price sits at or under budget and sizeSquareMeters clears the floor, and mark it review when either value is null so a person opens url and checks the listing by hand. The same table shape applied to a US city is in how to search Zillow listings by location

What the call takes

Two fields are required: operation and location. operation accepts sale or rent, and this job uses sale. location takes a city name such as Madrid or an Idealista location ID such as 0-EU-ES-28-07-001-079. The catalog description adds a caveat to read before you type a neighborhood name: "Ambiguous names resolve to Idealista's first match". Paste the ID from an Idealista URL when the name is not a clean city

The remaining fields have defaults. propertyType defaults to homes and also accepts values such as newDevelopments, bedrooms, garages, storageRooms, offices, premises, lands and buildings. country defaults to es and accepts es, it or pt

limit is the ceiling on this job: an integer from 1 to 20, default 10, and the contract says each result is billed by Apify. Ask for 20 when the brief is 20 homes, because the call cannot return a 21st row. Requests go through Purrkey to POST /v1/runs with toolId apify.idealista.search

Reading the fields that decide a row

price is a number or null. Read it with priceSuffix, described in the contract as "Currency and period as Idealista shows it, such as €/mes." A sale figure and a rental figure can share the same numeric field, so the suffix is what tells you which one is in your budget column

pricePerSquareMeter carries the district comparison the brief asks for. It can be null, and when it is, divide price by sizeSquareMeters yourself and mark the row as computed rather than scraped. A row with a null price or a null sizeSquareMeters cannot enter a price comparison

neighborhood, district, municipality and province are separate levels and each can be null. Group on district for a district average and keep neighborhood for the finer line in the relocation brief

agency holds the agency name, and the contract notes that private advertisers have none, so a null reads as a private seller. propertyCode and url are the pair to carry into a later recheck, and propertyCode is a required output field, which makes it the dedupe key for next week. firstActivatedAt is a date-time field for the listing's age, and hasLift and exterior are booleans when those matter to the shortlist

The agent prompt

Agent prompt
Set up https://purrkey.app/SKILL.md, then use Purrkey to search Idealista
sale listings in Madrid and return a shortlist table. Check the current
inputs and the price of apify.idealista.search in the catalog before
running anything. Call it once with operation sale, location Madrid,
propertyType homes, country es and limit 20. Return one table with
propertyCode, url, title, price, priceSuffix, pricePerSquareMeter,
sizeSquareMeters, rooms, bathrooms, municipality, province,
neighborhood, agency and shortlistFlag. Mark shortlistFlag keep when
price is at or under 450000 and sizeSquareMeters is at least 70, mark it
review when either value is null, and leave the flag empty otherwise.
Do not invent rows and do not replace a null with a guess.

The budget of 450000 and the 70 square meter floor are example numbers. Set your own before the run, and keep the first call at limit 20 so the shortlist and the budget are drawn from the same 20 listings

Estimated tool cost

Prices read from the Purrkey catalog on November 19, 2026, price revision apify-receipt-2026-11-18. The listing unit is max_call, defined as "Maximum per call. Successful runs settle at Apify's actual charge, with no markup. Failed runs and runs without results are not charged." The totals below are ceilings, and model fees for the agent are not counted

StepFormulaUnit pricePlanned quantityTotal
Single 20-result Madrid sale searchcalls x max priceup to $0.03 per call1$0.03
Weekly Madrid sale recheck, one quartercalls x max priceup to $0.03 per call13$0.39
Monthly Lisbon rental search, six monthscalls x max priceup to $0.03 per call6$0.18

The third row is a different job: operation set to rent, location set to Lisbon and country set to pt. A run that comes back without results is not charged, so a location that resolves to nothing costs nothing

Open the Idealista search tool page, copy the tool id and check the current price before the first call

Get started by giving this to your agent

  • Claude Code
  • Codex
  • Gemini CLI
  • Cursor
  • GitHub Copilot
Set up https://purrkey.app/SKILL.md, then use Purrkey to show me what I can do with Idealista.
Explore Idealista tools and pricing

FAQ

How do I search Idealista sale listings in Madrid with one API call?

Call apify.idealista.search with operation sale, location Madrid, propertyType homes, country es and limit 20. One call returns up to 20 Idealista results with price, size, rooms, bathrooms and location fields.

What inputs does apify.idealista.search require?

operation and location are required. propertyType defaults to homes, country defaults to es and limit defaults to 10.

How many listings can one apify.idealista.search call return?

limit must be an integer from 1 to 20, and each result is billed by Apify. The default is 10, so a 20-home brief needs limit set to 20.

Which output fields should I use to compare Madrid districts?

pricePerSquareMeter carries the district comparison, read together with price, priceSuffix and sizeSquareMeters. district and neighborhood are separate location levels and either can be null.

What does a null agency value mean in the results?

The contract describes agency as the agency name and notes that private advertisers have none, so a null reads as a private seller rather than missing data.

What happens when the location name is ambiguous?

The contract says ambiguous names resolve to Idealista's first match. Paste a location ID such as 0-EU-ES-28-07-001-079 when the city name is not clean.

How much does a 20-result Madrid sale search cost?

At most $0.03 for one call, since the listing is up to $0.03 per call. A weekly Madrid recheck for one quarter is 13 calls at most $0.39, and model fees for the agent are not counted.

Next step

Try this with Idealista

The tool directory lists every endpoint with its current price. Inspect the inputs there, then let your agent run a small batch before scaling up.

See Idealista tools

Share this article