# Willhaben.at Immobilien Scraper (Austria) (`stone_jadex/willhaben-immobilien-scraper`) Actor

Public Willhaben Immobilien listings (rent/sale): price, area, rooms, district, seller, photos, URL. First version is Immobilien only — not the full Willhaben site. No start fee.

- **URL**: https://apify.com/stone_jadex/willhaben-immobilien-scraper.md
- **Developed by:** [Stone Jade](https://apify.com/stone_jadex) (community)
- **Categories:** Real estate
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.43 / 1,000 list-tier listings

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

## Willhaben.at Immobilien Scraper (Austria)

Extract structured real estate listings from **Willhaben.at Immobilien**, Austria's largest property marketplace, directly into JSON, CSV, Excel, or API pipelines. Collect asking rents and sale prices, price per square metre, living area, room counts, Austrian district and postcode hierarchies, seller and agency details, image URLs, and optional full detail-page descriptions, coordinates, and public agency contacts—with **zero run-start fees** and lightweight 256 MB HTTP execution.

***

### Overview & Key Features

**Willhaben.at Immobilien Scraper** parses public Willhaben Immobilien search result pages (`/iad/immobilien/...`) and individual advert pages (`/iad/immobilien/d/...`) directly from structured Next.js page payloads (`__NEXT_DATA__` and fast `/_next/data/<buildId>/...json` pagination) with automatic `buildId` refresh on `404` and a lightweight HTML fallback parser.

**Immobilien only (v0.1):** This release focuses exclusively on Willhaben's real estate vertical (apartments, houses, commercial, and land for rent or sale under `/iad/immobilien/`). Marketplace goods (`kaufen-und-verkaufen`), cars (`gebrauchtwagen`), and jobs (`jobs`) are outside the scope of this Actor.

#### Key Capabilities

- **Zero start fee, flat transparent pricing**: Both list-tier (`listing`) and detail-tier (`listing-detail`) events cost **$0.0005** per result (**$0.50** per 1,000 listings on the Free tier, with 5%–15% Apify Store subscription discounts for Bronze through Diamond), with **$0.00** start fee.
- **Fast list tier + optional detail enrichment**: Leave `scrapeDetails` off to pull ~30 listings per search page with core fields (`listingId`, `title`, `price`, `currency`, `pricePerSquareMeter`, `area`, `rooms`, `floor`, `propertyType`, `city`, `district`, `postcode`, `address`, `lat`, `lon`, `seller`, `agency`, `isPrivateOwner`, `photos`, `dateCreated`, `url`). Turn `scrapeDetails` on—or pass direct `/iad/immobilien/d/...` URLs—to enrich each row with full `description`, `descriptionHtml`, `transaction`, `availableFrom`, `dateModified`, and public business contacts (`phones`, `emails`).
- **Built-in privacy filtering (Privacy Policy A)**: Public business agency and brokerage phones/emails published on detail pages are preserved, while purely private seller phone numbers and email addresses are automatically stripped (`isPrivateOwner: true` rows always output empty `phones: []` and `emails: []`).
- **Page-ordered output & graceful truncation**: Even when `concurrency` is set up to `3`, listings are emitted in page order, duplicate `listingId` entries across overlapping seeds are skipped without charging, and early stops append a single uncharged `recordType: "run-notice"` row alongside a complete `OUTPUT` summary in the Key-Value Store.

#### Common Use Cases

- **Austrian rental & purchase benchmarking**: Track asking rents and sale prices (`price`, `pricePerSquareMeter`) across Vienna's 23 Bezirke, Graz, Linz, Salzburg, Innsbruck, or any custom Willhaben Immobilien filter URL.
- **Agency vs. private-seller inventory analysis**: Separate commercial real estate agencies (`agency`, `isPrivateOwner: false`) from private landlord/owner adverts (`seller: "Privat"`, `isPrivateOwner: true`).
- **Geospatial mapping & commute modeling**: Combine `lat`, `lon`, `postcode`, `district`, and `address` with `area`, `rooms`, and `floor` to build Austrian neighbourhood price heatmaps.
- **Portfolio & market monitoring workflows**: Schedule recurring runs via Apify Schedules or API webhooks to track price shifts, newly listed stock (`dateCreated`), and listing updates (`dateModified`).

***

### Input Configuration

All input fields are optional. Running with an empty input (`{}`) defaults to the public Vienna rental apartments search (`https://www.willhaben.at/iad/immobilien/mietwohnungen/wien`) for up to `50` list-tier listings.

| Parameter | Type | Default | Constraints | Description |
| --- | --- | --- | --- | --- |
| `startUrls` | `array<object \| string>` | Default Vienna Mietwohnungen URL | Public `willhaben.at` `/iad/immobilien/...` or `/iad/immobilien/d/...` URLs | Search result URLs or direct listing URLs. Accepts Request List `{ "url": "..." }` objects or plain URL strings. Empty input uses `https://www.willhaben.at/iad/immobilien/mietwohnungen/wien`. |
| `maxItems` | `integer` | `50` | Min `1`, Max `2000` | Maximum number of charged listings to store across all seeds before stopping cleanly. |
| `maxPages` | `integer` | `null` (unlimited) | Min `1`, Max `2000` | Optional cap on search result pages fetched per list seed (~30 listings per page). |
| `startPage` | `integer` | `1` | Min `1`, Max `2000` | First search page number when the start URL does not already include `?page=N`. |
| `scrapeDetails` | `boolean` | `false` | `true` / `false` | Opens each listing's public detail page to add full `description`, `descriptionHtml`, `transaction`, `availableFrom`, `dateModified`, and public agency `phones`/`emails`. Charged as `listing-detail` instead of `listing`. Failed detail fetches fall back to the list row (`detailError`) charged as `listing`. |
| `requestDelayMs` | `integer` | `1200` | Min `1200` | Minimum interval in milliseconds between HTTP request starts. A `Crawl-delay` directive in `robots.txt` can only raise this gap. |
| `concurrency` | `integer` | `1` | Min `1`, Max `3` | Maximum search or detail requests in flight simultaneously. Rows are still emitted in page order while maintaining at least `requestDelayMs` between request starts. |
| `maxRunSeconds` | `integer` | `3600` | Min `30` | Graceful run-time budget in seconds. Stops cleanly ahead of platform timeout, writes `OUTPUT`, and appends an uncharged `run-notice` row when truncated. |
| `proxyConfiguration` | `object` | `{ "useApifyProxy": false }` | Apify Proxy config | Direct connection by default. If a `RESIDENTIAL` proxy group is configured, total proxy transfer is strictly capped at a fixed **5 MB per run** (not user-tunable). |
| `useProxyFallback` | `boolean` | `false` | `true` / `false` | When a proxy is configured, remain on a direct connection until repeated HTTP `403` or `429` responses occur, then switch to the configured proxy. Recommended whenever using residential proxies. |
| `allowDetailOnResidential` | `boolean` | `false` | `true` / `false` | When using a `RESIDENTIAL` proxy group, detail pages stay on direct connections by default to conserve bandwidth. Enable only if detail pages should also use the residential proxy within the 5 MB cap. |

#### Example 1: List-Tier Search (Vienna Rental Apartments)

Fast list-tier collection of up to 150 Vienna Mietwohnungen listings directly from Willhaben search pages without opening individual detail pages:

```json
{
  "startUrls": [
    {
      "url": "https://www.willhaben.at/iad/immobilien/mietwohnungen/wien"
    }
  ],
  "maxItems": 150,
  "maxPages": 5,
  "startPage": 1,
  "scrapeDetails": false,
  "requestDelayMs": 1200,
  "concurrency": 1,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

#### Example 2: Detail-Tier Search & Direct Listing URLs

Combine an Austrian apartments-for-sale search (`eigentumswohnung`) with a direct listing URL in detail mode to capture full descriptions, transaction type, availability date, and public brokerage phone numbers:

```json
{
  "startUrls": [
    {
      "url": "https://www.willhaben.at/iad/immobilien/d/mietwohnungen/wien/wien-1220-donaustadt/3-zimmer-neubauwohnung-mit-grosser-terrasse-in-der-seestadt-zu-vermieten-1104442600"
    },
    {
      "url": "https://www.willhaben.at/iad/immobilien/eigentumswohnung/wien"
    }
  ],
  "maxItems": 100,
  "scrapeDetails": true,
  "requestDelayMs": 1500,
  "concurrency": 2,
  "maxRunSeconds": 1800,
  "useProxyFallback": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

***

### Output Data & Dataset Schema

#### Preview Table

The table below shows sample rows based on the `2026-10-26` test fixture snapshot alongside illustrative values to demonstrate the output structure. Live results vary depending on what each advertiser publishes on Willhaben.at.

| Listing ID | Title | Price | Currency | Area (m²) | Rooms | District | Seller |
| --- | --- | ---: | --- | ---: | ---: | --- | --- |
| `1070853768` | Toplage! Ruhige 1-Zimmerwohnung in gepflegter Wohnhausanlage nähe Türkenschanzpark | 799 | EUR | 39 | 1 | Wien, 18. Bezirk, Währing | Privat |
| `1104442600` | 3 Zimmer Neubauwohnung mit großer Terrasse in der Seestadt zu vermieten | 1,598 | EUR | 72.16 | 3 | Wien, 22. Bezirk, Donaustadt | Hofer Realitäten GmbH |
| `1234567890` | Example 3-room apartment near the city center (illustrative) | 1,250 | EUR | 72 | 3 | Wien, 10. Bezirk, Favoriten | Example Real Estate GmbH |

#### Illustrative JSON Output Example (Detail Tier)

The JSON record below matches `.actor/dataset_schema.json` using the `2026-10-26` agency detail fixture format (private-seller rows like `1070853768` output `isPrivateOwner: true`, `agency: null`, `phones: []`, `emails: []`):

```json
{
  "listingId": "1104442600",
  "title": "3 Zimmer Neubauwohnung mit großer Terrasse in der Seestadt zu vermieten",
  "price": 1598,
  "currency": "EUR",
  "pricePerSquareMeter": 22.145231,
  "area": 72.16,
  "rooms": 3,
  "floor": null,
  "propertyType": "Wohnung",
  "transaction": "Miete",
  "city": "Wien",
  "district": "Wien, 22. Bezirk, Donaustadt",
  "postcode": "1220",
  "address": "Burgkmairgasse 51/15",
  "lat": 48.23498,
  "lon": 16.52047,
  "seller": "Hofer Realitäten GmbH",
  "agency": "Hofer Realitäten GmbH",
  "isPrivateOwner": false,
  "phones": [
    "0043(699)19469582",
    "004319469590"
  ],
  "emails": [],
  "photos": [
    "https://cache.willhaben.at/mmo/0/110/444/2600_-573263565_hoved.jpg",
    "https://cache.willhaben.at/mmo/0/110/444/2600_-1792034911_hoved.jpg"
  ],
  "description": "traumhafte 3 Zimmer Wohnung in der Seestadt. Diese Wohnung besteht aus einem Vorraum, Wohnküche, 2 Zimmer, Bad mit Dusche und Waschmaschine.",
  "descriptionHtml": "<p>traumhafte 3 Zimmer Wohnung in der Seestadt</p>",
  "url": "https://www.willhaben.at/iad/immobilien/d/mietwohnungen/wien/wien-1220-donaustadt/3-zimmer-neubauwohnung-mit-grosser-terrasse-in-der-seestadt-zu-vermieten-1104442600",
  "seoPath": null,
  "dateCreated": "2026-10-11T16:51:22+0200",
  "dateModified": "2026-10-25T16:51:22+0100",
  "availableFrom": "01.12.2026",
  "page": 1,
  "position": 2,
  "listUrl": "https://www.willhaben.at/iad/immobilien/mietwohnungen/wien?page=1",
  "tier": "detail",
  "scrapedAt": "2026-10-26T00:00:00.000Z"
}
```

#### Full Dataset Field Reference

Every property declared in `.actor/dataset_schema.json` is listed below. Fields may be `null` or omitted when unpublished by the source or when not applicable to the row tier (`list`, `detail`, or `run-notice`).

| Field | Type | Tier | Description |
| --- | --- | --- | --- |
| `listingId` | `string \| null` | List, Detail | Stable Willhaben numeric advert ID from the list card or detail page (e.g. `"1070853768"`). |
| `title` | `string \| null` | List, Detail | Listing title as published; `null` only on sparse HTML fallback rows. |
| `price` | `number \| null` | List, Detail | Monthly rent or sale asking price parsed from Willhaben attributes (`RENT/PER_MONTH_LETTINGS`, `RENTAL_PRICE/PER_MONTH`, or `PRICE`). |
| `currency` | `string \| null` | List, Detail | Currency code (`"EUR"` when a price is parsed; `null` when unavailable). |
| `pricePerSquareMeter` | `number \| null` | List, Detail | Published price per square metre (`PRICE/SQUARE_METER`). |
| `area` | `number \| null` | List, Detail | Living area in square metres (`ESTATE_SIZE/LIVING_AREA` or `ESTATE_SIZE`). |
| `rooms` | `number \| null` | List, Detail | Number of rooms (`NUMBER_OF_ROOMS`, `NO_OF_ROOMS`, or `ROOMS`). |
| `floor` | `string \| null` | List, Detail | Floor label as published (e.g. `"3"`, `"EG"`), or `null`. |
| `propertyType` | `string \| null` | List, Detail | Property type label published by Willhaben (e.g. `"Wohnung"`, `"Haus"`). |
| `transaction` | `string \| null` | Detail | Transaction or ownership type from the detail page (`OWNAGETYPE`, e.g. `"Miete"`, `"Eigentum"`); absent on list-tier rows. |
| `city` | `string \| null` | List, Detail | City, province, or municipality label (`STATE`, `municipality`, or `province`). |
| `district` | `string \| null` | List, Detail | District or location text (`LOCATION`, `postalName`, or `DISTRICT`, e.g. `"Wien, 18. Bezirk, Währing"`). |
| `postcode` | `string \| null` | List, Detail | Austrian postal code string as published (e.g. `"1180"`). |
| `address` | `string \| null` | List, Detail | Street address when published by the advertiser. |
| `lat` | `number \| null` | List, Detail | Latitude coordinate parsed from `COORDINATES`, or `null`. |
| `lon` | `number \| null` | List, Detail | Longitude coordinate parsed from `COORDINATES`, or `null`. |
| `seller` | `string \| null` | List, Detail | Seller or advertiser label as published (e.g. `"Privat"` or agency name). |
| `agency` | `string \| null` | List, Detail | Commercial agency/company name; `null` for private sellers (`isPrivateOwner: true`). |
| `isPrivateOwner` | `boolean \| null` | List, Detail | `true` when the listing belongs to a private seller; `false` for commercial advertisers; `null` on sparse HTML fallbacks. |
| `phones` | `array<string> \| null` | Detail (empty `[]` on List/Private) | Public business phone numbers from commercial detail pages; always `[]` for private owners under Privacy Policy A. |
| `emails` | `array<string> \| null` | Detail (empty `[]` on List/Private) | Public business email addresses from commercial detail pages or descriptions; always `[]` for private owners. |
| `photos` | `array<string> \| null` | List, Detail | Array of public Willhaben listing photo URLs (`cache.willhaben.at/mmo/...`). |
| `description` | `string \| null` | Detail | Plain-text property description from the detail page with HTML stripped; `null` on list-tier rows. |
| `descriptionHtml` | `string \| null` | Detail | Raw HTML property description from the detail page; absent on list-tier rows. |
| `url` | `string \| null` | List, Detail | Canonical public Willhaben Immobilien listing URL (`/iad/immobilien/d/...`). |
| `seoPath` | `string \| null` | List, Detail | Relative SEO slug (`SEO_URL`) published for the listing, or `null`. |
| `dateCreated` | `string \| null` | List, Detail | Published or first-seen timestamp string (`PUBLISHED_String` on list; `firstPublishedDate`/`publishedDate` on detail). |
| `dateModified` | `string \| null` | Detail | Last modified timestamp (`changedDate`) from the detail page; absent on list-tier rows. |
| `availableFrom` | `string \| null` | Detail | Availability date text (`AVAILABLE_DATE`) from the detail page; absent on list-tier rows. |
| `page` | `integer \| null` | List, Detail (from list) | Search results page number where the listing was found; absent on direct detail seeds. |
| `position` | `integer \| null` | List, Detail (from list) | One-based position of the listing on its search results page; absent on direct detail seeds. |
| `listUrl` | `string \| null` | List, Detail | Search URL (with `?page=N`) where the listing was discovered, or the direct detail URL for detail seeds. |
| `tier` | `string \| null` | List, Detail | Extraction tier: `"list"` or `"detail"` (`run-notice` rows do not set `tier`). |
| `scrapedAt` | `string \| null` | List, Detail | ISO 8601 UTC timestamp recording when the row was scraped. |
| `detailError` | `string \| null` | List (fallback) | Present only when `scrapeDetails: true` failed for that listing and the list-tier row was preserved instead. |
| `recordType` | `string \| null` | Run-notice | Set to `"run-notice"` on the final uncharged truncation row; absent on listing rows. |
| `truncatedAfter` | `integer \| null` | Run-notice | Count of charged listing rows saved before the truncated run stopped. |
| `reason` | `string \| null` | Run-notice | Stop reason for truncated runs (`"maxItems"`, `"max-charge-reached"`, `"run-time-limit"`, `"proxy-budget"`, `"cloudflare-challenge"`, `"empty-page"`, or `"errors"`). |

#### Dataset Views & Key-Value Store Summary

- **Dataset Views**: Includes a pre-configured **Overview** (`overview`) table in Apify Console displaying `listingId`, `title`, `price`, `currency`, `area`, `rooms`, `district`, `seller`, `tier`, and clickable `url`. Export datasets cleanly to JSON, CSV, Excel, XML, or Parquet.
- **Key-Value Store — `OUTPUT`**: Every run writes a full `OUTPUT` JSON summary recording normalized input, pricing events, seed progress, `siteTotalEntries`, `pushed` counts, `listSource` (`json` vs `html`), `buildIdRefreshes`, `unavailableFields`, `http` transfer/proxy stats, `robots` stats, `robotsDisallowedHits`, `errors`, `stopReason`, and `truncated`.

***

### Pricing & Apify Store Tier Discounts

This Actor uses **Pay-Per-Event (PPE)** billing in **USD** (live pricing verified `2026-11-21`) with **no run-start fee** (`$0.00`). Apify Store subscription plans automatically apply **5% to 15% tier discounts** on every event:

| Event | Description | Free | Bronze (5% off) | Silver (10% off) | Gold (15% off) | Platinum (15% off) | Diamond (15% off) |
| --- | --- | ---: | ---: | ---: | ---: | ---: | ---: |
| `listing` | One Willhaben Immobilien listing from a search results page | `$0.0005` (`$0.50`/1k) | `$0.000475` (`$0.475`/1k) | `$0.00045` (`$0.45`/1k) | `$0.000425` (`$0.425`/1k) | `$0.000425` (`$0.425`/1k) | `$0.000425` (`$0.425`/1k) |
| `listing-detail` | One Immobilien listing enriched from its detail page (replaces `listing`) | `$0.0005` (`$0.50`/1k) | `$0.000475` (`$0.475`/1k) | `$0.00045` (`$0.45`/1k) | `$0.000425` (`$0.425`/1k) | `$0.000425` (`$0.425`/1k) | `$0.000425` (`$0.425`/1k) |

#### Cost Comparison & Billing Guarantees

- **~50% lower cost vs. benchmark**: On the Free tier, 1,000 Willhaben Immobilien listings cost **$0.50** (**$0.425** on Gold/Platinum/Diamond) with **$0.00** start fee—less than half the **$1.005** per 1,000 results benchmark of `azzouzana` (`$0.001` × 1,000 + `$0.005` start fee).
- **No double-charging on details**: `listing-detail` **replaces** `listing` for that advert; the two events are never charged together on the same row.
- **Graceful detail fallback**: If a detail page fails while `scrapeDetails: true`, the Actor keeps the list-tier row (with `detailError`) and charges only `listing`.
- **Zero charge on non-results**: Deduplicated listings, uncharged `run-notice` rows, and failed runs with zero scraped listings incur **$0.00** in event charges.
- Always review the live **Pricing** tab in Apify Console for any separately billed platform compute or storage usage.

***

### API & SDK Quickstart

Run **Willhaben.at Immobilien Scraper** (`Stone_JadeX/willhaben-immobilien-scraper`) programmatically from JavaScript or Python using the official Apify API client libraries.

#### JavaScript (Node.js) — `ApifyClient`

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({
    token: process.env.APIFY_TOKEN,
});

const run = await client.actor('Stone_JadeX/willhaben-immobilien-scraper').call({
    startUrls: [
        { url: 'https://www.willhaben.at/iad/immobilien/mietwohnungen/wien' },
    ],
    maxItems: 50,
    scrapeDetails: false,
    requestDelayMs: 1200,
    concurrency: 1,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
const listings = items.filter((row) => row.recordType !== 'run-notice');
console.log(`Collected ${listings.length} listings`);
for (const item of listings.slice(0, 5)) {
    console.log(item.listingId, item.title, item.price, item.currency, `${item.area} m2`);
}
```

#### Python — `ApifyClient`

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])

run = client.actor("Stone_JadeX/willhaben-immobilien-scraper").call(run_input={
    "startUrls": [
        {"url": "https://www.willhaben.at/iad/immobilien/mietwohnungen/wien"},
    ],
    "maxItems": 50,
    "scrapeDetails": False,
    "requestDelayMs": 1200,
    "concurrency": 1,
})

items = [
    row for row in client.dataset(run["defaultDatasetId"]).iterate_items()
    if row.get("recordType") != "run-notice"
]
print(f"Collected {len(items)} listings")
for item in items[:5]:
    print(item.get("listingId"), item.get("title"), item.get("price"), item.get("currency"), item.get("district"))
```

***

### FAQ, Compliance & Limitations

#### Is it legal to scrape Willhaben.at?

This Actor only reads publicly visible Immobilien pages the same way a normal browser does, without logging in or bypassing access controls. To respect individual privacy, private-seller phone numbers and email addresses are automatically stripped (`isPrivateOwner: true` rows never include `phones` or `emails`), keeping only public business contacts of commercial agencies. You are responsible for how you use the extracted data and for complying with applicable laws (such as GDPR) and Willhaben's terms. This is an independent tool and is not affiliated with Willhaben.

#### How does the Actor handle `robots.txt` and login/account pages?

At startup, the Actor fetches `https://www.willhaben.at/robots.txt`, parses `User-agent: *` rules, and honors any `Crawl-delay` value higher than `requestDelayMs`. Disallow directives are treated as warnings rather than silent blocks: a URL that robots.txt disallows is still requested, logged as a warning and counted in `robotsDisallowedHits`; login and account paths are always refused without being requested. Input URL validation also restricts `startUrls` strictly to public `willhaben.at` Immobilien search (`/iad/immobilien/...`) and detail (`/iad/immobilien/d/...`) paths, rejecting out-of-scope paths such as `/projekt`, `/verkaeuferprofil`, `/angebote`, `/alle-anzeigen`, or `/webshop`.

#### How do proxy fallback and the 5 MB residential cap work?

Direct connections (`proxyConfiguration.useApifyProxy: false`) are used by default. When you configure an Apify Proxy group:

- Turn on `useProxyFallback: true` to stay on direct connections until repeated HTTP `403` or `429` blocks trigger proxy fallback.
- If a `RESIDENTIAL` proxy group is used, total transferred proxy bandwidth is hard-capped at **5 MB per run** (not user-configurable). If the projected next request would exceed 5 MB, the run stops cleanly with `stopReason: "proxy-budget"`.
- When using a residential proxy group, detail pages remain on direct connections unless you explicitly set `allowDetailOnResidential: true`.

#### What are the main limitations?

- **Immobilien only (v0.1)**: Only Willhaben Immobilien rent and sale listings under `/iad/immobilien/` are supported; Marktplatz, Auto, and Jobs are excluded.
- **Ceiling vs. guarantee**: `maxItems` defaults to `50` and is capped at `2,000` (matching `maxPages` and `startPage`). Actual output depends on live search volume and site availability.
- **Tier-dependent fields**: Search cards omit `description`, `descriptionHtml`, `transaction`, `availableFrom`, `dateModified`, and contact `phones`/`emails`. Set `scrapeDetails: true` when you need those fields.
- **Anti-bot & snapshot semantics**: Cloudflare challenges (`HTTP 403`) stop the run cleanly with `stopReason: "cloudflare-challenge"`. Each run captures a point-in-time snapshot rather than live monitoring.

***

### Changelog

#### 0.1.2 — 2026-11-21

- Added explicit `prefill` defaults (`startUrls`, `maxItems`, `startPage`, `scrapeDetails`, `requestDelayMs`, `concurrency`, `maxRunSeconds`, `useProxyFallback`, `allowDetailOnResidential`) and organized `.actor/input_schema.json` into clear `sectionCaption` groups.
- Upgraded `README.md` to full Store documentation with complete 11-parameter input table + 2 JSON examples, illustrative detail JSON output, full 38-field dataset reference, live Pay-Per-Event pricing with Apify Store subscription tier discounts (Bronze through Diamond), JavaScript & Python `ApifyClient` SDK quickstarts, and aligned `robots.txt` warn-only compliance wording.

#### 0.1.1 — 2026-10-26

- Raised `maxItems` cap from `500` to `2000` (matching `maxPages` and `startPage`) to support 1,000-listing calibration runs.

#### 0.1.0 — 2026-10-26

- Initial Willhaben.at Immobilien scraper supporting list and optional detail tiers via `__NEXT_DATA__` / `_next/data`, automatic `buildId` refresh on `404`, Privacy Policy A contact filtering, fixed 5 MB residential proxy safety cap, and flat `$0.0005` PPE pricing with zero start fee.

# Changelog

This Actor's version history is a separate document: https://apify.com/stone_jadex/willhaben-immobilien-scraper/changelog.md

# Actor input Schema

## `startUrls` (type: `array`):

Optional. A Willhaben Immobilien search such as https://www.willhaben.at/iad/immobilien/mietwohnungen/wien, or a detail URL such as https://www.willhaben.at/iad/immobilien/d/.... Empty input uses the default Vienna Mietwohnungen search. First version: Immobilien only.

## `maxItems` (type: `integer`):

Stop after this many listings.

## `maxPages` (type: `integer`):

Optional. Each Immobilien search page has about 30 listings.

## `startPage` (type: `integer`):

First search page when the start URL does not already set ?page=.

## `scrapeDetails` (type: `boolean`):

Adds the full description, coordinates, and public agency phones. Charged as listing-detail instead of listing. If a detail page fails, the list row is kept and charged as listing. Keep off by default to stay under the tight cost cap.

## `requestDelayMs` (type: `integer`):

At least 1.2 seconds between request starts. A Crawl-delay in robots.txt can only raise this.

## `concurrency` (type: `integer`):

How many search or detail pages may be requested at once. Rows are saved in page order. At least 1.2 seconds still pass between request starts.

## `maxRunSeconds` (type: `integer`):

Stops cleanly and writes the OUTPUT record before this limit.

## `proxyConfiguration` (type: `object`):

Direct connection by default. A residential proxy is a fallback only (turn on useProxyFallback) and is capped at a fixed 5 MB per run. Do not force residential for this Actor's cost cap.

## `useProxyFallback` (type: `boolean`):

When a proxy is configured, stay on a direct connection until repeated HTTP 403 or 429 responses, then switch to that proxy. A residential proxy is meant to be used this way, as a fallback.

## `allowDetailOnResidential` (type: `boolean`):

Detail pages stay on a direct connection when the proxy group is residential. Turn this on only if those detail pages should use the residential proxy too.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.willhaben.at/iad/immobilien/mietwohnungen/wien"
    }
  ],
  "maxItems": 50,
  "startPage": 1,
  "scrapeDetails": false,
  "requestDelayMs": 1200,
  "concurrency": 1,
  "maxRunSeconds": 3600,
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "useProxyFallback": false,
  "allowDetailOnResidential": false
}
```

# Actor output Schema

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

Default dataset rows: list-tier and detail-tier listings, list rows kept after a detail failure, and an optional uncharged run-notice row when the run is truncated.

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

JSON summary with the echoed input, seeds, pushed counts, errors, stop reason, unavailable fields, HTTP and robots statistics, and pricing.

# 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 = {
    "startUrls": [
        {
            "url": "https://www.willhaben.at/iad/immobilien/mietwohnungen/wien"
        }
    ],
    "maxItems": 50,
    "startPage": 1,
    "scrapeDetails": false,
    "requestDelayMs": 1200,
    "concurrency": 1,
    "maxRunSeconds": 3600,
    "useProxyFallback": false,
    "allowDetailOnResidential": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("stone_jadex/willhaben-immobilien-scraper").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 = {
    "startUrls": [{ "url": "https://www.willhaben.at/iad/immobilien/mietwohnungen/wien" }],
    "maxItems": 50,
    "startPage": 1,
    "scrapeDetails": False,
    "requestDelayMs": 1200,
    "concurrency": 1,
    "maxRunSeconds": 3600,
    "useProxyFallback": False,
    "allowDetailOnResidential": False,
}

# Run the Actor and wait for it to finish
run = client.actor("stone_jadex/willhaben-immobilien-scraper").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 '{
  "startUrls": [
    {
      "url": "https://www.willhaben.at/iad/immobilien/mietwohnungen/wien"
    }
  ],
  "maxItems": 50,
  "startPage": 1,
  "scrapeDetails": false,
  "requestDelayMs": 1200,
  "concurrency": 1,
  "maxRunSeconds": 3600,
  "useProxyFallback": false,
  "allowDetailOnResidential": false
}' |
apify call stone_jadex/willhaben-immobilien-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,stone_jadex/willhaben-immobilien-scraper"
        }
    }
}
```

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/hkdLh3tGG711g4fc7/builds/AiPOBUtH5fRBHvwT3/openapi.json
