34

Is there a free API or some other way to determine what carrier a cell phone number is registered with?

I'd like my application to broadcast text messages without them picking their carrier from a list.

UPDATE: Interestingly, a coworker found the answer: http://developer.whitepages.com/

UPDATE2: Well the whitepages license agreement is so restrictive that you can't build an app for it. Any other ideas?

UPDATE3:
At some point, someone removed my Update 2. This puts it back. More importantly as of 10/19/2015 the Terms of Service is still in a state that it should be impossible to legally utilize their services.

NotMe
  • 87,343
  • 27
  • 171
  • 245
  • 1
    Also check out https://gist.github.com/coolaj86/8908841 where I threw in an example using xminder. – coolaj86 Feb 10 '14 at 22:40
  • 2
    @NotMe - I work at Whitepages Pro. We have hundreds of customers (big and small) leveraging our APIs to get phone data including carrier, owner, address, etc. Why do you think it is restrictive? Please let me know and I am happy to work with you on it. http://developer.whitepages.com. My email: kshah [at] whitepages [dot] com – adroit Jul 07 '16 at 12:37
  • @adroit: you'll notice that I posted this close to 8 years ago. I'm sure your terms of service have changed since then. :) As I recall there wasn't even a paid option back then. – NotMe Jul 07 '16 at 15:09
  • @NotMe - OK. Got it. Just FYI - We do not have necessary APIs and paid options. If you are still interested, happy to talk further. – adroit Jul 07 '16 at 18:14
  • @adroit: I'm not sure why you say you don't have paid options: http://pro.whitepages.com/solutions/pricing/ and http://pro.whitepages.com/developer/api-pricing/ is pretty clear on that subject. – NotMe Jul 07 '16 at 21:49
  • Sorry, Yes, I meant we do have paid options. – adroit Jul 09 '16 at 14:13
  • 2
    This is a very old post, but since nobody has yet mentioned Twilio's Lookups API, I'll do so now. https://www.twilio.com/docs/api/lookups The cost per lookup is $0.005 if you're just looking for carrier info. I think it's an extra $0.01 if you want to know the caller ID too. It's pay as you go and you get a small credit upon signup. It's what I use in my app. Hope that helps someone. – Tom Walker Feb 16 '18 at 21:14
  • Thanks so hall monitors for ruining another question I just found with Google. You're working for free and making the user experience worse. – user1130176 Mar 12 '19 at 11:02
  • 1
    All of these responses discuss services rather than standards. How can one make a service like the api's discussed below? – duhaime Sep 09 '19 at 21:47

8 Answers8

13

Data24-7 offers an API for looking up the carrier for wireless phone numbers. It also returns the email addresses to send SMS and MMS messages to the phone. It's not free, it's $12 per month and $0.006 per lookup.

The link is: http://www.data24-7.com

Marc
  • 131
  • 1
  • 3
  • 1
    Interesting. Does it handle number portability? In other words, if they signed up with AT&T, then switched their number to Verizon will your service give the correct Verizon email? thanks, – NotMe Apr 10 '10 at 15:03
  • 1
    Yes, if somebody switches their phone service to a new provider, it should be updated in our service within a few hours. – Marc Apr 16 '10 at 21:17
6

I know this question is 5 years old already but for those still looking for something, PacificEast (who I work for) offers a Line Identification Append service for US and Canadian numbers that handles local number portability. The service is available as a SOAP API or as a batch service (you send PacificEast your file, they process it and send it back). Besides the carrier, the service will also identify line type (wireless, landline, etc.), whether the number has been ported or not, and some geographic information.

TLiebe
  • 7,913
  • 1
  • 23
  • 28
4

If you are looking for what I was (a way to easily email -> SMS people for a program), I believe the best is going to be to send an email phonenumber@sms-gateway to each carrier for the country. In doing so, the number will only work with one carrier where the number is active at this moment. The other emails will be returned.

If you try to look it up using an online service, you are now relying on the carrier they have in their database, which may be outdated.

tim-montague
  • 16,217
  • 5
  • 62
  • 51
user875479
  • 135
  • 7
  • 4
    This works for the onsie-twosie use case, but email services (i.e. gmail's SMTP) will block you when your sent messages vs rejected messages ratio gets too high over time and number of messages sent. – coolaj86 Feb 10 '14 at 02:07
  • @coolaj86, there really aren't a lot of carriers. To reduce the rejected messages, better guesses could be made based on (a) the country name, or a smaller region, and (b) the ranking of the carriers with the most customers (or phone numbers) for that region, and (c) not messaging all carriers at once, but going to the next carrier in the ranking when a rejection message is detected, and (d) caching the carrier once found, to avoid a lookup in the future. – tim-montague May 20 '22 at 05:45
  • Another solution, might be to use the "transfer your number" check that carriers provide: https://www.att.com/wireless/transfer-your-number, https://www.verizon.com/switch-to-verizon/, etc. Usually a number can be transferred. If it belongs to the carrier already, then it can't be transferred. – tim-montague May 20 '22 at 06:53
3

You should note that the way to figure out which carrier a number belongs to will be country-specific (though, some countries might use the same scheme, but I'm not sure - I've worked with both the norwegian and swedish portability databases and they're quite different api-wize - and require vpn + authentication).

The information is, at least here, not available to the public - I've seen service providers, network operators and information providers (as in yellow pages) that have access.

But otoh, wouldn't a proper sms gateway service do this for you?

tommym
  • 2,230
  • 15
  • 11
3

Neustar would be your best bet, they handle lookups, number portability, Do Not Call list, etc... The service is not free but they are the most reliable in the business. Another option might be Twilio

Phill Pafford
  • 83,471
  • 91
  • 263
  • 383
  • 2
    I've been using Twilio, they work pretty well. – Kenny Cason Dec 03 '10 at 17:13
  • Does twillio have APIs to determine the carrier given a phone number? – rOrlig Feb 24 '12 at 17:12
  • you're going to have to dig into the docs on this one as I'm not sure. I did a quick scan and didn't see it but that doesn't mean they don't offer something – Phill Pafford Feb 24 '12 at 19:15
  • I did see the Twilio docs and I don't see the API. But Kenny replied that he has used Twilio for the purpose so I was wondering if I missed something. The only thing provider I have seen is http://www.data24-7.com but it seems pretty pricy for my purposes. – rOrlig Feb 24 '12 at 21:05
  • After reading a little more I did see this: http://illuminatikarate.com/blog/finding-the-carrier-of-a-cell-phone-number-in-php/ and – Phill Pafford Feb 25 '12 at 01:43
  • and? the company in the blog was bought. I don't see Twilio or Tropo APIs that support this. – rOrlig Feb 25 '12 at 05:07
  • I did also see this: http://www.data24-7.com/ Carrier Lookup: http://www.data24-7.com/carrier24-7.php – Phill Pafford Feb 25 '12 at 05:16
2

Your biggest problem is that people can now take their numbers with them. So while in the past cell phone carriers had blocks of phone numbers, and probably still do, there's no reliable way to map a specific cell number to a certain carrier.

TravisO
  • 9,406
  • 4
  • 36
  • 44
  • 1
    http://en.wikipedia.org/wiki/Local_number_portability – Phill Pafford Dec 03 '10 at 15:15
  • 1
    There are services available that can take ported numbers into account and provide the correct carrier even if a number has been ported. Services that query the phone network directly can determine the correct carrier even if a phone number has been ported that same day. – TLiebe Nov 23 '13 at 17:32
2

You can try to screenscrape from a website like http://www.fonefinder.net that does a 'whois' on the number

Here is an example url to scrape. (I verified its really sprint, so that is correct)

http://www.fonefinder.net/findome.php?npa=817&nxx=683&thoublock=2926
Trey Brister
  • 363
  • 2
  • 5
  • 1
    I tried this on my own number. I switched carriers about 6 months ago. This site is still showing my old carrier. – Dave Rager Aug 09 '12 at 15:28
  • 1
    Seems like they only know the original carrier of the number (i.e. they don't handle ports). – Kyle May 21 '13 at 18:08
  • 1
    I switch my carrier 10 years ago... and this site still shows the old one. I don't think they are actually doing a lookup on the phone number. Instead they appear to just look at the area code and exchange to see which company it was originally assigned to. – NotMe Jun 21 '13 at 14:02
  • Is whocalled.us any better? – user2233706 Jul 31 '13 at 19:43
  • @user2233706: No. They aren't any better. Still old data. – NotMe Sep 16 '13 at 23:36
1

I recently wrote one in Ruby that interfaces with the aforementioned FoneFinder.net

https://rubygems.org/gems/FoneFinder --> Ruby Gem page
https://github.com/evinugur/FoneFinder.rb/ --> Github Source

You can use it to get a few fields of data that relate to a cell phone number, but to determine carrier, do this.

require 'FoneFinder'
myPhoneNumber = FoneFinder.new("123-456-7890")
puts myPhoneNumber.carrier
deadboy
  • 849
  • 2
  • 9
  • 28
  • They don't handle ports. I went direct to their site and entered my cell, which I changed providers for over a decade ago. They still show the original carrier. – NotMe Sep 16 '13 at 23:35
  • Still the case in 2023... – Danial Mar 02 '23 at 04:05