Class: MelissaData::WebSmart::PropertyAPI

Inherits:
Object
  • Object
show all
Defined in:
lib/melissa_data/web_smart/property_api.rb

Instance Method Summary collapse

Instance Method Details

#address(address:, city:, state:, zip:, country:) ⇒ Object



22
23
24
25
26
27
28
29
30
31
# File 'lib/melissa_data/web_smart/property_api.rb', line 22

def address(address:, city:, state:, zip:, country:)
  resp = RestClient.get('https://address.melissadata.net/v3/WEB/GlobalAddress/doGlobalAddress',
                       { params: { id: MelissaData.web_smart_id,
                                   a1: address,
                                   loc: city,
                                   admarea: state,
                                   postal: zip,
                                   ctry: country} })
  AddressXMLParser.new(Nokogiri::XML(resp)).parse
end

#property_by_address_key(address_key:) ⇒ Object



15
16
17
18
19
20
# File 'lib/melissa_data/web_smart/property_api.rb', line 15

def property_by_address_key(address_key:)
  resp = RestClient.get('https://property.melissadata.net/v3/REST/Service.svc/doLookup',
                       { params: { id: MelissaData.web_smart_id,
                                   AddressKey: address_key } })
  PropertyXMLParser.new(Nokogiri::XML(resp)).parse
end

#property_by_apn(fips:, apn:) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/melissa_data/web_smart/property_api.rb', line 7

def property_by_apn(fips:, apn:)
  resp = RestClient.get('https://property.melissadata.net/v3/REST/Service.svc/doLookup',
                       { params: { id: MelissaData.web_smart_id,
                                   fips: fips,
                                   apn: apn } })
  PropertyXMLParser.new(Nokogiri::XML(resp)).parse
end