Class: WhitePages::Client
- Inherits:
-
Object
- Object
- WhitePages::Client
- Includes:
- HTTParty
- Defined in:
- lib/white_pages/client.rb
Instance Method Summary collapse
-
#find_business(options = {}) ⇒ Object
Find a business.
-
#find_person(options = {}) ⇒ Object
Find a person.
-
#reverse_address(options = {}) ⇒ Object
Reverse lookup of an address.
-
#reverse_phone(options = {}) ⇒ Object
Reverse lookup of a phone number.
-
#version ⇒ Object
API Version.
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( = {}) fetch(:find_business, ) 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( = {}) fetch(:find_person, ) 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( = {}) fetch(:reverse_address, ) 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( = {}) fetch(:reverse_phone, ) end |
#version ⇒ Object
API Version
10 11 12 |
# File 'lib/white_pages/client.rb', line 10 def version '1.0' end |