News for hackers. Stuff that matters.

Ask HN: 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?

( 3 comments | 2 points | on HN )
Re:Ask HN: How to do phone carrier lookup? by toast0 on Sunday September 12, 2021 @12:34AM (#28498643)
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.

Re:Ask HN: How to do phone carrier lookup? by alam2000 on Saturday September 11, 2021 @08:50PM (#28497562)
If you have the IP address, you can look for MNC and MCC using the IP2Location database.

The free lookup is at https://www.ip2location.com/demo

Re:Ask HN: How to do phone carrier lookup? by jscohn85 on Sunday September 12, 2021 @12:32AM (#28498639)