Python API Call : pyzillow : Extract Real estate information from Zillow and convert it into a Shapefile

I am trying to extract the real-estate information from Zillow using the pyzillow API.I am trying to get a point shapefile having all the houses for sale information so that I can interpret them in ArcGIS. Since, I do not have the facility to convert directly into a shapefile I am using the methodology of API call. I used the package pyzillow ( https://pypi.python.org/pypi/pyzillow/0.5.5). I am interested in extracting the real-estate data for entire Richardson (http://www.zillow.com/richardson-tx/).

I used the below code for making API call:

from pyzillow.pyzillow import ZillowWrapper, GetDeepSearchResults
address = 'Richardson TX'
zipcode = '75080'
zillow_data = ZillowWrapper('X1-ZWz1fjckjdd8gb_a2eph')
deep_search_response = zillow_data.get_deep_search_results(address,zipcode)
result = GetDeepSearchResults(deep_search_response)
result.zillow_id # zillow id, needed for the GetUpdatedPropertyDetails

When I executed the above code I am receiving the error:

"C:\Program Files\ArcGIS\Pro\bin\Python\env\arcgispo-py3\python.exe" C:/Users/Rvg296/PycharmProjects/Final_Project/Multi-Criteria.py
Traceback (most recent call last):
  File "C:/Users/Rvg296/PycharmProjects/Final_Project/Multi-Criteria.py", line 5, in <module>
    deep_search_response = zillow_data.get_deep_search_results(address,zipcode)
  File "C:\Users\Rvg296\AppData\Roaming\Python\Python34\site-packages\pyzillow\pyzillow.py", line 31, in get_deep_search_results
    return self.get_data(url, params)
  File "C:\Users\Rvg296\AppData\Roaming\Python\Python34\site-packages\pyzillow\pyzillow.py", line 82, in get_data
    raise ZillowError(int(response.findall('message/code')[0].text))
pyzillow.pyzillowerrors.ZillowError
Process finished with exit code 1

When I tried to figure out what was the issue, I found that the address is not able to take the entire city or state. It is able to take only the street information and zip code and then list the details.

Upvotes: 0

Views: 5882

Answers (1)

jcp9010
jcp9010

Reputation: 11

The code that you have above is correct and should work. However, the part that is creating the error is that the address needs to be an address of a home, and not the city. If you put in a home address, as opposed to the city, your code should work just fine.

For example, the following below should work.

from pyzillow.pyzillow import ZillowWrapper, GetDeepSearchResults
address = '1600 Pennsylvania Ave NW, Washington, DC'
zipcode = '20006'
zillow_data = ZillowWrapper('X1-ZWz1fjckjdd8gb_a2eph')
deep_search_response = zillow_data.get_deep_search_results(address,zipcode)
result = GetDeepSearchResults(deep_search_response)
print(result.zillow_id) 

Hope that helps!

Upvotes: 1

Related Questions