Skip to main content

Scrape house price estimates from NZ real estate websites

Project description

NZ House Prices

A Python package to scrape house price estimates from New Zealand real estate websites.

Installation

pip install nz-house-prices

Supported Sites

  • homes.co.nz
  • qv.co.nz
  • propertyvalue.co.nz
  • realestate.co.nz
  • oneroof.co.nz

Quick Start

Command Line

# Search by address
nz-house-prices "123 Example Street, Ponsonby, Auckland"

# Search specific sites only
nz-house-prices "123 Main St, Auckland" --sites homes.co.nz,qv.co.nz

# Output as JSON
nz-house-prices "123 Example Street, Ponsonby" --json

# Use sequential mode (slower, but uses less resources)
nz-house-prices "123 Example Street" --sequential

# Skip cache for fresh results
nz-house-prices "123 Example Street" --no-cache

# List supported sites
nz-house-prices --list-sites

Python API

from nz_house_prices import get_prices

# Get prices from all sites (parallel by default, ~20-25s)
prices = get_prices("123 Example Street, Ponsonby, Auckland")

for site, estimate in prices.items():
    if estimate.midpoint:
        print(f"{site}: ${estimate.midpoint:,.0f}")

# Use sequential mode if needed
prices = get_prices("123 Example Street, Auckland", parallel=False)

Context Manager (for multiple lookups)

from nz_house_prices import HousePriceScraper

with HousePriceScraper() as scraper:
    prices1 = scraper.scrape_address("123 Example Street, Ponsonby")
    prices2 = scraper.scrape_address("123 Main St, Auckland")

    for site, estimate in prices1.items():
        print(f"{site}: {estimate.midpoint}")

Features

  • Parallel scraping - Queries all 5 sites concurrently (~20-25 seconds)
  • Geocoding-based address matching - Accurately finds properties even when suburb names differ between sites
  • Automatic address-to-URL resolution for all supported sites
  • URL caching for faster repeated lookups
  • Rate limiting to avoid overwhelming sites
  • Retry logic with exponential backoff
  • Both CLI and Python API interfaces

Requirements

  • Python 3.9+
  • Playwright (installed automatically with the package)

After installing, run once to set up browsers:

playwright install chromium

License

MIT License

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

nz_house_prices-2.0.2.tar.gz (42.9 kB view details)

Uploaded Source

Built Distribution

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

nz_house_prices-2.0.2-py3-none-any.whl (56.7 kB view details)

Uploaded Python 3

File details

Details for the file nz_house_prices-2.0.2.tar.gz.

File metadata

  • Download URL: nz_house_prices-2.0.2.tar.gz
  • Upload date:
  • Size: 42.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for nz_house_prices-2.0.2.tar.gz
Algorithm Hash digest
SHA256 65bfe97675aa69ccdb8bb42ac3bd48e68fb6e8e71b30e262d42ce9005cb48f17
MD5 0fef4040fac73e7cffbbec9a0360cf93
BLAKE2b-256 2692d7c793f252b4eca2c4b58712cf66e20ef0815298b6c2aa0d665b62dcaf84

See more details on using hashes here.

File details

Details for the file nz_house_prices-2.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for nz_house_prices-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 77d4dd267626f17d2ca9963a64bd18e372cb92eb835014e9486fbd0d0cd92eb9
MD5 7115b6f802fcf14264611b1e93e2ef18
BLAKE2b-256 2924de1d89256f5b345eee3a25704bf3a523619fc41d41612c2de29b98d348a9

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