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.1.tar.gz (42.8 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.1-py3-none-any.whl (56.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for nz_house_prices-2.0.1.tar.gz
Algorithm Hash digest
SHA256 3520cdbdd6773d84039bebff0897ffb36c5dcef748bea4e91ba5ed861cc25ea3
MD5 be746e5c1e8b9f71532c03abe84c4744
BLAKE2b-256 4a5841b510c397acbac10472c3103b3a4abdf0c1bff5014f7241b360d0f721db

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nz_house_prices-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 70ed9215b72172c6dd31f28a60ae1cba78c962297c76627036dd508f2a7785aa
MD5 a6bd9fd40b1ac7b1f596c85df0e2525d
BLAKE2b-256 5d34c883aa0622e39f1638f7bea77f3100bb0915329a9578569f1005dd8a9e83

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