Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The API now throws a 403 Client error #19

Open
dreed47 opened this issue Dec 12, 2024 · 5 comments
Open

The API now throws a 403 Client error #19

dreed47 opened this issue Dec 12, 2024 · 5 comments

Comments

@dreed47
Copy link
Contributor

dreed47 commented Dec 12, 2024

This stopped working at least 2 weeks ago. Running the code examples now returns a 403 Forbidden error. Whats odd is that if you just copy the url into a browser it returns a 200 with good data.

File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/redfin/redfin.py", line 15, in meta_property return self.meta_request('api/home/details/' + url, { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/redfin/redfin.py", line 23, in meta_request response.raise_for_status() File "/Users/david/Library/Python/3.11/lib/python/site-packages/requests/models.py", line 1024, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://redfin.com/stingray/api/home/details/mainHouseInfoPanelInfo?accessLevel=1&propertyId=43790344&listingId=

@dreed47
Copy link
Contributor Author

dreed47 commented Dec 12, 2024

It looks like Redfin is expecting a valid user-agent string and not just 'redfin', When I change it to 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36' The call works

dreed47 added a commit to dreed47/redfin-lib that referenced this issue Dec 13, 2024
@ianvanhoven
Copy link

@dreed47 would the change be done just in redfin.py?

class Redfin:
    def __init__(self):
        self.base = 'https://redfin.com/stingray/'
        self.user_agent_header = {
            'user-agent': 'redfin'
        }

@tahiraslammm
Copy link

these changes aren't working

@dreed47
Copy link
Contributor Author

dreed47 commented Jan 8, 2025

I've been unable to get this to work consistently. Most likely Redfin as attempting to block external API traffic. I would recommend moving away from this integration unless/until Redfin publishes an official API.

@ianvanhoven
Copy link

ianvanhoven commented Jan 8, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants