Hacker News .hnnew | past | comments | ask | show | jobs | submitlogin

> Get the following datapoints from any IP address;

Again :-( I just wonder if people will ever stop making assumptions about others given their IP address or hair colours and divide the Internet on these slippery grounds. The only legitimate and valid way to determine the client's location automatically is the browser or the OS geolocation API, and for the language it is the HTTP_ACCEPT_LANGUAGE header. The fact I have contacted your server from an IP address assigned to a Chinese ISP neither means I'm in China nor that I speak Chinese.



Believe it or not, you make up about 0.000001%[1] of the internet users. There is no saying in what this can be applied, it doesn't have to be for language or anything like that. It doesn't even have to be anything customer facing, and if it's just some stats you will probably probably just be a bit of noise.

Don't get me wrong. I totally agree that this thing is definitely not accurate(it thinks i'm 1300mi away) but it's good enough to get a general idea.

[1] made up number to get my point across


Yes, and you've made up a number that reinforces your point. A number that, if wrong, could negate your point.

Many more people are using VPNs these days. It's still not a large percentage, to be sure, but people are indeed doing it. Hell, I'm on my company VPN right now, and this site mis-identified my location because our VPN is set up to route most addresses in AWS's address space through the VPN (and ipdata.co appears to be hosted on AWS).

Then you have stuff like people on planes (usually this is all routed through a single PoP somewhere), people on mobile data who are roaming internationally (often proxied through one of the home carrier's PoPs), etc.

I think using IP geolocation is a decent first-order approximation, and is useful if there are no other ways to get that information, but it must always be treated as unreliable.


I agree that IP geolocation is a good approximation. It is never accurate up to street level.

Meanwhile, there is API to detect VPN, so that we can aware that the geolocation is good up to the server physical location.

https://www.ip2location.com/ip2proxy-web-service


Our API now supports detecting Tor nodes https://api.ipdata.co/103.10.197.50


We're working on creating our own offering on this. We'll have Tor Exit node detection first and are planning to make that generally available to all our users within the week at no extra cost.


I think the issue is that with the rise of VPNs, you're now looking at >1% of users being from a mislabelled country.


It's more than that, for some countries.


Usually right because people from these countries are trying to evade location-based discrimination and privacy infringement


    Indonesia -- 47%
    Thailand -- 39%
    Brazil -- 36%
    Turkey -- 36%
    UAE -- 36%
    Viet Nam -- 35%
    Saudi Arabia -- 34%
    India -- 32%
    Malaysia -- 32%
    ...
    UK -- 14%
    US -- 14%
https://wi-images.condecdn.net/image/3K6WrWwGrKN/crop/810


I can not for the life of me read anything in the linked image.

Here is a better version of it: http://cdni.wired.co.uk/1920x1280/g_j/infopornhorizontal_1.j...


Thanks :)


Those are clearly wildly incorrect numbers. I doubt if even 4.7% (a tenth of your figure) of internet users in Indonesia know what a VPN is.


Not knowing what a VPN doesn't exclude you from using one. Many workplaces use VPNs and it's likely that public internet access points (such as libraries, lounges, restaurants and cafes) could be using VPNs too.

Wikipedia says that Indonesia has an internet penetration rate of 50%. It might be reasonable to assume that a low penetration rate means that a significant amount of the internet access is happening in a work place rather than in a residential place. If a significant amount of access is happening at a work place it might also be reasonable to assume that a lot of that access is happening over a VPN.

https://en.wikipedia.org/wiki/List_of_countries_by_number_of...


It's pretty clear that VPN usage has increased dramatically in recent years. And at least I cited something. I could point to other surveys with comparable results. What's your evidence that it's so much lower?


Actually, more like 20% of all Internet users :)

https://wi-images.condecdn.net/image/3K6WrWwGrKN/crop/810


Believe it or not, but my Mobile carrier frequently hands out IPs that are geolocated to anywhere but my country. I usually get French or Dutch websites.


This comment reminds me of the couple of people on HN that complain everytime someone shows off a new product and it doesn't work well in their text only lynx browser.

It's such an extreme edge case that it doesn't really matter. (unless you are of course targeting that type of market).

In other words, IP address gives a general location in a huge number of cases.


It's fine as long as you're willing to accept that it's going to be wrong an unknown amount of the time.


Unkown, but very probably within a certain range whose boundaries are known.


In my case it gets country and city but misses completely the ZIP and area, as did all similar services tried so far. If someone threw a non nuclear missile to those coordinates I would probably just hear a distant bang.

I'm curious to know if other people noticed the same level of accuracy.


