Skip to main content

How to Scrape Zimmo Property Listings with Python

Estimate gross rental yield from one sale and one rent search on zimmo.be

Updated 12 min readMarkdown
How to Scrape Zimmo Property Listings with Python

If you're weighing a buy-to-let flat in Leuven, the first number you want is the gross rental yield: a year's rent divided by the purchase price. Zimmo, the Belgian property portal, lists both sides of that equation. This tutorial shows how to scrape Zimmo property listings with Python using 2scraper/zimmo-scraper, an MIT-licensed open-source scraper, and turn one sale search and one rent search into a yield estimate per bedroom count.

How to scrape Zimmo property listings in six steps

To scrape Zimmo property listings, run a Python browser scraper in a visible (headful) Chromium window on a Belgian or German residential connection, point it at a zimmo.be search-results URL, and it writes one row per listing with price, property type, living area, bedrooms, EPC label and address. A sidecar file and the exit code tell you whether the run completed.

  1. Clone the repository and create a Python 3.9–3.12 virtual environment.
  2. Install the base and Playwright requirements, then Chromium.
  3. Run a sale search with --headful and a few --pages.
  4. Run the matching rent search the same way.
  5. Check each run's exit code and .meta.json.
  6. Compare median sale prices and rents with a short pandas script.

What a Zimmo search gives you

Input Example What each row contains
Dutch sale search /nl/leuven-3000/te-koop/ price in EUR, property_type, surface_m2, bedrooms, epc_label, location, url, image_url
Dutch rent search /nl/leuven-3000/te-huur/ The same columns, with listing_type set to rent
French sale or rent search /fr/bruxelles-1000/a-vendre/, /a-louer/ The same columns from the French site
Anything that isn't a search-results page a single listing URL Refused with exit 2

Every row has the same 19 columns in JSON and CSV. listing_type (sale or rent) and property_type (huis, appartement, nieuwbouwproject, garage and so on) come from the URL, so they're reliable. sku is Zimmo's listing code. epc_label is the energy grade, including Brussels grades such as E-.

Some columns are less useful than they look. brand, original_price, discount_pct and epc_value are always null. surface_m2 is living area only. price is null for "price on request", and for a new-build project it's the cheapest unit's price, so it's a lower bound rather than a property price. There are no detail-page fields: the scraper reads search results only, so there's no agency, contact details, coordinates or listing date.

Why Zimmo is fussy about who it serves

Zimmo sits behind Cloudflare, and the README's access matrix from 2026-09-23 is blunt about it. The same Ghent sale URL was tried eight ways:

  • curl from a datacentre got HTTP 403 "Just a moment…".
  • Chromium from a datacentre, headless or headful, got a Cloudflare challenge and exit 3.
  • Headless Chromium on a Belgian residential connection was also challenged.
  • Headful Chromium on a Belgian residential connection was served: 63 rows over 3 pages, exit 0. A German residential exit worked too.
  • The 2Captcha Scraping Browser API with a Belgian profile was served: 63 rows, 3 of 3 pages.

Two conditions decide it: a residential IP and a visible browser. A US residential exit was refused in a later test, so the country matters too. That's why the quick start below uses --headful, and why a headless run from your cloud server will fail no matter how polite it is.

Installing the Zimmo scraper

The README supports Python 3.9 to 3.12, and CI tests 3.9 and 3.12. These are the commands from the zimmo-scraper repository on GitHub:

git clone https://github.com/2scraper/zimmo-scraper.git
cd zimmo-scraper
python3 -m venv .venv && . .venv/bin/activate   # Python 3.9-3.12, see below for 3.13
pip install -r requirements.txt -r requirements-playwright.txt
playwright install chromium
cp .env.example .env   # on a server: set ZIMMO_PROXY to a residential proxy

On Python 3.13 the pinned greenlet has no wheel. The README's workaround is to install greenlet pyee==11.1.0, then pip install --no-deps playwright==1.44.0. Selenium and Puppeteer engines also exist, but Playwright and Puppeteer have conflicting pyee pins, so give each engine its own virtual environment.

.env holds six optional settings: TWOCAPTCHA_KEY, ZIMMO_URL, ZIMMO_CDP_ENDPOINT, ZIMMO_PROXY, ZIMMO_LOAD_MEDIA and ZIMMO_PROXY_BUDGET_MB. Placeholders copied from the example file are treated as unset. To check your install without touching zimmo.be, run python3 smoke_test.py: it needs no network and no browser.

Collecting the sale and rent searches

From a home connection in Belgium or Germany, with a screen, run the two searches one after the other. If you're elsewhere, the README's tests refused a US residential exit, so use a Belgian proxy or the Scraping Browser API described below:

python3 playwright_scraper.py --url "https://www.zimmo.be/nl/leuven-3000/te-koop/" \
  --pages 3 --headful --delay 5 --format json --out leuven_sale
