A powerful Python scraper for extracting real estate data from Redfin. Search properties, get detailed listings, AVM estimates, walk scores, flood risk data, agent info, and more using the Redfin Scraper API by RealtyAPI.
- Property Search - Search by location, coordinates, polygon, region ID, or Redfin URL with 50+ filters
- Property Details - Get full property data by address, property ID, or Redfin URL
- AVM Estimates - Automated Valuation Model (home value estimates)
- Walk/Transit/Bike Scores - Walkability, transit, and bikeability ratings
- Flood Risk Data - FEMA flood zone and risk assessment
- Agent Info - Listing agent details for any property
- Amenities - Full amenity breakdown
- Mortgage Calculator - Payment estimates and mortgage data
- Market Insights - Hot market indicators, popularity metrics
- Price Drop Tracking - Price reduction history
- Tour Data - Tour insights and scheduling availability
- Autocomplete - Location search suggestions
- Bulk Mode - Process hundreds of properties from
input.jsonwith progress tracking - Export to JSON or CSV - Save results in your preferred format
Sign up at realtyapi.io to get your API key.
git clone https://github.com/realtyapi/redfin-scraper-python.git
cd redfin-scraper-python
pip install -r requirements.txtpython scraper.pyThe scraper will prompt you for your API key on first run and save it for future use.
import requests
url = "https://redfin.realtyapi.io/detailsbyaddress"
params = {
"property_address": "166 W 22nd St Unit 1D, New York, NY 10011"
}
headers = {
"x-realtyapi-key": "YOUR_API_KEY"
}
response = requests.get(url, headers=headers, params=params)
print(response.json())from redfin_api import RedfinAPI
api = RedfinAPI("YOUR_API_KEY")
data = api.search_by_location(
location_name="New York",
search_type="For_Sale",
sort_order="Newest",
min_beds="Two",
baths="OnePlus",
min_price="500000",
max_price="2000000",
home_type="House,Condo",
page=1,
)
print(data)data = api.search_by_location(
location_name="Los Angeles, CA",
search_type="For_Rent",
sort_order="Price_Low_to_High",
home_type="Apartment",
)
print(data)data = api.search_by_location(
location_name="Miami, FL",
search_type="Sold",
sold_within="Last_1_Month",
sort_order="Most_Recently_Sold",
)
print(data)data = api.search_by_coordinates(
latitude="40.748817",
longitude="-73.985428",
radius="1.5",
search_type="For_Sale",
result_count=50,
)
print(data)data = api.search_by_url(
search_url="https://www.redfin.com/zipcode/10002/filter/property-type=house,min-price=150k",
result_count=50,
)
print(data)data = api.search_by_region_id(
region_id="4_3244",
search_type="For_Sale",
)
print(data)data = api.get_details_by_address("166 W 22nd St Unit 1D, New York, NY 10011")
print(data)data = api.get_details_by_id(
property_id="20739181",
listing_id="192575318",
)
print(data)data = api.get_details_by_url(
"https://www.redfin.com/NY/Saint-Albans/10970-203rd-St-11412/home/20739181"
)
print(data)data = api.get_avm_estimate("13543215", "207197529")
print(data)data = api.get_walk_score("13543215", "207197529")
print(data)data = api.get_flood_info(
fips_code="36081",
apn="4109420115",
lat="40.7059662",
lng="-73.754585",
)
print(data)data = api.get_agent_info("20739181", "192575318")
print(data)data = api.get_amenities("13543215", "207197529")
print(data)data = api.get_mortgage_calculator("13543215", "207197529")
print(data)data = api.get_overview("20739181", "192575318")
print(data)data = api.get_insights("20739181", "192575318")
print(data)data = api.get_hot_market_info("13543215")
print(data)data = api.get_price_drop_info("207197529")
print(data)# Useful for getting property_id and listing_id from a Redfin URL
data = api.get_basic_details(
"https://www.redfin.com/NY/Hollis/9452-199th-St-11423/home/13543215"
)
print(data)data = api.autocomplete("Texas")
print(data)Every scraper option supports two modes:
Enter one input manually. The scraper shows a preview (first 1000 characters) of the response, then asks if you want to save the full output as JSON or CSV.
Process hundreds of inputs automatically. The scraper reads from input.json, runs each request one by one, shows a progress bar, and saves all results at the end.
[========================------] 80% (8/10) 166 W 22nd St Unit 1D, New York
- Copy
input_sample.jsontoinput.json - Fill in only the sections you need
- Run
python scraper.py, pick your operation, then select "Bulk run"
{
"property_addresses": [
"166 W 22nd St Unit 1D, New York, NY 10011"
],
"property_ids": [
{"property_id": "20739181", "listing_id": "192575318"}
],
"property_urls": [
"https://www.redfin.com/NY/Saint-Albans/10970-203rd-St-11412/home/20739181"
],
"listing_ids": ["192575318"],
"property_id_only": ["20739181"],
"search_locations": [
{
"location": "New York",
"search_type": "For_Sale",
"sort_order": "Newest",
"min_beds": "Two",
"min_price": "500000",
"max_price": "2000000"
},
"Austin, TX"
],
"search_coordinates": [
{"latitude": "40.748817", "longitude": "-73.985428", "radius": "1.5", "search_type": "For_Sale"}
],
"search_urls": [
"https://www.redfin.com/zipcode/10002/filter/property-type=house"
],
"search_region_ids": ["4_3244"],
"autocomplete_queries": ["Texas", "New York"],
"flood_queries": [
{"fips_code": "36081", "apn": "4109420115", "lat": "40.7059662", "lng": "-73.754585"}
]
}| Option | Format | Best for |
|---|---|---|
| 1 | JSON (.json) | Full nested data, programmatic access |
| 2 | CSV (.csv) | Spreadsheets, Excel, data analysis |
| 3 | Both | Keep JSON for detail + CSV for quick review |
All output is saved to the output/ directory.
export REALTYAPI_KEY=rt_your_key_here
python scraper.pyThe scraper saves your key to config.json on first run. You can also create it manually:
{
"api_key": "rt_your_key_here"
}from redfin_api import RedfinAPI
api = RedfinAPI("rt_your_key_here")| Value | Description |
|---|---|
For_Sale |
Active for-sale listings |
For_Rent |
Active rental listings |
Sold |
Recently sold properties |
| Value | Description |
|---|---|
Recommended |
Redfin's default sort |
Newest |
Most recently listed |
Oldest |
Oldest listings |
Most_Recently_Sold |
For Sold searches |
Price_High_to_Low |
Highest price first |
Price_Low_to_High |
Lowest price first |
Square_Feet |
Largest first |
Lot_Size |
Largest lot first |
Price_per_Sqft |
Price per sqft |
Beds |
Most bedrooms |
Baths |
Most bathrooms |
Any, Studio, One, Two, Three, Four, FivePlus, SixPlus
Any, OnePlus, OnePointFivePlus, Two, TwoPointFivePlus, ThreePlus, FourPlus, FivePlus, SixPlus
House, Condo, Townhouse, Multi family, Land, Other, Mobile, Co-op, Apartment
Active_ComingSoon, Active, ComingSoon, UnderContractOrPending, Active_UnderContractOrPending, Active_ComingSoon_UnderContract
Any, New_listings, Less_than_3d, Less_than_7d, Less_than_14d, Less_than_30d, More_than_7d, More_than_14d, More_than_30d, More_than_45d, More_than_60d, More_than_90d, More_than_180d
Last_7_Days, Last_1_Month, Last_3_Months, Last_6_Months, Last_1_Year, Last_2_Years, Last_3_Years, Last_5_Years
None, Private, Community, Private_or_Community, No_private_pool
No_Min, 1plus, 2plus, 3plus, 4plus, 5plus
Any, 10plus, 20plus, 30plus, 40plus, 50plus, 60plus, 70plus, 80plus, 90plus
Any, 1plus, 2plus, 3plus, 4plus, 5plus, 6plus, 7plus, 8plus, 9plus, 10
Any, FHA, VA
| Category | Endpoint | Description |
|---|---|---|
| Search | /search/bylocation |
Search by city/state/ZIP (50+ filters) |
| Search | /search/bycoordinates |
Circle search by lat/lng/radius |
| Search | /search/bypolygon |
Search by polygon coordinates |
| Search | /search/byregionid |
Search by Redfin region ID |
| Search | /search/byurl |
Search by Redfin URL |
| Search | /autocomplete |
Location autocomplete |
| Details | /detailsbyaddress |
Full details by address |
| Details | /detailsbyid |
Full details by property + listing ID |
| Details | /detailsbyurl |
Full details by Redfin URL |
| Individual | /agentInfo |
Listing agent details |
| Individual | /amenities |
Property amenities |
| Individual | /avm |
AVM home valuation |
| Individual | /basicDetails |
Basic info from URL (get IDs) |
| Individual | /customerConversionInfo |
Conversion data |
| Individual | /floodInfo |
Flood risk assessment |
| Individual | /getDatePickerData |
Tour scheduling dates |
| Individual | /hotMarketInfo |
Market heat indicators |
| Individual | /insights |
Property insights |
| Individual | /mainHouseInfoPanelInfo |
Main house info panel |
| Individual | /mortgageCalculatorInfo |
Mortgage estimates |
| Individual | /overview |
Property overview |
| Individual | /popularityInfo |
Listing popularity |
| Individual | /priceDropInfo |
Price reduction history |
| Individual | /tourInsights |
Tour insight data |
| Individual | /walkScore |
Walk/transit/bike scores |
redfin-scraper/
├── scraper.py # Interactive CLI (test one or bulk run)
├── redfin_api.py # Redfin API client library (25 endpoints)
├── config.py # API key management
├── examples.py # Code examples for every endpoint
├── input_sample.json # Template for bulk input (copy to input.json)
├── input.json # Your bulk input data (gitignored)
├── requirements.txt # Python dependencies
├── config.json # Your API key (auto-created, gitignored)
├── output/ # Saved JSON/CSV outputs (auto-created)
└── README.md # This file
- Python 3.7+
requestslibrary
Sign up at realtyapi.io to get your Redfin Scraper API key.
RealtyAPI also offers scraper APIs for:
MIT
Keywords: redfin scraper, redfin api, redfin data scraper, redfin property data, redfin scraper python, redfin listing scraper, redfin real estate api, scrape redfin, redfin scraping tool, redfin api python, redfin property scraper, redfin home data api, redfin estimate api, redfin avm api, redfin search api, redfin agent api, redfin walk score api, redfin rental data, redfin sold homes data, redfin market data, redfin flood risk, real estate scraper, real estate api, property data api, housing data api, mls data api, property scraper python, real estate data extraction, redfin automation, redfin data mining, redfin web scraper, redfin crawler, redfin property lookup, redfin comparable homes, redfin mortgage calculator, redfin price history, redfin home valuation, realtyapi, realty api