Skip to content
Ryan Sherby edited this page Mar 21, 2023 · 8 revisions

Welcome to the RedfinScraper wiki!

General Information

Warnings

Multiprocessing can result in the consumption of all available CPU resources for an extended period of time

Unethical use of this library can result in Redfin taking disciplinary action against your IP address

Certain cities/zip codes are not available

Recommended Usage

Requests for large amounts of data (# of zip codes > 2,000) should be split into separate requests

Check the package.log file for information if the results are unexpected

Getting Started

The Config

Parameters for the RedfinScraper class can be controlled using an optional config.json file

Sample Config

Zip Code Database

A database of zip codes is required to search for City, State values

It is strongly recommended to download this free version in .csv format

Creating an Instance

Import Module

from redfin_scraper import RedfinScraper

Initialize Module

scraper = RedfinScraper()

Using The Scraper

Required Setup

scraper.setup(zip_database_path:str,multiprocessing:bool=False)

zip_database_path: Binary path to the zip_code_database.csv

multiprocessing: Allow for multiprocessing

Activating The Scraper

scraper.scrape(city_states:list[str]=None,zip_codes:list[str],lat_tuner:float,lon_tuner:float)

city_states: List of strings representing US cities formatted as "City, State"

zip_codes: List of strings representing US zip codes

lat_tuner: Represents # of standard deviations beyond the local latitude average that a zip code may exist within

lon_tuner: Represents # of standard deviations beyond the local longitude average that a zip code may exist within

Accessing Prior Scrapes

scraper.get_data(id:str)

id: IDs are indexed at 1 and increase in the format "D00#"

Clone this wiki locally