python3 playwright_scraper.py --url "https://www.zimmo.be/nl/leuven-3000/te-huur/" \
  --pages 3 --headful --delay 5 --format json --out leuven_rent

--out is a file prefix, so the first run writes leuven_sale.json and leuven_sale.meta.json. Pass the URL without a page parameter; the scraper adds it, and a URL that already has one is exit 2. --delay 5 waits five seconds after each page, which keeps the run polite and costs you nothing.

On a server with no display, the README wraps the same command in xvfb-run -a. That gives Chromium a virtual screen, but it doesn't fix the IP: the README's own 2026-11-17 check of the quick start from a datacentre address ended in a Cloudflare challenge, exit 3, with nothing written. On a server you need ZIMMO_PROXY pointing at a residential proxy, or the Scraping Browser API described below.

Reading the run before the data

Each run's .meta.json records status (complete, partial or empty), stop_reason, failed_pages, parser_failed_pages, selection (the search URL without its page parameter) and listing_exhausted, which says whether the run read the search to its end. On the Dutch site, asking for more pages than exist is fine: the run stops when Zimmo says "We vonden helaas geen resultaten" and is marked complete with listing_exhausted: true. On the French site the "no results" wording isn't known yet, so overshooting ends the run partial.

The exit codes:

  • 0: complete
  • 6: partial; rows written, check stop_reason and failed_pages
  • 3: blocked, usually by Cloudflare
  • 4: zero listings (without --allow-empty)
  • 5: content never obtained, including proxy failures such as proxy_auth_failed (407) or proxy_balance_exhausted (402)
  • 2: bad usage
  • 1: crash
  • 130: stopped with Ctrl-C before any row

Don't run the yield script on a run that exited 3, 4 or 5: there's nothing new in the file, and an old file from a previous run may still be sitting there.

Where 2Captcha fits for Zimmo

The useful 2Captcha piece here isn't CAPTCHA solving. It's the remote browser. The 2Captcha Scraping Browser API gives you a browser with a Belgian exit, and in the access matrix it was served without a home connection or a proxy of your own. Put the endpoint in ZIMMO_CDP_ENDPOINT (or pass --cdp-endpoint) in the README's format:

ws://{login}-zone-scraping_browser-country-be-pid-{profileId}:{password}@cb.2captcha.com:9222

Reuse the same pid: it keeps the profile's cookies and the trust Cloudflare has already given it. Since v1.2.1 the scraper opens one connection per run, because reconnecting used to fail with HTTP 500. --cdp-endpoint can't be combined with --proxy or with --concurrency above 1, and an HTTP 401 deny_no_user on connect means fetching fresh credentials. Selenium can't authenticate to a CDP endpoint at all.

The same TWOCAPTCHA_KEY also enables CAPTCHA solving with --solve-captcha when-blocked (the default), at most one paid solve per page. Be realistic about it: the README says the solver "was not exercised" in its measured runs, and solving the Cloudflare interstitial "was not tested". The 2Captcha Scraper API is wired in too, but it returned "0 resultaten" for Ghent twice on 2026-10-28 while the Browser API read 63 listings from the same URL that day. If you're in Belgium or Germany, I'd start with your home connection. Anywhere else, or on a server, the Browser API is the simpler route.

If you use a residential proxy instead, the scraper checks it first (one CONNECT and a HEAD /robots.txt) and caps traffic with --proxy-budget-mb, 10 MB by default. The README measured about 2.6 MB per page through a residential exit, so three pages fit with room to spare.

One row from the sample file

The repository's sample_output.json holds one Ghent sale page from 2026-09-23. Here's an apartment from it, without scraped_at and the long image_url:

{
  "source": "zimmo.be",
  "url": "https://www.zimmo.be/nl/gent-9000/te-koop/appartement/LRZKI",
  "sku": "LRZKI",
  "title": "Appartement te koop",
  "brand": null,
  "price": 355000.0,
  "currency": "EUR",
  "original_price": null,
  "discount_pct": null,
  "category": "gent-koop",
  "listing_type": "sale",
  "property_type": "appartement",
  "location": "Martelaarslaan 287 9000 Gent",
  "surface_m2": 92.0,
  "bedrooms": 2,
  "epc_label": null,
  "epc_value": null
}

scraped_at, left out above, is when the run happened (2026-09-23 for the whole sample), not when the listing went up. location is the address exactly as the search tile shows it, which matters for the legal note further down.

Estimating gross yield with pandas

This script keeps apartments with a price and a bedroom count from both runs, then compares the median sale price with the median rent for each bedroom count. Install pandas first, since it isn't one of the scraper's requirements:

pip install pandas

Save it as yield.py:

import sys

import pandas as pd

