Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions zillow/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(self):
self.__auth = None
self._timeout = None

def GetSearchResults(self, zws_id, address, citystatezip, retnzestimate=False):
def GetSearchResults(self, zws_id, address, citystatezip, rentzestimate=False):
"""
The GetSearchResults API finds a property for a specified address.
The content returned contains the address for the property or properties as well as the Zillow Property ID (ZPID) and current Zestimate.
Expand All @@ -41,7 +41,7 @@ def GetSearchResults(self, zws_id, address, citystatezip, retnzestimate=False):
:param zws_id: The Zillow Web Service Identifier. Each subscriber to Zillow Web Services is uniquely identified by an ID sequence and every request to Web services requires this ID.
:param address: The address of the property to search. This string should be URL encoded.
:param citystatezip: The city+state combination and/or ZIP code for which to search. This string should be URL encoded. Note that giving both city and state is required. Using just one will not work.
:param retnzestimat: Return Rent Zestimate information if available (boolean true/false, default: false)
:param rentzestimate: Return Rent Zestimate information if available (boolean true/false, default: false)
:return:
"""
url = '%s/GetSearchResults.htm' % (self.base_url)
Expand All @@ -51,8 +51,8 @@ def GetSearchResults(self, zws_id, address, citystatezip, retnzestimate=False):
parameters['citystatezip'] = citystatezip
else:
raise ZillowError({'message': "Specify address and citystatezip."})
if retnzestimate:
parameters['retnzestimate'] = 'true'
if rentzestimate:
parameters['rentzestimate'] = 'true'

resp = self._RequestUrl(url, 'GET', data=parameters)
data = resp.content.decode('utf-8')
Expand All @@ -67,7 +67,7 @@ def GetSearchResults(self, zws_id, address, citystatezip, retnzestimate=False):

return place

def GetZEstimate(self, zws_id, zpid, retnzestimate=False):
def GetZEstimate(self, zws_id, zpid, rentzestimate=False):
"""
The GetZestimate API will only surface properties for which a Zestimate exists.
If a request is made for a property that has no Zestimate, an error code is returned.
Expand All @@ -76,14 +76,14 @@ def GetZEstimate(self, zws_id, zpid, retnzestimate=False):
For more information, see our Zestimate coverage.
:zws_id: The Zillow Web Service Identifier.
:param zpid: The address of the property to search. This string should be URL encoded.
:param retnzestimate: Return Rent Zestimate information if available (boolean true/false, default: false)
:param rentzestimate: Return Rent Zestimate information if available (boolean true/false, default: false)
:return:
"""
url = '%s/GetZestimate.htm' % (self.base_url)
parameters = {'zws-id': zws_id,
'zpid': zpid}
if retnzestimate:
parameters['retnzestimate'] = 'true'
if rentzestimate:
parameters['rentzestimate'] = 'true'

resp = self._RequestUrl(url, 'GET', data=parameters)
data = resp.content.decode('utf-8')
Expand All @@ -98,15 +98,15 @@ def GetZEstimate(self, zws_id, zpid, retnzestimate=False):

return place

def GetDeepSearchResults(self, zws_id, address, citystatezip, retnzestimate=False):
def GetDeepSearchResults(self, zws_id, address, citystatezip, rentzestimate=False):
"""
The GetDeepSearchResults API finds a property for a specified address.
The result set returned contains the full address(s), zpid and Zestimate data that is provided by the GetSearchResults API.
Moreover, this API call also gives rich property data like lot size, year built, bath/beds, last sale details etc.
:zws_id: The Zillow Web Service Identifier.
:param address: The address of the property to search. This string should be URL encoded.
:param citystatezip: The city+state combination and/or ZIP code for which to search.
:param retnzestimate: Return Rent Zestimate information if available (boolean true/false, default: false)
:param rentzestimate: Return Rent Zestimate information if available (boolean true/false, default: false)
:return:

Example:
Expand All @@ -117,8 +117,8 @@ def GetDeepSearchResults(self, zws_id, address, citystatezip, retnzestimate=Fals
'citystatezip': citystatezip
}

if retnzestimate:
parameters['retnzestimate'] = 'true'
if rentzestimate:
parameters['rentzestimate'] = 'true'

resp = self._RequestUrl(url, 'GET', data=parameters)
data = resp.content.decode('utf-8')
Expand Down