Using the Twilio Lookup service to scrub your sample

The Survox team has been working with Twilio on our upcoming IVR service and to look at opportunities to configure our dialer to use their elastic SIP trunking service. In our investigations, we encountered a great service for checking phone number details calledTwilio Lookup.

Twilio Lookup provides several useful pieces of information, but given growing emphasis on dialing practices due to TCPA regulations, we’re most interested in determining the ‘type’ of number before dialing. When you call the service and provide a phone number, Twilio Lookup will indicate whether the number is a landline, mobile, or VoIP. This can be very useful when looking to separate your dialing modes by phone type.

The Survox team wrote a very simple script to demonstrate how to use this function. You can modify the script to fit your particular workflow.

To get started, you’ll need a Twilio account and an associated Account SID and Authorization token. To find your credentials, follow the following information provided by Twilio.

  1. First log into yourTwilio Account. On the Dashboard there is a section labeledAPI Credentials. There you will find your Account SID and Auth Token. You’ll need these to authenticate your request.
  2. Once your account is established and you have your credentials, you can take a lookherefor a simple example on how to read a CSV file, call the lookup service, and report back the type of phone number for each record.


Remember, there is agithub.