# Kleinanzeigen Real Estate Crawler (`yogen48-owner/kleinanzeigen-scraper`) Actor

Extract comprehensive German real estate data from kleinanzeigen.de for market analysis and investment research.

- **URL**: https://apify.com/yogen48-owner/kleinanzeigen-scraper.md
- **Developed by:** [Yogendra Tamang](https://apify.com/yogen48-owner) (community)
- **Categories:** Real estate
- **Stats:** 18 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

$30.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#rental-actors

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Kleinanzeigen Real Estate Scraper

A comprehensive Apify Actor for extracting German real estate listings from kleinanzeigen.de, providing detailed property information for market analysis, investment research, and property valuation. Designed specifically for real estate professionals, investors, and market researchers.

### 🏠 Features

- **Comprehensive Property Data**: Extract detailed property specifications, financial information, and energy efficiency data
- **Multi-City Analysis**: Compare real estate markets across German cities and regions
- **Two-Stage Extraction**: Basic listing data + detailed property information from individual pages
- **Financial Intelligence**: Complete cost breakdown including Hausgeld, commission, and additional costs
- **Energy Efficiency Analysis**: Extract energy consumption, efficiency ratings, and heating information
- **Market Research Ready**: Pre-configured dataset views for different analysis needs
- **Scalable Architecture**: Handle large-scale property data extraction efficiently

### 📊 Extracted Property Data

#### Basic Listing Information

| Field | Description | Example |
|-------|-------------|---------|
| `id` | Unique property identifier | "2751234567" |
| `name` | Property title | "3-Zimmer-Wohnung mit Balkon" |
| `price` | Listed price | "320.000 €" |
| `area` | Property area (from listing) | "85 m²" |
| `rooms` | Room count (from listing) | "3 Zimmer" |
| `location` | City/district | "28195 Bremen" |
| `url` | Direct link to property | "https://www.kleinanzeigen.de/..." |

#### Detailed Property Information

| Field | Description | Example |
|-------|-------------|---------|
| `living_area` | Exact living space | "85 m²" |
| `plot_area` | Land/plot size | "400 m²" |
| `total_rooms` | Total number of rooms | "4" |
| `bedrooms` | Number of bedrooms | "2" |
| `bathrooms` | Number of bathrooms | "1" |
| `built_year` | Construction year | "1995" |
| `floor` | Floor level | "2. Obergeschoss" |

#### Financial Information

| Field | Description | Example |
|-------|-------------|---------|
| `hausgeld` | Monthly building fees | "180 €" |
| `commission` | Broker commission | "3,57%" |
| `additional_costs` | Nebenkosten (utilities) | "120 €" |
| `heating_costs` | Monthly heating costs | "80 €" |

#### Energy & Technical Data

| Field | Description | Example |
|-------|-------------|---------|
| `energy_consumption` | Energy usage | "85 kWh/(m²·a)" |
| `energy_efficiency_class` | Energy rating | "C" |
| `energy_certificate` | Certificate details | "Energieausweis vorhanden" |
| `heating_type` | Heating system | "Zentralheizung" |

#### Property Features

| Field | Description | Example |
|-------|-------------|---------|
| `condition` | Property condition | "Modernisiert" |
| `balcony` | Balcony available | "Ja" |
| `garden` | Garden available | "Nein" |
| `garage` | Garage/parking | "Tiefgarage" |
| `basement` | Basement available | "Ja" |
| `equipment` | Kitchen/furnishing | "Einbauküche" |

### 🔧 Input Configuration

#### Required Parameters

- **Categories**: Array of property categories with URLs and page limits

#### Optional Parameters

- **Extract Details**: Enable detailed property information extraction (default: true)
- **Max Pages**: Global page limit per category (default: 5)
- **Max Results**: Total item limit across categories (default: 1000)
- **Field Config**: Custom XPath selectors for data extraction

### 🏘️ Property Categories & Locations

#### Real Estate Categories

```json
{
  "categories": [
    {
      "category": "apartment_purchase",
      "url": "https://www.kleinanzeigen.de/s-wohnung-kaufen/berlin/c196l3331",
      "pages": 5
    },
    {
      "category": "house_purchase", 
      "url": "https://www.kleinanzeigen.de/s-haus-kaufen/berlin/c208l3331",
      "pages": 5
    },
    {
      "category": "apartment_rental",
      "url": "https://www.kleinanzeigen.de/s-wohnung-mieten/berlin/c203l3331",
      "pages": 3
    }
  ]
}
```

#### Major German Cities (Location IDs)

- **Berlin**: `l3331`
- **Munich**: `l6411`
- **Hamburg**: `l9409`
- **Cologne**: `l5467`
- **Frankfurt**: `l5585`
- **Stuttgart**: `l8756`
- **Düsseldorf**: `l5196`
- **Dortmund**: `l4998`
- **Essen**: `l5230`
- **Leipzig**: `l1466`

#### Category Codes

- **Apartment Purchase**: `c196`
- **House Purchase**: `c208`
- **Apartment Rental**: `c203`
- **House Rental**: `c205`
- **Commercial Real Estate**: `c277`

### 📋 Usage Examples

#### Basic Property Market Analysis

```json
{
  "categories": [
    {
      "category": "berlin_apartments",
      "url": "https://www.kleinanzeigen.de/s-wohnung-kaufen/berlin/c196l3331",
      "pages": 10
    }
  ],
  "extractDetails": true,
  "maxResults": 500
}
```

#### Multi-City Investment Analysis

```json
{
  "categories": [
    {
      "category": "munich_apartments",
      "url": "https://www.kleinanzeigen.de/s-wohnung-kaufen/muenchen/c196l6411",
      "pages": 8
    },
    {
      "category": "hamburg_apartments", 
      "url": "https://www.kleinanzeigen.de/s-wohnung-kaufen/hamburg/c196l9409",
      "pages": 8
    },
    {
      "category": "cologne_apartments",
      "url": "https://www.kleinanzeigen.de/s-wohnung-kaufen/koeln/c196l5467", 
      "pages": 8
    }
  ],
  "maxPages": 10,
  "maxResults": 2000
}
```

#### Rental Market Research

```json
{
  "categories": [
    {
      "category": "berlin_rentals",
      "url": "https://www.kleinanzeigen.de/s-wohnung-mieten/berlin/c203l3331",
      "pages": 15
    },
    {
      "category": "munich_rentals",
      "url": "https://www.kleinanzeigen.de/s-wohnung-mieten/muenchen/c203l6411", 
      "pages": 15
    }
  ],
  "extractDetails": true,
  "maxResults": 1500
}
```

#### Luxury Properties Analysis

```json
{
  "categories": [
    {
      "category": "luxury_houses_munich",
      "url": "https://www.kleinanzeigen.de/s-haus-kaufen/muenchen/preis:500000:10000000/c208l6411",
      "pages": 5
    }
  ],
  "extractDetails": true,
  "maxResults": 200
}
```

### 📊 Dataset Views for Real Estate Analysis

#### 1. **Overview**

Complete property data with basic and detailed information for comprehensive analysis.

#### 2. **Basic Listing Data**

Quick overview of properties without detailed extraction - perfect for initial market scanning.

#### 3. **Apartments Only**

Filtered view showing only apartment listings with room breakdowns and detailed information.

#### 4. **Houses Only**

Dedicated view for single-family homes, townhouses, and standalone properties.

#### 5. **Financial Analysis**

Focused on investment metrics: prices, Hausgeld, commission, additional costs, and cost per m².

#### 6. **Complete Property Details**

Comprehensive view with all 25+ extracted fields for detailed property evaluation.

#### 7. **Energy Efficiency Analysis**

Environmental and energy cost analysis including efficiency ratings and heating systems.

### 🔄 How It Works

1. **Category Setup**: Define property categories, cities, and page limits
2. **Listing Extraction**: Scrape property listings from category pages
3. **Detail Crawling**: Visit individual property pages for comprehensive data
4. **Data Processing**: Extract structured information using German-to-English mapping
5. **Quality Enhancement**: Clean and standardize property data
6. **Multi-View Output**: Generate specialized dataset views for different analyses

### 💡 Real Estate Use Cases

#### **Investment Analysis**

- **ROI Calculation**: Complete cost breakdown for investment property analysis
- **Market Comparison**: Compare properties across different cities and neighborhoods
- **Price per m² Analysis**: Standardized pricing metrics for market evaluation
- **Cash Flow Modeling**: Extract rental income potential and operating costs

#### **Market Research**

- **Price Trends**: Track pricing changes across different property types and locations
- **Inventory Analysis**: Monitor available properties and market supply
- **Neighborhood Intelligence**: Compare property features and pricing by area
- **Competition Analysis**: Understand pricing strategies and market positioning

#### **Property Valuation**

- **Comparable Sales**: Find similar properties for valuation purposes
- **Feature Analysis**: Understand how property features affect pricing
- **Age and Condition Impact**: Analyze how building age and condition affect values
- **Energy Efficiency Premium**: Quantify value of energy-efficient properties

#### **Development Planning**

- **Land Value Analysis**: Extract plot sizes and land pricing information
- **Renovation Potential**: Identify properties with modernization opportunities
- **Zoning Research**: Understand property types and development patterns
- **Infrastructure Analysis**: Correlate property values with location amenities

### ⚡ Performance Optimization

#### **Efficient Configuration**

- **Start Small**: Begin with 2-3 pages per category for testing
- **Target Specific Areas**: Use precise location codes for focused analysis
- **Optimize Detail Extraction**: Disable for basic market overviews, enable for investment analysis
- **Batch Processing**: Run multiple smaller jobs for large-scale market research

#### **Cost Management**

- **Smart Limits**: Set appropriate `maxResults` based on analysis needs
- **Category Focus**: Target specific property types relevant to your research
- **Time Windows**: Consider running during off-peak hours for better performance

### 🛠️ Technical Specifications

- **Built on Apify Platform**: Enterprise-grade scraping infrastructure
- **Async Processing**: Efficient handling of large property datasets
- **Error Recovery**: Robust handling of individual page failures
- **Rate Limiting**: Respectful scraping with built-in delays
- **Memory Efficient**: Optimized for large-scale property data extraction
- **Data Quality**: Comprehensive cleaning and standardization

### 🎯 Advanced Features

#### **Custom Field Extraction**

Modify XPath selectors for specific property types or new website changes:

```json
{
  "fieldConfig": {
    "custom_field": ".//div[@class='specific-selector']/text()",
    "special_feature": ".//span[contains(@class, 'feature')]/text()"
  }
}
```

#### **URL Pattern Construction**

Build custom URLs for specific searches:

- **Price Range**: Add `/preis:100000:500000/` for price filtering
- **Property Type**: Use specific category codes (c196, c208, etc.)
- **Location**: Combine city codes with postal codes for precise targeting

### 📈 Data Export & Integration

#### **Export Formats**

- **CSV**: Perfect for Excel analysis and financial modeling
- **JSON**: Direct integration with analytics tools and databases
- **API Access**: Real-time data integration with existing systems

#### **Integration Examples**

- **Property Management Systems**: Bulk import of market data
- **Investment Platforms**: Automated property discovery and analysis
- **Market Research Tools**: Feed data into specialized real estate analytics
- **Valuation Software**: Comparable property data for automated valuations

### 🚨 Compliance & Best Practices

#### **Legal Considerations**

- **Terms of Service**: Ensure compliance with kleinanzeigen.de terms
- **Data Protection**: Follow GDPR requirements for data handling
- **Rate Limiting**: Built-in respectful scraping practices
- **Commercial Use**: Verify licensing for commercial real estate applications

#### **Ethical Usage**

- **Market Research**: Use data for legitimate real estate analysis
- **Fair Competition**: Respect competitor privacy and business practices
- **Data Accuracy**: Verify critical information through official sources
- **User Privacy**: Handle contact information responsibly

### 📞 Support & Customization

For real estate-specific customizations, advanced filtering, or integration support:

- Review Actor logs for troubleshooting extraction issues
- Test with smaller datasets before large-scale market analysis
- Contact through Apify platform for enterprise requirements
- Check documentation for updates to property website structure

### 📜 License

Professional real estate data extraction tool for the Apify platform. Users responsible for compliance with applicable real estate data regulations and platform terms of service.

# Actor input Schema

## `categories` (type: `array`):

List of categories with URLs and page limits

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

Maximum number of pages to scrape for each category

## `maxResults` (type: `integer`):

Maximum total number of items to scrape across all categories

## `extractDetails` (type: `boolean`):

Enable extraction of detailed property information from individual listing pages (slower but more comprehensive)

## Actor input object example

```json
{
  "categories": [
    {
      "category": "apartment",
      "url": "https://www.kleinanzeigen.de/s-wohnung-kaufen/bremen/c196l1",
      "pages": 5
    },
    {
      "category": "house",
      "url": "https://www.kleinanzeigen.de/s-haus-kaufen/bremen/c208l1",
      "pages": 5
    }
  ],
  "maxPages": 5,
  "maxResults": 1000,
  "extractDetails": true
}
```

# 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 = {
    "categories": [
        {
            "category": "apartment",
            "url": "https://www.kleinanzeigen.de/s-wohnung-kaufen/bremen/c196l1",
            "pages": 5
        },
        {
            "category": "house",
            "url": "https://www.kleinanzeigen.de/s-haus-kaufen/bremen/c208l1",
            "pages": 5
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("yogen48-owner/kleinanzeigen-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 = { "categories": [
        {
            "category": "apartment",
            "url": "https://www.kleinanzeigen.de/s-wohnung-kaufen/bremen/c196l1",
            "pages": 5,
        },
        {
            "category": "house",
            "url": "https://www.kleinanzeigen.de/s-haus-kaufen/bremen/c208l1",
            "pages": 5,
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("yogen48-owner/kleinanzeigen-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "categories": [
    {
      "category": "apartment",
      "url": "https://www.kleinanzeigen.de/s-wohnung-kaufen/bremen/c196l1",
      "pages": 5
    },
    {
      "category": "house",
      "url": "https://www.kleinanzeigen.de/s-haus-kaufen/bremen/c208l1",
      "pages": 5
    }
  ]
}' |
apify call yogen48-owner/kleinanzeigen-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=yogen48-owner/kleinanzeigen-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/sLJW6nMaOqxKDyCqc/builds/Im1xoKJKnvNdIGT1H/openapi.json
