A Python wrapper around the unofficial Redfin API.
Project description
redfin
A Python wrapper around the unofficial Redfin API.
PyPI package name: redfin (unchanged from the original reteps/redfin).
Installation
pip install redfin
Or install directly from GitHub (latest fixes):
</code></pre>
<h2>Usage</h2>
<pre lang="python"><code>from redfin import Redfin
client = Redfin()
response = client.search('1600 Amphitheatre Pkwy, Mountain View, CA')
url = response['payload']['exactMatch']['url']
initial_info = client.initial_info(url)
property_id = initial_info['payload']['propertyId']
# Get estimated value
avm = client.avm_details(property_id, "")
predicted_value = avm['payload']['predictedValue']
print(f"Estimated value: {predicted_value}")
# Get neighborhood walk/bike/transit scores
stats = client.neighborhood_stats(property_id)
walk_score = stats['payload']['walkScoreInfo']['walkScoreData']['walkScore']['value']
print(f"Walk score: {walk_score}")
What's Fixed
403 Errors (issues #19, #21)
The original library sent user-agent: redfin which Redfin's CDN now blocks with a 403 response.
This fork uses a real browser User-Agent by default:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
You can override it:
client = Redfin(user_agent="MyApp/1.0 (contact@example.com)")
Rate Limiting (issue #18)
Add a delay between requests to avoid hitting Redfin's rate limits:
client = Redfin(request_delay=1.0) # 1 second between requests
The client also automatically handles 429 responses by sleeping the Retry-After header duration and retrying once.
New Methods
neighborhood_stats(property_id)
Returns neighborhood walk score, bike score, transit score, and full address info.
stats = client.neighborhood_stats(property_id)
payload = stats['payload']
walk_score = payload['walkScoreInfo']['walkScoreData']['walkScore']['value']
bike_score = payload['walkScoreInfo']['walkScoreData']['bikeScore']['value']
transit_score = payload['walkScoreInfo']['walkScoreData']['transitScore']['value']
city = payload['addressInfo']['city']
state = payload['addressInfo']['state']
Notes on above_the_fold and info_panel
These methods still exist in the library but may be blocked by Redfin's CDN for some endpoints (returning 403 or incorrect data). They are kept for backward compatibility. Use neighborhood_stats instead for address and scores data.
All Methods
URL-based
initial_info(url)page_tags(url)primary_region(url)search(query)
Property ID-based
avm_details(property_id, listing_id)✅ workingneighborhood_stats(property_id)✅ working (new)below_the_fold(property_id)hood_photos(property_id)more_resources(property_id)page_header(property_id)property_comments(property_id)building_details_page(property_id)owner_estimate(property_id)claimed_home_seller_data(property_id)cost_of_home_ownership(property_id)above_the_fold(property_id, listing_id)⚠️ may be blocked by CDNinfo_panel(property_id, listing_id)⚠️ may be blocked by CDNsimilar_listings(property_id, listing_id)similar_sold(property_id, listing_id)nearby_homes(property_id, listing_id)avm_historical(property_id, listing_id)descriptive_paragraph(property_id, listing_id)tour_insights(property_id, listing_id)stats(property_id, listing_id, region_id)
Listing ID-based
floor_plans(listing_id)tour_list_date_picker(listing_id)
Table ID-based
shared_region(table_id)
License
MIT — see LICENSE.txt
Original library by Peter Stenger.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file redfin-0.2.1.tar.gz.
File metadata
- Download URL: redfin-0.2.1.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c85c7c3c9a0b7885d297dace050efe6d184b79af3b97519918ef9b002486905
|
|
| MD5 |
a7c81344b3ac158110f6ea74fc7d5ac0
|
|
| BLAKE2b-256 |
7aba82d549302d5456a3d48d4b3c0f81c56a51bfb273d73376d50d1059ae0f97
|
Provenance
The following attestation bundles were made for redfin-0.2.1.tar.gz:
Publisher:
publish.yml on reteps/redfin
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
redfin-0.2.1.tar.gz -
Subject digest:
1c85c7c3c9a0b7885d297dace050efe6d184b79af3b97519918ef9b002486905 - Sigstore transparency entry: 1240042684
- Sigstore integration time:
-
Permalink:
reteps/redfin@14f190db8dd6af175ff83c29153a20888bb62bee -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/reteps
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@14f190db8dd6af175ff83c29153a20888bb62bee -
Trigger Event:
release
-
Statement type:
File details
Details for the file redfin-0.2.1-py3-none-any.whl.
File metadata
- Download URL: redfin-0.2.1-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6544acef0b235be19c38510c0215c3fc45cb386f8f87f4f70c2444fde005e657
|
|
| MD5 |
c90146eee673e4408fe18ca79b624b4d
|
|
| BLAKE2b-256 |
16e030c7e9713c5e1f89f7d99cd534394bd8b4c9429fc3c201167820a3d92cf4
|
Provenance
The following attestation bundles were made for redfin-0.2.1-py3-none-any.whl:
Publisher:
publish.yml on reteps/redfin
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
redfin-0.2.1-py3-none-any.whl -
Subject digest:
6544acef0b235be19c38510c0215c3fc45cb386f8f87f4f70c2444fde005e657 - Sigstore transparency entry: 1240042726
- Sigstore integration time:
-
Permalink:
reteps/redfin@14f190db8dd6af175ff83c29153a20888bb62bee -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/reteps
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@14f190db8dd6af175ff83c29153a20888bb62bee -
Trigger Event:
release
-
Statement type: