6 ms·
Show HN: IP Lookup
- a3voices 13y agoCreepily cool!
- colbyaley 13y agoIs this on Github?
- tekknolagi 13y agoIt literally says "fork me on GitHub" at the top right.
- deleted 13y ago[deleted]
- frogpelt 13y agoWay off topic (and probably annoying), but I literally see/hear the word 'literally' used in these two situations. When what is being said... 1. Is obviously literal and does not need to be qualified. 2. Isn't actually literal at all. Literally, that's the only two ways I hear it (except for rare exceptions).
- oneeyedpigeon 13y agoIt's obviously being used here for emphasis and humour - totally valid.
- nivla 13y ago>It literally says "fork me on GitHub" at the top right. It din't show up for me either. After a bit of investigating, it looks like Ghostery (and maybe AdBlock Plus too) sees Github ribbon as a tracker and automatically hides it.
- oneeyedpigeon 13y agoQuite ironic given the nature of the page you were looking at, and the details that, presumably, DID show.
- catmanjan 13y agoFor those who can't be bothered digging, uses http://ip-api.com/json/ http://ip-api.com/json/ For those who don't want their web service to rely on other web services, I recommend MaxMind's lite database, they have a fairly recent downloadable binary of IP to geographic coodinates.
- apazzolini 13y agoMine was accurate to within a half-mile, scary!
- vacri 13y agoMine is only 100m away - but then again, that's the location of the old GPO, which is usually used as the local "distance from X" position. I'm not sure about elsewhere, but here in Aus, ['road'] distance from A to B is the distance from A's post office to B's post office.
- D9u 13y agoMine was about 12 miles away from my actual location. It depends on your ISP, as well as your location. I'm in a rural area, whereas you are most likely in a more metropolitan location.
- wololo_ 13y agoThis only returns the city name along with the latLng for it. You probably live close to the center of the city (or downtown)
- weavie 13y agoMine was out by 200 miles. But I suspect that is more down to our companies crazy network routing.
- coderholic 13y agoIf you're after IP details via an API you should check out http://ipinfo.io http://ipinfo.io, eg: $ curl ipinfo.io { "ip": "67.188.232.131", "hostname": "c-67-188-232-131.hsd1.ca.comcast.net", "city": "Mountain View", "region": "California", "country": "US", "loc": "37.385999999999996,-122.0838", "org": "AS7922 Comcast Cable Communications, Inc.", "phone": 650 } $ curl ipinfo.io/geo { "ip": "67.188.232.131", "city": "Mountain View", "region": "California", "country": "US", "loc": "37.385999999999996,-122.0838", "phone": 650 } $ curl ipinfo.io/org AS7922 Comcast Cable Communications, Inc. $ curl ipinfo.io/8.8.8.8/org AS15169 Google Inc. More details available at http://ipinfo.io/developers http://ipinfo.io/developers
- nostromo 13y agoWe offer something similar for free. (One of our client deployments needed it, so we just made it free for everyone.) https://www.dailycred.com/api/info.json https://www.dailycred.com/api/info.json This returns the current requester's location, device, and language settings. Or you can just look for location for a specific ip like so: https://www.dailycred.com/api/local.json?ip=67.188.232.131 https://www.dailycred.com/api/local.json?ip=67.188.232.131
- lecle11 13y agoInteresting. Do you know how the Accept Language header is calculated? I can imagine that it can also be used to track users as in [1] 1: https://panopticlick.eff.org/ https://panopticlick.eff.org/
- nostromo 13y agoIt's in each browser request as a header - we just echo it back because it's not available to js. http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
- davidw 13y agoIt picked out a beautiful location for me. I really wish I were there, but I'm in an office park much further north, in Padova, which the one in the story actual nailed down to a few meters. https://maps.google.com/maps?q=42.83330000000001,12.833300000000008&hl=en&ll=42.799455,12.863874&spn=0.007116,0.016512&sll=42.799478,12.863932&layer=c&cbp=13,330.47,,0,5.55&cbll=42.799457,12.863877&t=m&z=17&panoid=Pjrq4yCOdoy2qJPo2W4s4Q https://maps.google.com/maps?q=42.83330000000001,12.83330000... By the way, Italy is amazingly beautiful isn't it! You can pretty much randomly pick a street view and without too much effort, find some interesting or beautiful scenery.
- infocollector 13y agoWhere can i find a copy of the database that is driving this?
- larsmak 13y agoMaxmind, http://dev.maxmind.com/geoip/geoip2/geolite2/ http://dev.maxmind.com/geoip/geoip2/geolite2/, is one option. Look into their git-repo for clients to read into their proprietary (but effective) db-format.
- JoshGlazebrook 13y agoHonestly, I have been around the block trying to find a decent company that provides either a database or api for looking up a location from an ip address. It seems like every company from MaxMind to IP2Location and all of the others are accurate for some ip addresses, and severely inaccurate for others. And I think that will only become more and more common as all of the ipv4 addresses run out and there are hundreds to thousands behind the same ip address. I've even tried crowdsourcing from four different ip to location sources and even then, sometimes all four return different cities and even states for a single ip address. Is there any company out there that is actually fairly accurate (on a city basis)?
- sbarre 13y agoI am guessing this is why companies like Google have sourced their own info. Geo-locating by IP will always be an imperfect process because it's not actually geolocating the IP, it's geolocating the block owner. My downtown Toronto office geo-locates as Kansas City in some cases because the org who owns the block is there. And I assume they are not keeping their records up to date as we have a /8 and I think they should be registering a sub-block or whatever it's called.. But there you go.
- chrissnell 13y agoYou have a /8? Are you Xerox? General Electric? :)
- alextingle 13y agoThere aren't that many /8s. You could just go through them all and see which one is "in Kansas City".
- psionski 13y agoHP has two /8s... No idea what they're doing with >33 million IP addresses....
- sbarre 13y agoSorry, I reasoned that wrong, I meant a /24.. :-( Didn't mean to start a whole thing..
- 2bluesc 13y agoWhat about those of us that get easily excited over IPv6?
- justincormack 13y agoIs anyone collecting this info for ipv6? Netflix has me in the wrong continent...
- D9u 13y agoI've been using http://freegeoip.net/ http://freegeoip.net/ It's not perfect, but it seems to be good enough for my purposes. $ip = $_SERVER['REMOTE_ADDR']; $ua = $_SERVER['HTTP_USER_AGENT']; $ch = curl_init(); // set url curl_setopt($ch, CURLOPT_URL, "freegeoip.net/csv/" . $ip); //return the transfer as a string curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // $output contains the output string $ip = curl_exec($ch); // close curl resource to free up system resources curl_close($ch); $array = explode(',', $ip);
- fiorix 13y agoAuthor of freegeoip.net here. It uses the db from MaxMind. Worth mentioning that the system is not only free but also open source, available at github.com/fiorix/freegeoip (currently written in Go)
- fleetfox 13y agotry https://github.com/rmccue/Requests https://github.com/rmccue/Requests
- hughesey 13y agoAlso available at http://viewdns.info/iplocation/ http://viewdns.info/iplocation/. There's an API as well http://viewdns.info/api/ http://viewdns.info/api/.
- linux_devil 13y agoAre you subscribed to map box? It's fast no doubt, but why you didn't move to free alternatives to reduce cost?
- hipaulshi 13y agoyou are absolutely right. switched to google map
- aabalkan 13y agoWhat is the database behind all these geo IP providers? I see many APIs providing same functionality and results are the same. Is this database purchased from somewhere every time you want to do this?
- brodd 13y agoMaxmind, probably. (http://www.maxmind.com/ http://www.maxmind.com/)
- vomitcuddle 13y agoMaybe include information if the IP is an active Tor exit node?
- ftfish 13y agoIf you want to take IP lookup one step further: https://github.com/fourtonfish/HelloSalut https://github.com/fourtonfish/HelloSalut
- fcambus 13y agoFor a fast GeoIP JSON API, you can try Telize which is open source and has a public API : http://www.telize.com http://www.telize.com It is built on Nginx + Lua so it has very minimal overhead. Source code is on GitHub : https://github.com/fcambus/telize https://github.com/fcambus/telize
- rb2k_ 13y agoI recently noticed that you could create your own "IP -> countrycode" lookup system by using the delegation tables provided by arin/ripencc/afrinic/... It might not be very accurate, but it's a fun little exercise: http://blog.marc-seeger.de/2013/09/07/ip-to-countrycode-with-ruby/ http://blog.marc-seeger.de/2013/09/07/ip-to-countrycode-with...
- chris_wot 13y agoLol! Optus still calls its AS Microplex! Microplex hasn't been around in a decade and a half!
- known 13y agohttp://geoiplookup.wikimedia.org/ http://geoiplookup.wikimedia.org/
- taternuts 13y agoSimple and cool! I'm starting to learn python so I'll definitely be looking through the source, thanks for posting, flask looks like a nice little framework to get started on
- tedchs 13y agoA while back I needed a no-cruft way to get my IP reliably, so put this in my nginx config, to allow "curl example.com/ip": http { # ... perl_modules /etc/nginx/perl; perl_require myip.pm; # ... server { # ... location = /ip { perl myip::handler; } # ... } } then in /etc/nginx/perl/myip.pm : --- package myip; use nginx; sub handler { my $r = shift; $r->send_http_header("text/plain"); return OK if $r->header_only; $r->print($r->remote_addr() . "\n"); return OK; } 1; ---
- Brendalyn 13y agoIn general, the accuracy of geolocation is at 70-80% at the city level. We have researched and compare the data from several providers such as IP2Location, Maxmind, Geobytes and so on. The IP address can be freely reallocated to any postcodes within one or multiple cities so we think that the 70-80% is acceptable.