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



25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/melissa_data/web_smart/property_api.rb', line 25

def address(address:, city:, state:, zip:, country:)
  resp = JSON.parse(RestClient.get("https://personator.melissadata.net/v3/WEB/ContactVerify/doContactVerify",
                                   { params: { id: MelissaData.web_smart_id,
                                               Actions: "Check",
                                               a1: address,
                                               city: city,
                                               state: state,
                                               postal: zip,
                                               ctry: country,
                                               AdvancedAddressCorrection: "on",},
                                     accept: :json,
                                     content_type: :json }))
  resp["Records"].first
end

#property_by_address_key(address_key:) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/melissa_data/web_smart/property_api.rb', line 17

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,
                                   OptPropertyDetail: "1" } })
  PropertyXMLParser.new(Nokogiri::XML(resp)).parse
end

#property_by_apn(fips:, apn:) ⇒ Object



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

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,
                                   OptPropertyDetail: "1" } })
  PropertyXMLParser.new(Nokogiri::XML(resp)).parse
end