sale_file = sys.argv[1] if len(sys.argv) > 1 else "leuven_sale.json"
rent_file = sys.argv[2] if len(sys.argv) > 2 else "leuven_rent.json"


def flats(path):
    df = pd.read_json(path, dtype={"sku": str})
    df = df[(df["property_type"] == "appartement") & (df["currency"] == "EUR")]
    return df.dropna(subset=["price", "bedrooms"])


sale, rent = flats(sale_file), flats(rent_file)
summary = pd.DataFrame({
    "for_sale": sale.groupby("bedrooms")["sku"].count(),
    "median_price": sale.groupby("bedrooms")["price"].median(),
    "for_rent": rent.groupby("bedrooms")["sku"].count(),
    "median_rent": rent.groupby("bedrooms")["price"].median(),
}).dropna()
summary["gross_yield_pct"] = (summary["median_rent"] * 12 / summary["median_price"] * 100).round(2)
summary.index = summary.index.astype(int)
summary[["for_sale", "for_rent"]] = summary[["for_sale", "for_rent"]].astype(int)

print(summary.to_string())
summary.to_csv("leuven_yield.csv")

Run it with python3 yield.py leuven_sale.json leuven_rent.json. It writes leuven_yield.csv with one row per bedroom count that appears in both searches.

Three things to watch. First, the README doesn't say what period a rent price covers. The script assumes a monthly rent, so open a few rent rows on zimmo.be before you trust the yield. Second, keep an eye on for_sale and for_rent: with three pages each, some bedroom counts will rest on two or three listings, and a median of two is barely a number. Third, gross yield ignores costs, vacancy and taxes, and it's built from asking prices and asking rents rather than closed deals, so treat it as a first filter, not an investment case.

The bundled sample only has sale listings, so it can't produce a yield on its own. Its six apartments do give the sale side: the median asking price is €360,000 for the four two-bedroom flats and €432,000 for the two three-bedroom ones.

Limits worth knowing

  • Search-results pages only. No detail pages, so no full descriptions, agency details or coordinates.
  • Only a headful browser on a residential (Belgian or German) connection, or the Scraping Browser API, was served in the README's tests.
  • New-build project prices are the cheapest unit, a lower bound.
  • On the French site, running past the last page ends as partial (exit 6).
  • The weekly canary was last green on 2026-10-21; later runs failed at the proxy pre-check with HTTP 407, before reaching zimmo.be.
  • The Docker image runs headless, so on its own it will be challenged; use it with --cdp-endpoint.

Scraping Zimmo legally and politely

Collect public listing data only, read Zimmo's terms of service and robots.txt first, and keep the request rate low with --delay. The scraper reads public search pages and doesn't log in. Property listings are closer to personal data than product listings: the location column can be a private seller's home address, so under the GDPR you need a lawful basis to store it. For a yield analysis you don't need it at all, so drop or truncate location to the postcode before you save anything long-term. Listing photos and texts can also be protected by copyright.

FAQ

Does Zimmo have a public API?

Not one this scraper uses. It reads the same search pages a visitor sees, rendered in a real browser, because Zimmo's listing data isn't in any structured block on the page.

Why does Zimmo block headless browsers and servers?

Cloudflare. In the README's tests, every datacentre attempt and every headless attempt was challenged, while a headful browser on a Belgian or German residential connection was served.

How do I scrape Zimmo from a server?

Use xvfb-run -a for a virtual display plus either a residential proxy in ZIMMO_PROXY or the 2Captcha Scraping Browser API in ZIMMO_CDP_ENDPOINT. A server's own IP gets the Cloudflare challenge.

Can I scrape Zimmo rental listings?

Yes. Use a te-huur URL on the Dutch site or a-louer on the French site; listing_type is set to rent. Check the period a rent price covers before comparing it with sale prices.

Can I track Zimmo prices over time?

Yes. Run the same search on two dates and compare with python3 diff_runs.py --old run1.json --new run2.json. It refuses incomplete runs and different searches, and a listing missing from a capped run is reported as having left the selection, not as removed.

How much does it cost to scrape Zimmo?

A run from your own residential connection in Belgium or Germany costs nothing. The Scraping Browser API, residential proxies and CAPTCHA solves are paid 2Captcha services, so check current prices, and use --proxy-budget-mb to cap proxy traffic.

Where to go next

Swap Leuven for your own city, or add a second city's searches and compare yields side by side. The code, the access matrix and every measurement quoted here are in the zimmo-scraper repository on GitHub, and there are details and more scrapers on the Zimmo Scraper page at 2scraper.com. 2Captcha's guide How to scrape Zimmo is the full reference of all options. If you need to run from a server rather than your laptop, that's the point to set up a 2Captcha key and a Belgian Scraping Browser profile.

No comments yet. Be the first to comment.