
Show HN: Free and easy geoip API thanks to Cloudflare and Heroku - jasonlingx
https://github.com/jlxw/geoip
======
Eun
I did something similar: [https://ifcfg.me](https://ifcfg.me)

Also via json: [https://ifcfg.me/json](https://ifcfg.me/json)

~~~
ionwake
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.

~~~
Eun
There is none, what did you tried exactly, can you show some code?

~~~
ionwake
I haven't tried it with your service yet - but I will now - thanks!

------
contingencies
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.

~~~
jasonlingx
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."?

------
stephenr
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.

~~~
jasonlingx
This is for static websites.

------
NetStrikeForce
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).

------
vivekv
I run [http://ipof.in](http://ipof.in) which provides data in various formats

~~~
benjmn
Rely on this for my client's websites : [https://ipapi.co](https://ipapi.co)

Bigger free tier + https

------
rgbrgb
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/](https://freegeoip.net/)

It uses MaxMind data.

~~~
gruez
Country name only

------
sudhirj
Built this based on Google App Engine geolocation headers.
[http://www.runway7.net/blip](http://www.runway7.net/blip)

------
paulrosenzweig
Will Cloudflare cache the same response for different countries?

~~~
jasonlingx
It shouldn't.

------
ionwake
Are coords returned ? Is it possible to get them?

~~~
sudhirj
Already commented here, but
[http://www.runway7.net/blip](http://www.runway7.net/blip) has coordinates.

~~~
ionwake
odd I didnt see the comment any way thanks!

------
priitmaxx
Does anyone know if AWS supports this?

~~~
stephenr
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.

