Class: WhitePages::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/white_pages/client.rb

Instance Method Summary collapse

Instance Method Details

#find_business(options = {}) ⇒ Object

Find a business

developer.whitepages.com/docs/read/Methods/find_business

  • :businessname - Required unless :category is provided

  • :category - Required unless :businessname is provided

  • :house - House number

  • :street - Street name, including any directional prefix or suffix

  • :city

  • :state - USPS two-character abbreviation

  • :zip - Will accept 5 digit ZIP Code or 9 digit ZIP+4

  • :areacode

  • :metro - Expand search to metro area

Example

WhitePages.api_key = API_KEY
WhitePages.find_business(businessname: 'Target', city: 'Los Angeles', state: 'CA')


57
58
59
# File 'lib/white_pages/client.rb', line 57

def find_business(options = {})
  fetch(:find_business, options)
end

#find_person(options = {}) ⇒ Object

Find a person

developer.whitepages.com/docs/read/Methods/find_person

  • :firstname

  • :lastname - Required unless :name is provided

  • :name - Full name. Required unless :lastname is provided

  • :house - House number

  • :street - Street name, including any directional prefix or suffix

  • :city

  • :state - USPS two-character abbreviation

  • :zip - Will accept 5 digit ZIP Code or 9 digit ZIP+4

  • :areacode

  • :metro - Expand search to metro area

Example

WhitePages.api_key = API_KEY
WhitePages.find_person(name: 'John Doe', state: 'CA')


34
35
36
# File 'lib/white_pages/client.rb', line 34

def find_person(options = {})
  fetch(:find_person, options)
end

#reverse_address(options = {}) ⇒ Object

Reverse lookup of an address

developer.whitepages.com/docs/read/Methods/reverse_address

  • :house - House number

  • :apt - Apartment number

  • :street - Street name, including any directional prefix or suffix. Required

  • :city

  • :state - USPS two-character abbreviation

  • :zip - Will accept 5 digit ZIP Code or 9 digit ZIP+4

  • :areacode

Example

WhitePages.api_key = API_KEY
WhitePages.reverse_address(street: '333 S. 3rd St', city: 'Los Angeles', state: 'CA')


94
95
96
# File 'lib/white_pages/client.rb', line 94

def reverse_address(options = {})
  fetch(:reverse_address, options)
end

#reverse_phone(options = {}) ⇒ Object

Reverse lookup of a phone number

developer.whitepages.com/docs/read/Methods/reverse_phone

  • :phone - 7 or 10 digits

  • :state - USPS two-character abbreviation. Required if :phone is 7 digits

Example

WhitePages.api_key = API_KEY
WhitePages.reverse_phone(phone: '3334445555')


73
74
75
# File 'lib/white_pages/client.rb', line 73

def reverse_phone(options = {})
  fetch(:reverse_phone, options)
end

#versionObject

API Version



10
11
12
# File 'lib/white_pages/client.rb', line 10

def version
  '1.0'
end