# Idealista rental snapshots with n8n

Collect recent Idealista rental listings, check what the run covered, and download a CSV. An optional Google Sheets node lets you append snapshots for later analysis.

This workflow uses [Idealista Scraper for Spain, Italy and Portugal](https://apify.com/fagenorn/idealista-scraper), a paid actor developed by the publisher of this kit. The actor is independent and unaffiliated with Idealista. The workflow template is free; actor runs and your automation platform follow their own pricing.

## Import and run

1. Import `idealista-n8n-workflow.json` into n8n using **Import from File** or **Import from URL**. The template has no credentials or saved customer data. The daily schedule and Google Sheets node start disabled.
2. Create an n8n **Header Auth** credential. Set its header name to `Authorization` and its value to `Bearer YOUR_APIFY_TOKEN`. Select that credential on **Start actor**, **Wait for run**, **Get coverage summary** and **Get listings**. Keep the token in the credential, outside the workflow's search settings.
3. Open **Configure search**. The preset searches Madrid rental homes published in the last week, newest first, and saves up to 25 listings. Its maximum Apify event charge is $0.02 and actor timeout is 120 seconds. Check the actor's Pricing tab before running.
4. Run the workflow manually. Open **Download CSV** and download its binary output. **Validate coverage** contains the collection summary, including any limits. A failed or partial collection stops the workflow for inspection.

Change the Start URL to a supported location search on `idealista.com`, `idealista.it` or `idealista.pt`. The actor detects country and operation from the URL. Change `publishedWithin` to `any` for a broader snapshot. This template supports 1–1,000 listings per run; use the actor or a paginated API integration for larger exports.

If the search has no matching listings, the summary records zero results and the CSV branch produces no rows. Inspect the summary rather than assuming a download is missing because of a failure.

## Add Google Sheets

Create a sheet with a tab called `Listings` and these headers:

```text
listing_key,run_id,country,operation,title,price_eur,size_m2,rooms,municipality,url,scraped_at,detail_status,coverage_complete,coverage_reasons
```

Open **Append snapshot to Google Sheets (optional)**, connect your Google Sheets credential, enter the spreadsheet's document ID, and select the tab. Enable the node and test manually. It uses automatic column mapping and RAW cell values.

The Sheets node appends each snapshot. The same property may appear in several runs, with the same `listing_key` and different `run_id` values. That preserves observations over time; it does not detect new or removed listings by itself. The template contains the Sheets connection step, but the publisher's verification does not connect to or write into your Google account.

Tested with n8n 2.42.5 on October 8, 2026: the manual workflow completed against the live actor, returned 25 unique Madrid rental listings, and produced a CSV whose 14 columns match the prepared rows. The sample correctly retained `coverage_complete=false` and `max-items`. Google Sheets was disabled during that test.

Once the manual run and destination work, enable **Daily schedule (optional)** and publish the workflow in n8n. Check your n8n timezone and run-cost setting first. Nothing in this download schedules runs in the publisher's account.

## Interpret coverage

Each exported row includes `coverage_complete` and `coverage_reasons`. A `max-items`, `query-limit`, `page-cap`, `budget-limit` or `depth-window` reason means the search was limited. A successful 25-row sample is still a sample of the advertised market.

Compare asking prices only for comparable locations, operations and property types. These are advertised asking prices, not completed sale prices. A missing row in a later snapshot can reflect changed filters or incomplete coverage; it does not establish that the property was removed.

## Python alternative

The kit also includes a standard-library Python exporter. Set `APIFY_TOKEN` in your environment, then run from the kit directory:

```sh
python3 examples/run_actor.py --input examples/recent-madrid-rentals.json --out exports/madrid-rentals
```

It saves JSON, CSV, the run metadata and the coverage summary. An existing authenticated Apify CLI can supply credentials with `--cli`. Use `--run-id` to download a completed run without starting another.

## References

- [n8n workflow import](https://docs.n8n.io/workflows/export-import/)
- [n8n HTTP Request node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/)
- [n8n Google Sheets node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.googlesheets/)
- [Apify Run Actor API](https://docs.apify.com/api/v2/actors-runs-post)
- [Actor help and supported search options](https://apify.com/fagenorn/idealista-scraper)
