Hacker News new | ask | show | jobs
by barbazoo 1613 days ago
I skimmed the post but couldn't find out how one would know what provider to use. I guess you could ask whoever you're texting with but that's not very reliable, not everyone knows, and people change their provider.
4 comments

Twilio has an API to identify the provider. https://www.twilio.com/docs/lookup/api

Still costs money, but if you're sending a lot of messages, this would substantially reduce the costs.

"Twilio has an API to identify the provider ..."

  curl -s -X GET "https://lookups.twilio.com/v1/PhoneNumbers/$number?Type=carrier&Type=caller-name" -u $accountsid:$authtoken | /usr/local/bin/jq '.'
If you're sending a lot of messages through one of those, you can expect to be blocked pretty quickly unfortunately.
Just try them all...
This is a good point. With that said, one does not necessarily need to know the provider, it just makes the process more direct. An alternative approach is to send a message to every provider using the same number. The invalid addresses will likely bounce back, but the correct match will go through.
Definitely don't use your Gmail account to send them then unless you want to end up as one of those people that got their account suspended.
I’m wondering if it is possible to find a list of provider emails from other countries such as BraZil.
I mentioned this website in the post. It has a list of providers for different countries (Brazil included). I don't know how up-to-date they are, but it might be a good starting point. You can also always try contacting the carriers directly. https://email2sms.info/
Thank you, what I missed is how you do to find out for other providers. In Brazil you covered 50% of the carriers. But how can I help you to find out the other ones and update the information for you. Should I contact the providers and ask for it and send a Pull Request?

Again, thank you for putting this into a post!

"I skimmed the post but couldn't find out how one would know what provider to use."

I personally do carrier lookups in the unix shell with a 'curl' command using the Twilio API (see my other comment under you).

However, you can just look this information up on a number of different websites:

https://www.freecarrierlookup.com/

... et. al ...

Some countries allocate set prefixes to carriers which can be reliable if number porting doesn't enter the equation:

https://en.m.wikipedia.org/wiki/List_of_mobile_telephone_pre...

That list isn't very useful in this context unfortunately. There is no reliable mapping between area code and provider in North America.
That's why my first two words were "some countries". The US is but one.
Until the number gets ported to a different provider..
Oh, wow. Which is why my last 7 words were "if number porting doesn't enter the equation"