reteps/redfin

sometimes below_the_fold lacks propertyHistoryInfo

andrewljohnson opened this issue · 4 comments

Sometimes, the below_the_fold API call doesn't return a propertyHistoryInfo key. I speculate it's because this house is off-market.

response = Redfin().search("3947 Kings Row Reno Nevada")
url = response['payload']['exactMatch']['url']
initial_info = Redfin().initial_info(url)
property_id = initial_info['payload']['propertyId']
btf_data = Redfin().below_the_fold(property_id)
print(btf_data["payload"]["propertyHistoryInfo"])
Traceback (most recent call last):
  File "<console>", line 1, in <module>
KeyError: 'propertyHistoryInfo'

When I view the page on Redfin, the data is there.

I also tried to find this data in other API calls but couldn't find it.

Any help is appreciated!

I found setting listingId worked to get propertyHistoryInfo always:

mls_data = Redfin().meta_property('belowTheFold', {'propertyId': property_id, "listingId":listing_id}, page=True)

Haha, related to #6 -- I guess it's an optional parameter.

Noted by newest commit (1696bee).

My issue was the avm_details call failing if listing_id was missing.

FWIW, I found passing a dummy listing_id value did the trick...

avm_details = client.avm_details( property_id , 1 ) ;