Twilio is a San Francisco-based cloud communications provider whose services handle text messaging for companies such as Uber and AWS, among many, many others. The service connects Web browsers and backend servers to make requests to the Twilio REST API to dispatch to the person being contacted, delivering a predefined message, such as the status of an AWS service, from the specified URL.
Followers need to have Node.js and npm installed, with a free Twilio account and your account SID and Auth Token handy. Twilio’s Lookup page offers an easy way to play around with the API to see what it returns, and the author provides a quick code sample to perform this kind of basic number lookup.
While this functionality is free, a carrier lookup costs $0.005 per request, but by including one extra parameter, it provides more information, including whether a number is capable of receiving an SMS or MMS message. Looking up a number that doesn’t exist produces a 404 response, the author provides this code as well and it can be used anytime you want to see if a phone number is valid or not.
For businesses that rely on telecommunications, this Lookup API acts like a REST API phonebook, and at the bottom of the tutorial are links to other tutorials for validating phone numbers in Python, PHP and Ruby respectively.