Skip to main content

Scrapes rental properties listed on www.immoscout24.de

Project description

immoscout-scraper

Release Build status License

Scrapes rental properties listed on <www.immoscout24.de>

Installation

Using uv (recommended)

git clone https://github.com/libklein/immoscout-scraper.git
cd immoscout-scraper
uv sync

Using pip

pip install immoscout-scraper

Usage

Command Line Interface

The scraper provides a command-line interface with support for arguments and environment variables.

Basic Usage

# Using uv
uv run immoscout-scraper "https://www.immobilienscout24.de/Suche/de/berlin/berlin/wohnung-mieten"

# If installed via pip
immoscout-scraper "https://www.immobilienscout24.de/Suche/de/berlin/berlin/wohnung-mieten"

With Options

immoscout-scraper \
  "https://www.immobilienscout24.de/Suche/de/berlin/berlin/wohnung-mieten" \
  --output-path ./my-properties.db \
  --max-requests-per-second 10 \
  --max-pages 5

For a list of supported options, run:

immoscout-scraper --help

Environment Variables

All CLI arguments can be configured using environment variables with the IMMOSCOUT_SCRAPER_ prefix:

Environment Variable CLI Argument Default Description
IMMOSCOUT_SCRAPER_SEARCH_URL search_url required ImmoScout24 search URL to scrape
IMMOSCOUT_SCRAPER_OUTPUT_PATH --output-path properties.db Path to SQLite database file
IMMOSCOUT_SCRAPER_MAX_REQUESTS_PER_SECOND --max-requests-per-second 16 Rate limit for API requests
IMMOSCOUT_SCRAPER_MAX_PAGES --max-pages unlimited Maximum number of pages to scrape
IMMOSCOUT_SCRAPER_CHUNKSIZE --chunksize 100 Save eagerly after scraping this many properties
IMMOSCOUT_SCRAPER_RESCRAPE --rescrape false Ignore previously scraped properties and scrape all properties again

Docker Usage

docker run --rm \
  -v $(pwd)/data:/out \
  libklein/immoscout-scraper \
  "https://www.immobilienscout24.de/Suche/de/berlin/berlin/wohnung-mieten"

Using Environment Variables

docker run --rm \
  -v $(pwd)/data:/out \
  -e IMMOSCOUT_SCRAPER_SEARCH_URL="https://www.immobilienscout24.de/Suche/de/berlin/berlin/wohnung-mieten" \
  -e IMMOSCOUT_SCRAPER_MAX_PAGES="20" \
  libklein/immoscout-scraper

Docker Compose Example

version: '3.8'
services:
  scraper:
    image: libklein/immoscout-scraper
    environment:
      - IMMOSCOUT_SCRAPER_SEARCH_URL=https://www.immobilienscout24.de/Suche/de/berlin/berlin/wohnung-mieten
      - IMMOSCOUT_SCRAPER_MAX_REQUESTS_PER_SECOND=16
      - IMMOSCOUT_SCRAPER_MAX_PAGES=20
    volumes:
      - ./data:/out

Docker Environment Variables

The Docker container comes with the following pre-configured environment variables:

  • IMMOSCOUT_SCRAPER_OUTPUT_PATH=/out/properties.db - Saves database to mounted volume
  • IMMOSCOUT_SCRAPER_MAX_REQUESTS_PER_SECOND=16 - Conservative rate limiting

Development

Setting Up Development Environment

  1. Clone the repository:
git clone https://github.com/libklein/immoscout-scraper.git
cd immoscout-scraper
  1. Install dependencies and pre-commit hooks:
make install
  1. Run pre-commit hooks:
uv run pre-commit run -a

Running Tests

uv run pytest

Code Formatting

uv run ruff format
uv run ruff check --fix

URL Requirements

  • The scraper only accepts URLs from www.immobilienscout24.de domain
  • URLs from api.mobile.immobilienscout24.de are not accepted (these are converted automatically)
  • Search URLs should be in the format: https://www.immobilienscout24.de/Suche/de/...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

immoscout_scraper-1.1.0.tar.gz (67.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

immoscout_scraper-1.1.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file immoscout_scraper-1.1.0.tar.gz.

File metadata

  • Download URL: immoscout_scraper-1.1.0.tar.gz
  • Upload date:
  • Size: 67.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for immoscout_scraper-1.1.0.tar.gz
Algorithm Hash digest
SHA256 aa7e7bedadcaf4311ce8673fd3d67b771c4ab515e5baea6afa74d27b8fdfb717
MD5 6e72c18af93d99409379230902a527c5
BLAKE2b-256 c163e2fbd198ec596e109dd9aa1a2d98c37d3d1034a511170270232bbf838df8

See more details on using hashes here.

File details

Details for the file immoscout_scraper-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for immoscout_scraper-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3bcfd06a2d3eb3c1ddaa6bb66bba97d6a22d353c863a0bcca06f9100b0674fad
MD5 61ccb89ad3be0454c3bb5d9304e1fe44
BLAKE2b-256 0c8c85b49b1223a5ae9fab10058e7d6ba1c4d29830dcc3a5cf1fc4e85f9058a5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page