Hacker News new | past | comments | ask | show | jobs | submit login
Lookup by Twilio (twilio.com)
206 points by amishpatel1994 on Mar 31, 2015 | hide | past | web | favorite | 73 comments



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) 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.


Hi pgib (and everyone else),

Thanks for the opencnam mention. We are about to launch www.everyoneapi.com -- version 2. The current everyoneapi offers the same lookups that Twilio offers, but we will be lowering our price and adding even more data-points. Our reverse phone append product offers a lot more than just linetype and carrier. The parent company to both opencnam and everyoneapi is telo (www.telo.com). If anyone has any questions or requests, feel free to contact support@telo.com!


A Slack notification is a great idea. I just have the Voicemail Twimlet set up for my personal numbers but I've been wanting something more sophisticated for awhile. Thanks for the ideas, and the OpenCNAM link.


I worked on a very similar project a few years back, but without lookup and with an altogether different (physical) interface: http://iamsaul.co.uk/projects/message-box/


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


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/


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!


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 [2] https://github.com/googlei18n/libphonenumber


Stripe actually released a mobile phone number formatting library.

https://github.com/stripe/jquery.mobilePhoneNumber


I would agree that libphonenumber is the go-to for what you want to do. The JS build process for it is... involved, but you can find pre-built versions of it for Node, UMD, etc.


libphonenumber is definitely the jam for offline formatting - we use it all the time.


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.


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.


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?


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.


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.


Security through obscurity doesn't always work. You could do the same by calling a list of numbers and playing the odds by using like AT&T or Verizon randomly and get a lot of people that way too.


It's worth noting that the carrier it returns and the brand of network aren't necessarily the same - at least here in the UK.

For example the Giffgaff network is carried by O2, and a UK landline rented through Twilio appears to be carried by Jersey Telecom.


See my answer here - https://news.ycombinator.com/item?id=9300690 - about why you're getting O2 for a Giffgaff number (Giffgaff is an O2 MVNO, and owned by O2's parent Telefonica as it happens).

Re: a Twilio UK landline number coming up as JT, as you're probably looking at the results of a SS7-MAP command that returns the SMS routing info for a particular number, in this case it's likely that JT look after the SMS side of that number (routing for voice and SMS and the networks themselves are generally quite separate).


Ah, glad someone else with experience is in this thread. You've saved me a bunch of typing.


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


Yes. Yes we will. :'(


A filter to exclude referrers from ycombinator.com would offset some of that.


A higher than 100% click thru rate!


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

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


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.


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 is a useful tool) it'd show the original operator.


The free part of the api is but the carrier information is more involved


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...


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


The lowest I've found out there for bulk is $0.002, not $0.0001; what service do you use? I'd owe you a few beers if that's not a typo


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?


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 :(


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)

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


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


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...

'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.'


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.


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


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.


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.


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


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.


Are you able verify that the user's billing address is within a given area or return information related to that? nextdoor.com uses it to verify that you live where you say you do and I'd definitely pay to validate that information.


I don't think that'd be possible with [Local number portability](http://en.wikipedia.org/wiki/Local_number_portability). You can move your number anywhere, with a mobile number you can get a number anywhere, and with VoIP services, you don't even necessarily need to be in the US to get a US number. There's absolutely no way to verify the person actually lives where the number is supposed to be.


Thank Rob,

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


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.


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


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. ```


Telesign also has the ability to return the billing name. Can you also provide that?


Any idea if/when that'd happen? ;)


Can't commit to anything yet - do appreciate the feedback though.


Yeah, I was pretty surprised that this wasn't there.

I tried a bunch of UK numbers for big cities (and my US mobile number) and none had city information.


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.


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.


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.


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.)


This is not true at all. I can give you the current provider of a number that had been ported and my data will reflect a new port within minutes of it taking effect. Oh, and it's an order of magnitude cheaper than what Twilio is charging for this... I couldn't tell you why Twilio's implementation is out of date and so expensive.


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.


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.


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


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.


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?


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.


I can see good use for it.

"Some number types don’t accept all communications -- for example, most landline numbers and many VoIP numbers do not accept SMS messages. Identify which kind of communications users can accept, based on their number type. This allows businesses to optimally decide whether to send voice or text communications for $0.005 per lookup" - from that page

When you type a landline number into my app that sends text messages it will fail. So I can choose to pay Twilio to confirm that the number can receive SMS. My users have mistyped their numbers in the past and that can be awkward when some random stranger gets a text from my system in the middle of the night.

That being said, they would charge me half a cent per lookup. I probably won't bother with local numbers, but I think I will use this for international numbers.

Additionally, since Twilio is giving me national format preference data for free, I might as well reformat a user's entered number to match their usual preference as eye candy. Although, I will just use http://www.phoneformat.com/ JavaScript library like I planned since I want to auto-format numbers as they are typed.

If you are making a site like Craigslist and want to enforce phone verification for making new accounts, you can require that users use a cell phone number instead of easily obtainable VoIP numbers. Craigslist implemented something like this in-house.

Another good use is now you can see if the robocall you received originated from a Twilio number. I looked up my Twilio numbers and they show up as "Twilio" under carrier. The page is live, so you can lookup numbers for free. You can then file a ticket with Twilio and make that person's life miserable.


Well... I need to find people who are using Google Voice as their 2 factor auth phone number and destroy them, this looks like it works well:

... "name": "Google (Grand Central) BWI" ...


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.


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!


Awesome - thanks for giving it a swing.


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


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


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


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


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.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: