this post was submitted on 05 Oct 2026
5 points (85.7% liked)

Asklemmy

55892 readers
312 users here now

A loosely moderated place to ask open-ended questions

Search asklemmy ๐Ÿ”

If your post meets the following criteria, it's welcome here!

  1. Open-ended question
  2. Not offensive: at this point, we do not have the bandwidth to moderate overtly political discussions. Assume best intent and be excellent to each other.
  3. Not regarding using or support for Lemmy: context, see the list of support communities and tools for finding communities below
  4. Not ad nauseam inducing: please make sure it is a question that would be new to most members
  5. An actual topic of discussion

Looking for support?

Looking for a community?

~Icon~ ~by~ ~@Double_A@discuss.tchncs.de~

founded 7 years ago
MODERATORS
 

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?

top 5 comments
sorted by: hot top controversial new old
[โ€“] Shimitar@downonthestreet.eu 5 points 2 weeks ago* (last edited 2 weeks ago)

No idea how it works in Canada... But phone prefixes (745) definitely identifies an area, which might cover more than one town/city. Inside that phone area, there is no real way to understand where the phone line is located geographically. Either you have access to a bigger database where each line is recorded (carrier, I guess?)

Over here for example, phones start with 1 on nord-west and grow to 9 in south east .

The number of digits of the prefix also is very important. 1 is a 2 digits prefix (11,12,13....) While 2 and 6 are 1 digit prefixes . Depending on how big was expected to be the area it originally covered

So, there is no specific global rule, and each prefix cover an arbitrary area.

That basic idea is that back in time of mechanical switchboards, each number will close a specific mechanical switch to connect phisical lines all the way to the area you wanted. And the last 6 or 7 digits selected one final line. I mean phisical wire! So basically that created a phisical single connected wire from your phone to the receiver phone. Over hundreds of km.

[โ€“] Eggymatrix@sh.itjust.works 3 points 2 weeks ago (2 children)

Good luck with that. Where I live carriers allow you to relocate your landline number to a new address when you move out nowadays, so this might be an issue to keep up to date.

I would obviously add a disclaimer that the location provided may not represent the caller's current location as it is where the number is registered.

[โ€“] Shimitar@downonthestreet.eu 1 points 2 weeks ago

Yeah, today after moving to fully digital landlines as well there is no need to keep numbers tied up to geographical locations.

Still depend on your country rules tough. In mine, landlines all start with a 0 (zero) followed by a geographical prefix, so that will be unchanged (but can be spoofed). Mobiles start with a 3 instead, and those have no geographical location at all. And so on.

[โ€“] teawrecks@sopuli.xyz 1 points 2 weeks ago

Area code 613 is eastern Ontario. Apple likely just lists all 613 numbers as Ottawa. But also, your experience might be different calling between two iPhones, because similar to iMessage, the call may be relayed the through an apple-specific route using data.

But if the carrier has finer location info than that (and they do) you don't want it to be leaked to the receiver. It's not like when you go on vacation and call someone from your same SIM, they can determine where you're calling from.