News for hackers. Stuff that matters.
Re:Show HN: Free and easy geoip API thanks to Cloudflare and... by Eun on Thursday October 06, 2016 @12:23PM (#12653739)
I did something similar: https://ifcfg.me

Also via json: https://ifcfg.me/json

Re:Show HN: Free and easy geoip API thanks to Cloudflare and... by ionwake on Thursday October 06, 2016 @12:33PM (#12653808)
What is the rate limit for use on your service? I have a demo I keep trying to get onto HN but it falls over when it hits the front page.
Re:Show HN: Free and easy geoip API thanks to Cloudflare and... by Eun on Thursday October 06, 2016 @01:19PM (#12654219)
There is none, what did you tried exactly, can you show some code?
Re:Show HN: Free and easy geoip API thanks to Cloudflare and... by ionwake on Saturday October 08, 2016 @12:00PM (#12667379)
I haven't tried it with your service yet - but I will now - thanks!
Re:Show HN: Free and easy geoip API thanks to Cloudflare and... by packetized on Thursday October 06, 2016 @01:12PM (#12654142)
Huge fan. Use this nearly daily in my terminal opening screen; nice and quick to tell you where are, net-wise.
Re:Show HN: Free and easy geoip API thanks to Cloudflare and... by nodesocket on Friday October 07, 2016 @01:30AM (#12658396)
How did you get LAN-Addresses and Internet Service Provider?

Is this on GitHub by chance?

Re:Show HN: Free and easy geoip API thanks to Cloudflare and... by stephenr on Friday October 07, 2016 @02:56AM (#12658713)
For most people's uses, the AS Number & info for an IP is sufficient.

I suspect perhaps s/he's using an older/outdated GeoIP database/service as the AS Number returned for my IP is wrong.

The LAN address lookup (which doesn't work on Safari) is utilising a security hole in WebRTC.

Re:Show HN: Free and easy geoip API thanks to Cloudflare and... by contingencies on Friday October 07, 2016 @01:01AM (#12658309)
To me, the whole idea of this API is an anti-pattern: embedding Javascript in a website to make an entirely new GeoIP lookup from a third party host is wasteful and unreliable.

If you want GeoIP details in served JS, the details should be served from an existing host on the initial page load where you can centrally manage availability/maintenance/etc.

If you are doing nodeJS or something server side, then it would be quicker to call out to established command line tools and cut out an entire internet round trip.

Re:Show HN: Free and easy geoip API thanks to Cloudflare and... by jasonlingx on Saturday October 08, 2016 @10:27AM (#12667039)
Could you elaborate what you mean by "If you want GeoIP details in served JS, the details should be served from an existing host on the initial page load where you can centrally manage availability/maintenance/etc."?
Re:Show HN: Free and easy geoip API thanks to Cloudflare and... by stephenr on Friday October 07, 2016 @02:50AM (#12658699)
I know "negative" comments are discouraged for Show HN, but seriously who is using this type of thing? I'm really not sure I understand the point of things like this, besides "make every possible library/unix tool a service". What's next, "sprintf as a service"? Maybe just "println as a service". You make a request, and it returns the same string with "\n" appended.

The MaxMind GeoLite database will give you quite a lot more information than this does, with a single call to the library, and can be delivered as part of your main page response if necessary.

The MaxMind GeoLite database also isn't reliant on CloudFlare to work.

Re:Show HN: Free and easy geoip API thanks to Cloudflare and... by jasonlingx on Saturday October 08, 2016 @10:28AM (#12667045)
This is for static websites.
Re:Show HN: Free and easy geoip API thanks to Cloudflare and... by NetStrikeForce on Thursday October 06, 2016 @09:54PM (#12657602)
Some services will geolocate you by looking at your DNS server's geolocation, so when you try to resolve their endpoint www.example.com you'll get back an IP address pointing to the closest datacenter.

How do you know how is your DNS server geolocated? I made a tiny proof of concept of a DNS reflector with a little extra:

$ dig +short whoami.fluffcomputing.com txt

Or in Windows:

nslookup -type=txt whoami.fluffcomputing.com

Or in PowerShell:

(Resolve-DnsName -Type txt -Name whoami.fluffcomputing.com).strings

The DB used is MaxMind's GeoLite2; so the system is as (in)accurate as the DB might be.

If you just request an A record you'll get just your DNS server IP address as other services do (e.g. whois.akamai.net).

Re:Show HN: Free and easy geoip API thanks to Cloudflare and... by vivekv on Thursday October 06, 2016 @12:54PM (#12653986)
I run http://ipof.in which provides data in various formats
Re:Show HN: Free and easy geoip API thanks to Cloudflare and... by benjmn on Thursday October 06, 2016 @11:34PM (#12657958)
Rely on this for my client's websites : https://ipapi.co

Bigger free tier + https

Re:Show HN: Free and easy geoip API thanks to Cloudflare and... by nodesocket on Friday October 07, 2016 @01:37AM (#12658425)
Your GeoIP response is bundled into a single array? That seems incredibly hard to parse and groc.

"geoip": [ 0, 37.7957, -122.4209, "California", "San Francisco", "United States" ],

Re:Show HN: Free and easy geoip API thanks to Cloudflare and... by rgbrgb on Thursday October 06, 2016 @12:18PM (#12653692)
What's the response? Just country name?

I've been using this recently to suggest locations when users set up a feed: https://freegeoip.net/

It uses MaxMind data.

Re:Show HN: Free and easy geoip API thanks to Cloudflare and... by gruez on Thursday October 06, 2016 @12:42PM (#12653881)
Country name only
Re:Show HN: Free and easy geoip API thanks to Cloudflare and... by sudhirj on Thursday October 06, 2016 @12:31PM (#12653792)
Built this based on Google App Engine geolocation headers. http://www.runway7.net/blip
Re:Show HN: Free and easy geoip API thanks to Cloudflare and... by paulrosenzweig on Thursday October 06, 2016 @09:49AM (#12652395)
Will Cloudflare cache the same response for different countries?
Re:Show HN: Free and easy geoip API thanks to Cloudflare and... by jasonlingx on Thursday October 06, 2016 @10:17AM (#12652606)
It shouldn't.
Re:Show HN: Free and easy geoip API thanks to Cloudflare and... by ionwake on Thursday October 06, 2016 @12:32PM (#12653804)
Are coords returned ? Is it possible to get them?
Re:Show HN: Free and easy geoip API thanks to Cloudflare and... by sudhirj on Thursday October 06, 2016 @02:40PM (#12654909)
Already commented here, but http://www.runway7.net/blip has coordinates.
Re:Show HN: Free and easy geoip API thanks to Cloudflare and... by ionwake on Saturday October 08, 2016 @12:00PM (#12667383)
odd I didnt see the comment any way thanks!
Re:Show HN: Free and easy geoip API thanks to Cloudflare and... by priitmaxx on Friday October 07, 2016 @11:52AM (#12661592)
Does anyone know if AWS supports this?
Re:Show HN: Free and easy geoip API thanks to Cloudflare and... by stephenr on Friday October 07, 2016 @02:07PM (#12662660)
Ip to rough location (to city level usually) can be done via the maxmind geolite database. Api support exists for most languages, and calls are almost instantaneous.

So any computing resource where you can install the maxmind database and library "supports" GeoIP lookups.