HACKER Q&A
📣 da_big_ghey

How to do phone carrier lookup?


I want to do this so that I can send text message without paying for twilio or similar, using email to text gateway: https://github.com/mfitzp/List_of_SMS_gateways/blob/master/email2sms.csv

Surely there must be some database somewhere, like maxmind?


  👤 toast0 Accepted Answer ✓
My experience is these email gateways tend not to work very consistently, so .... good luck with that part.

There's a few ways to guess the carrier by the phone number, but there's number portability all over the place, so if you want reliable data, you really need to do a lookup (or dip as they're sometimes called) into the relevant national portability database, and that costs money, sometimes about the same as just paying for an SMS.

If you want to do it in the US based on original assignments, you can download the original assignments from NANPA's web-o-site, but you're going to need to spend some serious time on data cleanup, FWIW.

For other countries, Google's libphonenumber has some info on range -> operator, but portability is still the elephant in the room.