IP Geolocation might never be the silver bullet for determining user location. Like I've mentioned before if it can't pin you exactly it'll give your co-ordinates as being at the center of the population. Use it where you're okay with having a general idea of your user's location or as a fallback where other means of geolocation are not available eg. via browser, or GPS via mobile apps


Indeed. Certainly most useful for getting a ballpark idea of where, in general, your users are located. I would guess anything that really depends on knowing an individual user's location oughta use something more specific. But you could, say, put certain countries or languages as the default of a drop-down based on IP and be right and bunch of the time, while still allowing the user to make a different choice easily.


Got mine pretty close.


Ugh, you're absolutely right and I can't speak enough about how much this annoys me. I run up against issues caused by well-intentioned "get your location from your IP" lookups at least once a week.

Completely ignoring the aspect of VPNs (which is huge), I've also been fighting this mentality for the past few months trying to prove to Coinbase that I'm a US citizen with my US bank account (however I signed up from an IP in Croatia!), and being completely unable to do mundane tasks like browsing/editing my Google Photos photobooks since I wasn't on a USA IP.

Can we please, please, please stop tying IPs to location? It's obnoxious to have to set up proxies just to prove I am who (or where) I say I am.


This just is not reality.

It’s funny... Google says this same thing publicly on their various webmaster blogs, but you know how Google Analytics determines your location? Your IP.


This can be considered a reasonable way when it's about statistics rather than about an individual user experience.


Agreed. Using IP for things you present to the user is strange and presumptuous. But the geolocation API is kind of “creepy” I image for the user. At least that’s always how it feels to me.


To be honest, this is (usually) only used for geotargeting the nearest Anycast address (or Unicast address if you are too small to operate a GeoDNS->Anycast setup). Well, that, and anti-fraud measures to flag transactions for additional verification.

People who are using it for real-world-location and language detection are doing it wrong but being wrong on the internet is a common problem. :/


It's not so clean cut. For a web browser, I think it's better to ask the user to share location data so that you can use that to make their experience. They would do this using the methods you suggest.

I think the risk here is the assumption that the only devices where you may care about GeoLocation are ones that have this capability. There are cases where using the less precise GeoIP option is not only legitimate, but it's the only option you have. What about IoT or embedded systems where you may not have the capacity to determine the location?

You can't treat the data obtained from GeoIP databases as being absolutely precise. However, for most cases the data will be precise for most people's needs.

I'd be interested in hearing how you handle devices that don't have the APIs you mention.


True but for most users it's enough.

And it's sometimes the only information they have if the geolocation api doesn't give them anything.


If the geolocation api doesn't give anything - that probably means the user has chosen to configure it this way because they don't want to share their location. You should probably ask them in case you actually need to know where they are.


If one is not even allowed to guess with the user's IP the language this should be asked in, should the first question be some kind language selection form with just pictograms in it? :-)


True. But what language should you ask them in? Correctly assuming some details improves the UX for the many.


You should ask them in whatever language their Accept-Language HTTP header specifies. If there isn't one, then ok, maybe look at their IP. But it makes no sense to treat the IP as a more valuable source of information than the HTTP header that's there for exactly this purpose.


If there isn't one (which is rather improbable - AFAIK all the browsers have it set by default), then it should be either English or both English and the language assumed given the IP address.


Of course IP geolocation is terrible for language selection, but that doesn't make passive rough location information useless in general. What if, for example, you want to show someone nearby flights? You could ask them to enter their zip, or you could save them a step and make suggestions based on their geolocation. They could update the location if they wanted information on somewhere else or if you got the location wrong, and that's worse case 1 step, and best case no steps - you improved your UX!


The problem is when people fail to distinguish "helpful assumptions" from "actual facts"... I have just today gutted some worse-than-useless GeoIP functionality from a form that was facing customers of our organization so it could guess at their country, language, and city without asking.

BI guys put in the feature request some years ago so they could make pretty maps (but ultimately take no actionable steps based on these), and call center were then taking these guesses as facts (think getting a call and having someone chummy ask "Hey, how's the weather in <city you don't live in>" in the wrong language...). What's worse is we then added some user-facing fields asking for the location information, and it was impossible to tell apart user-supplied info from the IP-derived info!

It took fighting with BA and BI, but we finally decided it was stupid and were able to simply remove it. (BI will have to "fix their maps" by doing their own assumptions, outside of the application)


That's a great point, and great example to illustrate it. IP geolocation should definitely be treated as a "helpful assumption".


I couldn't agree more, specially now that VPN usage is starting to be mandatory in some countries




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: