Determining a phone line type (cellular, landline, or VOIP)

JustinDupree -

If your application needs to know if a given number is a landline, a mobile phone, or a voip line, you can use the Whitepage Pro Phone Number Intelligence API to automatically determine line type, owner of the number, the carrier, and more.

This sample code in Ruby will log the line type, and whether it is a connected number.

 
require 'rest-client'
 
to = 'phone-number-to-check'
response = RestClient.get 'https://proapi.whitepages.com/2.2/phone.json', {:params => {
  'api_key' => 'your-whitepages-api-key-here'
  'phone_number' => to
  }}
result = JSON.parse(String.new(response))
 
log "%% Phone number #{$to} is #{result['results'][0]['line_type']}. Connected: #{result['results'][0]['is_connected']}"
 
Have more questions? Submit a request

0 Comments

Article is closed for comments.