

Lookup by Twilio - amishpatel1994
https://www.twilio.com/lookup?utm_medium=email&utm_source=prodlnch&utm_campaign=introducing_lookup_from_twilio_20150331&utm_content=prdlnch

======
pgib
My telco was charging $8/month for visual voicemail, so I opted to buy a
Twilio number for $1/month, and set my phone to forward no
answer/busy/unavailable to a simple Twilio app I wrote that handles voicemail.

When someone leaves me a message, I get an SMS with the message and caller
details. I've been using OpenCNAM
([https://www.opencnam.com](https://www.opencnam.com)) for the caller ID look-
up.

I implemented something similar for our office so that each person has a proxy
number that can be given out to clients. Voicemail is handled by a similar
app, and each person also receives a Slack notification for an incoming call
or voice message.

Lookup by Twilio is a bit different than OpenCNAM, but also pretty similar.
They're both pretty affordable, though in the end, I'll likely create our own
lookup database that we can customize.

For me, the most immediately useful info is the state/province as well as
country of the incoming call. It appears that with Twilio Local, on the latter
comes through. I did some tests of Lookup with a bunch of numbers, and the
additional info that comes through for the paid portion of things doesn't seem
that particularly useful. The (free) "national_format" is nice, but I'd say
the most valuable part of the service is quickly identifying invalid and VoIP-
based numbers.

~~~
mikeroher
I'm looking to set up something up like this. Could you post the source of
your simple app?

~~~
Scoundreller
For the same reasons ($1/month<<$8/month, even though it means I burn a
precious NANPA DID), I've set up the same without writing a single line of
code.

With VOIP.ms, I ordered a DID and set it to auto-answer any call. They have a
voicemail feature you can use, so it handles the recorded message and
recording after the beep. Voip.ms then emails you the voicemail (nice for
recordkeeping). If your cellular provider has an email to SMS gateway, you can
forward the email there, and you'll see the callerid in the subject, but no
CNAM to speak of.

Once working, I set my cellphone to auto-direct any unanswered calls to the
DID I setup.

Here's how some Canadians are doing it: [http://awslookup.com/free-voice-mail-
on-wind-mobile/](http://awslookup.com/free-voice-mail-on-wind-mobile/)

~~~
mikeroher
Shit, that's a lot cheaper, faster and easier. I just spent 3+ hours trying to
get Twilio to do the same thing. Thanks a lot!

------
sandstrom
Really neat!

Any plans on open sourcing the formatting library?

It's a good functionality, but (at least for me) would mainly be useful for
view-layer on-the-fly formatting, and we wouldn't use an remote API request
for that.

Sort of like Strip's jQuery.payment[1], it would be a simple and clever
marketing trick. People searching for a phone number formatting library are
just the people you want to sell your services to.

EDIT: just found libphonenumber, which does local formatting[2]

[1]
[https://github.com/stripe/jquery.payment](https://github.com/stripe/jquery.payment)
[2]
[https://github.com/googlei18n/libphonenumber](https://github.com/googlei18n/libphonenumber)

~~~
fxx2
Stripe actually released a mobile phone number formatting library.

[https://github.com/stripe/jquery.mobilePhoneNumber](https://github.com/stripe/jquery.mobilePhoneNumber)

------
andrewguenther
I find it interesting that you can get the mobile carrier from this. The first
thing I pictured was a voice phishing attack: "Hello, this is T-Mobile,
there's a problem with your account..." you get the gist.

~~~
joshmn
Easy enough to do already. Twilio doesn't need to implement this in order to
make this interesting.

Not much different than looking up someone's whois and pretending to be
GoDaddy.

~~~
prawn
The sort of person who registers a domain might be a little more alert than
the larger group of people who have a mobile phone?

~~~
joshmn
Have you seen those GoDaddy commercials with Danica Patrick? Those commercials
appeal to people who, I'd gander, have a lot more to lose (and aren't as wise
to the potential sly tricks... of the internet) than what could be phished
over the phone from your telco provider.

~~~
prawn
Not in the US, so I don't see that ad. Good point about lot more to lose,
though I wonder if 2FA through phones makes losing phone access a risk as
well.

------
theraven
Someone is going to have bad analytics for this link.
utm_medium=email&utm_source=prodlnch&utm_campaign=introducing_lookup_from_twilio_20150331&utm_content=prdlnch

~~~
RobSpectre
Yes. Yes we will. :'(

~~~
spdustin
A filter to exclude referrers from ycombinator.com would offset _some_ of
that.

------
fasteo
Am I missing something or this is just a REST front-end for Google´s
libphonenumber[1] ?

[1]
[https://github.com/googlei18n/libphonenumber](https://github.com/googlei18n/libphonenumber)

~~~
threedaymonk
It seems to be more than that. For example, I typed in my mobile phone number,
and it correctly identified the operator as "Hutchison 3G UK" (i.e. 3), which
it now is - but it's a number that was originally Virgin and which has been
ported a couple of times since then.

~~~
alexkinch
For mobile numbers it sounds like this uses an HLR Lookup service, which will
(in simple terms) return the Mobile Country Code (MCC) and Mobile Network Code
(MNC) - e.g. MCC 234 is the UK, and MNC 20 is Hutchinson 3G (aka 3). If you
were to check the number itself against a numbering plan (for the UK
[http://www.telecom-tariffs.co.uk/codelook.htm](http://www.telecom-
tariffs.co.uk/codelook.htm) is a useful tool) it'd show the original operator.

------
EvanDotPro
Wow, $0.005 is _incredibly_ expensive for carrier lookups. I run an SMS
gateway and our cost for this is $0.0001 per lookup from our primary provider
and $0.0002 from our backup provider. Of course we are dealing in bulk but
Twilio should be too...

~~~
bradgessler
Twilio is great for small scale applications, but as you point out they're
very expensive if you're doing anything at scale.

------
twqust
Interesting results on a couple of 'special' +1800 numbers -- could someone
from Twilio clarify the results?

    
    
        +18005551212
        
        {
            "country_code": "US",
            "phone_number": "+18005551212",
            "national_format": "(800) 555-1212",
            "url": "https://lookups.twilio.com/v1/PhoneNumber/+18005551212",
                "carrier": {
                "type": "mobile",
                "error_code": null,
                "mobile_network_code": null,
                "mobile_country_code": "310",
                "name": "ICE Wireless"
            }
        }
    
        +18005551111
        {
            "country_code": "US",
            "phone_number": "+18005551111",
            "national_format": "(800) 555-1111",
            "url": "https://lookups.twilio.com/v1/PhoneNumber/+18005551111",
            "carrier": {
                "type": "mobile",
                "error_code": null,
                "mobile_network_code": null,
                "mobile_country_code": "310",
                "name": "Zipwhip"
            }
        }
    

Specifically, Ice Wireless seems to be a small northern Canada provider?

------
corford
Pretty solid! Only minor issues I could spot were:

1\. Wrong carrier for my mobile - number started out life with a UK MVNO
(sainsbury's mobile), I have since ported it to Virgin UK (another MVNO) but
Twillio lists the carrier as being EE (which is sort of correct in so much as
that's who Virgin resell capacity from).

2\. No carrier type info for UK voip numbers - tried two numbers, one from
Telappliant and one from Andrews & Arnold, got nulls back each time :(

~~~
alexkinch
Re: 1, Sainsbury's Mobile is an MVNO on Vodafone, and Virgin is an MVNO on EE,
so strictly speaking that's correct (see my previous answer here about how
it's probably getting this info:
[https://news.ycombinator.com/item?id=9300690](https://news.ycombinator.com/item?id=9300690))

Re: 2, the data is available from Ofcom - maybe if you ask Twilio nicely
they'll load it :)

~~~
corford
Thanks for the info. @RobSpectre: what alexkinch just said re: Ofcom data :D

------
benmmurphy
How are you doing HLR lookups for numbers in vodafone range in the UK? I
thought companies were barred from sharing this information? Apparently
txtnation is not allowed to do this. Not sure how current this blog post is.

[https://clients.txtnation.com/entries/21436098-HLR-Lookup-
Ov...](https://clients.txtnation.com/entries/21436098-HLR-Lookup-Overview-of-
our-Mobile-Number-Portability-Lookup)

'The UK is an unusual country as far as number portability is concerned. There
is no central number administration database, and Vodafone UK prevent HLR
Lookups to all parties. Hence, we currently fully resolve all UK mobile
numbers except Vodafone ported out. - If you query a Vodafone number our
Gateway responds based on number range info. - If the Vodafone number has been
ported out, our Gateway response will still come up as a Vodafone number. - If
a number has been ported in to Vodafone, our Gateway response will be correct.
NOTE: Vodafone UK is only reachable with the NPLU, it is still blocked with
RTLU. To be more accurate, it's blocked if the number range belongs to
Vodafone.'

------
Tomdarkness
Looks interesting but seems to be lacking a bit in the mobile number lookup
department. The current service we use for mobile numbers can provide:

\- Is the phone number not only valid in terms of syntax but a number actually
registered to a subscriber?

\- Is the subscriber currently connected to the network? (Normally indicates
if their phone is switched on or off with the exception of not having a
signal)

\- Has the phone number or subscriber been barred or blacklisted in any way?

\- Network that the number originally belonged to

\- Network that the number is currently registered with. For example if they
ported their number from another provider this will be different from the
network the number originally belonged to.

\- Network that the subscriber is currently connected to. So say if you were
roaming in a different country this would return the network the phone is
currently roaming on. Can be used to see if someone is out of the country.

This works mostly worldwide with a few exceptions. In a few countries we can
actually determine if you are on a prepay or contract plan as well.

~~~
jonknee
Who are you currently using? It seems odd that the current connection status
is something that is shared.

~~~
mynameisvlad
Yeah, I don't even know how that would be possible unless it's owned by one of
the phone companies and is only available for their users. I _highly_ doubt
any telco would share that data publicly, especially if all you need is the
subscriber's number.

~~~
EvanDotPro
This is likely done with something called an HLR lookup via SS7. I believe it
was explained to me that HLR lookups are meant for call setup and SMS routing,
NOT for exposing network information via web services, but that doesn't stop
companies with SS7 access from doing it anyway since there are plenty of
people willing to pay for that information.

------
jonursenbach
Wish they returned city, state, and ZIP information for domestic numbers like
Telesign does. Telesign is outrageously expensive.

~~~
RobSpectre
Hey Jon - Rob from Twilio here.

Good feedback - appreciate you sharing. We do have geographic information with
each webhook sharing city, state and zip - agree it would be useful to have
this in the Lookup resources as well.

~~~
sdklein05
Thank Rob,

If you did add geographic info, what would it be base on? area code/NXX? How
relevant would it be considering LNP?

~~~
RobSpectre
It would be based on the number itself. Obviously with local number
portability this is not super accurate, but we do have some customers that
find the data useful nevertheless.

~~~
zkhalique
Are you guys going to implement it in the lookup, then?

~~~
jonursenbach
I filed a support ticket the other day because I was curious, and this was the
response I got:

``` Right now there are no plans to add this ability to this feature but I'm
sure it's something we would look at as we go along. We really weren't sure
this was a viable feature but enough people made noise so we developed it to
help companies be more efficient when sending and calling the people they need
to connect with. ```

------
Animats
US carrier info is way out of date. It shows one of my numbers as Sprint, but
it was ported to T-Mobile over a year ago.

That used to be the curse of Google Voice. They'd only send SMS to a mobile
number, but their database for recognizing mobile numbers was terrible.

It does recognize a Twilo number properly, though.

~~~
mynameisvlad
That's because there's no real way for them to know you moved a number. Nobody
knows you moved the number except the two companies involved. So, unless they
had direct access to the customer records of each telco, they can only guess
by the original owner.

~~~
nileshtrivedi
That can't be true. If a number was ported from Carrier X to Carrier Y and
someone makes a call originating from carrier Z, I am pretty sure carrier X is
not involved any more in the routing of the call, which means that carrier Z
has some way to figure out which carrier to route to (Y in this case). So it's
not just those two companies involved.

At least in India, there exists a central database of ported numbers which
every carrier uses to do the routing.

~~~
reitanqild
Some things are hard to get to: one thing that struck me was how hard it is to
find out if a number has changed owner (think SMS subscriptions.)

------
sketchthat
I don't understand what is so good about this, I've been working with this
technology in Australia for years. I can get the carrier and details of any
number in the world with MNP Lookups.

------
WizKid
Swedish landlines seems to not work. I manage to lookup my old mobile phone
number and it say Sweden correctly. But if I input +4686736000 I get 404 back.

~~~
dsl
The web UI seems a little clunky and overloaded right now. I got a few errors
on my cell number before it finally worked.

~~~
RobSpectre
Much obliged on the bug reports. We've corrected the number on the demo page
and confirmed it is working now.

If you both would like to shoot me an email to rob [at] twilio [dot] com,
we'll ship you a t-shirt as thanks for pointing out the error.

------
CoreSet
Although I wouldn't go so far as to say I'm a "Twilio dev" I do implement the
service whenever I need to spin up some sort of easy SMS functionality.

That said, any ideas for what you could use this for? I'm actually interested
in building a sample app for it, I'm just trying to think of a sexier use case
than localization and spam-detection. Is that as good as it gets?

~~~
RobSpectre
Rob from Twilio here - thanks for using the service. Localization and
fraud/spam protection are definitely the two most useful for Twilio Lookup,
but suspect there are a couple more than might be less obvious.

1) Smarter Routing - quite a few developers have expressed they'd like to know
whether or not a phone number is a landline or not before attempting to send a
text message. Twilio Lookup will describe whether the number is mobile,
landline, or voip so you can choose the appropriate communication to reach the
number.

2) Error Checking - While libraries like libphonenumber are useful for
determining if a number can _possibly_ exist, there are some conditions where
determining if a number _does_ exist is more valuable. This can be used for
error checking - if I as a user input a typo in my phone number (e.g. I
mistype my personal phone number as '(347) 193-6073' which does not exist
instead of '(347) 923-6073')

I also suspect across larger applications carrier info might also contain
useful demography. For example, knowing that your users in Montana mostly use
Verizon might inform your advertising to surface more CDMA devices in that
market.

Ultimately this will probably end up like every other product we release - the
killer use case is one we never even considered.

------
AjithAntony
FYI, there is a VoIP service from Tmobile, called t-mobile@home. The number I
looked up showed up as a T-mobile mobile number. Might not be anything you can
do about that.

------
7ewis
Works really well.

Checked a few numbers, only number it didn't get the network provider for was
a UK landline. Wish I had a way to make use of this API!

~~~
RobSpectre
Awesome - thanks for giving it a swing.

------
antsam
Neat. Also, it looks like it defaults to saying a number is mobile if you give
it something like NNN5551234.

------
gosmart4u
Nice! We already heavily use Twilio and I will be adding this functionality to
two of our apps.

------
daurnimator
This has been wrong or useless (all nulls) for every number I've tried.

------
low_key
It would be really nice if this provided CNAM info, too.

~~~
RobSpectre
Mmmm - great feedback. We do provide this service for our phone numbers to do
a CNAM lookup on inbound communications - can see how it would be useful for
Twilio Lookup as well.

