Class: Rubillow::PropertyDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/rubillow/property_details.rb

Overview

Interface for the Property Details API.

Read the more about this API at: http://www.zillow.com/howto/api/PropertyDetailsAPIOverview.htm

Class Method Summary collapse

Class Method Details

.deep_comps(options = {}) ⇒ Models::DeepComps

Retrieve extended details for property and its comps.

Read more at: http://www.zillow.com/howto/api/GetDeepComps.htm.

Examples:

data = Rubillow::PropertyDetails.deep_comps({ :zpid => '48749425', :count => 5 })

if data.success?
  puts data.principal.price  # "1032000"
  data.comparables.each |comp|
    puts comp.price
    puts comp.address[:street]
  end
end

Parameters:

  • options (Hash) (defaults to: {})

    The options for the API request.

Options Hash (options):

  • :zpid (Integer)

    The Zillow Property ID of the property. (required)

  • :count (Integer)

    The number of comps to return, between 1 and 25 inclusive. (required)

  • :rentzestimate (Boolean)

    Return Rent Zestimate information if available. Default: false

Returns:



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/rubillow/property_details.rb', line 62

def self.deep_comps(options = {})
  options = {
    :zws_id => Rubillow.configuration.zwsid,
    :zpid => nil,
    :count => nil,
    :rentzestimate => false,
  }.merge!(options)

  if options[:zpid].nil?
    raise ArgumentError, "The zpid option is required"
  end
  if options[:count].nil?
    raise ArgumentError, "The count option is required"
  end

  Models::DeepComps.new(Rubillow::Request.get("GetDeepComps", options))
end

.deep_search_results(options = {}) ⇒ Models::DeepSearchResult

Retrieve extended details for a property.

Read more at: http://www.zillow.com/howto/api/GetDeepSearchResults.htm.

Examples:

data = Rubillow::PropertyDetails.deep_search_results({ :address => '2114 Bigelow Ave', :citystatezip => 'Seattle, WA' })

if data.success?
  puts data.tax_assessment_year  # "2010"
  puts data.last_sold_price      # "1025000"
  puts data.address[:latitude]   # "47.637933"
end

Parameters:

  • options (Hash) (defaults to: {})

    The options for the API request.

Options Hash (options):

  • :address (String)

    The address of the property to search. (required)

  • :citystatezip (String)

    The city+state combination and/or ZIP code for which to search. Note that giving both city and state is required. Using just one will not work. (required)

  • :rentzestimate (Boolean)

    Return Rent Zestimate information if available. Default: false

Returns:



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/rubillow/property_details.rb', line 24

def self.deep_search_results(options = {})
  options = {
    :zws_id => Rubillow.configuration.zwsid,
    :address => nil,
    :citystatezip => nil,
    :rentzestimate => false,
  }.merge!(options)

  if options[:address].nil?
    raise ArgumentError, "The address option is required"
  end
  if options[:citystatezip].nil?
    raise ArgumentError, "The citystatezip option is required"
  end

  Models::DeepSearchResult.new(Rubillow::Request.get("GetDeepSearchResults", options))
end

.updated_property_details(options = {}) ⇒ Models::UpdatedPropertyDetails

Retrieve updated property facts for a given property.

Read more at: http://www.zillow.com/howto/api/GetUpdatedPropertyDetails.htm.

Examples:

data = Rubillow::PropertyDetails.updated_property_details({ :zpid => '48749425' })

if data.success?
  puts data.posting[:status]  # "1032000"
  puts data.posting[:type]    # "For sale by agent"
  data.edited_facts.each |fact|
    puts fact
  end
end

Parameters:

  • options (Hash) (defaults to: {})

    The options for the API request.

Options Hash (options):

  • :zpid (Integer)

    The Zillow Property ID of the property. (required)

Returns:



98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/rubillow/property_details.rb', line 98

def self.updated_property_details(options = {})
  options = {
    :zws_id => Rubillow.configuration.zwsid,
    :zpid => nil,
  }.merge!(options)

  if options[:zpid].nil?
    raise ArgumentError, "The zpid option is required"
  end

  Models::UpdatedPropertyDetails.new(Rubillow::Request.get("GetUpdatedPropertyDetails", options))
end