Live data from Hacker News

Show HN: A New, Clean Geolocation API

ipdata.co

121–130 of 168 posts

Re: Show HN: A New, Clean Geolocation API

#121

I have added a JavaScript Library. https://github.com/thomasconner/ipdata-js-library

Too cool! Ping me at jonathan at ipdata dot co and I'll set you up with free api keys for this! :) We can also talk about adding including some examples on the docs page.

Re: Show HN: A New, Clean Geolocation API

#122

Earlier quoted context omitted.

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 locatio…

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…

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

Re: Show HN: A New, Clean Geolocation API

#123

> 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 h…

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.

Re: Show HN: A New, Clean Geolocation API

#124
Great looking site, and good luck. My IP data was pretty much bang on, something I haven't seen before.

However, I was just looking at your Python SDK: https://github.com/ipdata/python/blob/master/ipdata/ipdata.p...

What are you thinking. Never do this in a library. Also it looks a bit amaterish, as it's your only currently supported library I'd fix it up a bit - don't add .pyc/dist files to git, make it pep8, remove sys.exit() in a library (!!!) etc.

Re: Show HN: A New, Clean Geolocation API

#125
post #124

Great looking site, and good luck. My IP data was pretty much bang on, something I haven't seen before. However, I was just looking at your Python SDK: https://github.com/ipdata/python/blob/master/ipdata/ipdata.p... What are you thinking. Never do this in a library. Also it looks a bit amaterish, as it's your only currently supported library I'd fix it up a bit - don't add .pyc/dist files to git, make it pep8, remove…

You're absolutely right! Not sure how/why that got in there in the first place. I'm fixing a new release right now. I'm also going to have the repo/package cleaned up.

Pushed a new release: https://pypi.python.org/pypi/ipdata/2.6

Re: Show HN: A New, Clean Geolocation API

#126
post #124

Great looking site, and good luck. My IP data was pretty much bang on, something I haven't seen before. However, I was just looking at your Python SDK: https://github.com/ipdata/python/blob/master/ipdata/ipdata.p... What are you thinking. Never do this in a library. Also it looks a bit amaterish, as it's your only currently supported library I'd fix it up a bit - don't add .pyc/dist files to git, make it pep8, remove…

[deleted]

Re: Show HN: A New, Clean Geolocation API

#127
post #124

Great looking site, and good luck. My IP data was pretty much bang on, something I haven't seen before. However, I was just looking at your Python SDK: https://github.com/ipdata/python/blob/master/ipdata/ipdata.p... What are you thinking. Never do this in a library. Also it looks a bit amaterish, as it's your only currently supported library I'd fix it up a bit - don't add .pyc/dist files to git, make it pep8, remove…

You're absolutely right! Not sure how/why that got in there in the first place. I'm fixing a new release right now. I'm also going to have the repo/package cleaned up. Pushed a new release: https://pypi.python.org/pypi/ipdata/2.6

Calling 'print' from within a library is pretty bad form too... responses and errors should always be returned as data that can be inspected programmatically. In this case it's even worse, as the code will just return None on error, and you don't know why.

Re: Show HN: A New, Clean Geolocation API

#128

> 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 h…

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…

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.

Re: Show HN: A New, Clean Geolocation API

#129
post #127

Earlier quoted context omitted.

You're absolutely right! Not sure how/why that got in there in the first place. I'm fixing a new release right now. I'm also going to have the repo/package cleaned up. Pushed a new release: https://pypi.python.org/pypi/ipdata/2.6

Calling 'print' from within a library is pretty bad form too... responses and errors should always be returned as data that can be inspected programmatically. In this case it's even worse, as the code will just return None on error, and you don't know why.

^ This. Never call print from a library, what if I'm using a script to pipe stdout somewhere. Just throw a custom GeolocationException or something, with some useful data about what went wrong. In this specific case though, just don't bother catching the exception. It's not useful and it indicates something is terribly wrong.

Re: Show HN: A New, Clean Geolocation API

#130
post #127

Earlier quoted context omitted.

You're absolutely right! Not sure how/why that got in there in the first place. I'm fixing a new release right now. I'm also going to have the repo/package cleaned up. Pushed a new release: https://pypi.python.org/pypi/ipdata/2.6

Calling 'print' from within a library is pretty bad form too... responses and errors should always be returned as data that can be inspected programmatically. In this case it's even worse, as the code will just return None on error, and you don't know why.

You're right. I guess it makes sense to let Request's exceptions propagate in case there are network issues. I'll work on ensuring pep-8 adherence and adding custom exceptions for the error codes in https://ipdata.co/docs.html#status-codes
Post reply on HN