Crossposted from https://lemmy.blahaj.zone/post/48779421

I'm writing a program that can find info about a phone number. One problem appears to be that Google's phone number library doesn't provide enough info. For instance, take this number: +1 (613) 745-1576. My iPhone correctly says "Ottawa, Ontario, Canada", while Google's library doesn't return the city? How does my iPhone pick this up but not Google's own library? Is this provided by cell carriers? Is it something with the 745 block? If so, where can I find this info?

you are viewing a single comment's thread
view the rest of the comments
[–] 1 point 5 hours ago

My iPhone correctly says “Ottawa, Ontario, Canada”, while Google’s library doesn’t return the city?

There was a time when a phone number's area code and exchange would indicate a pretty constrained geographic area -- for a land-line. I don't think it's possible to do this kind of "find the geography from a phone number alone" lookup accurately in the modern environment. Whatever API Apple provided got your example number right, sure. But how will you know when it gets one wrong? How can you know how often it gets it wrong? What does it really mean to assign a place to a cell number?

My own phone number consistently gets pegged by these things as "belonging to" a specific town several miles away from where I live, probably because the exchange part of my number is one that used to be associated with that town. But that observation doesn't produce any kind of useful information today, it's just misleading.

  • source