this service does a lot more than just return your remote_ip, which wont work behind a load-balancer or other proxy unless you configure realip module. and also need to add geoip module to do all the location stuff
That said, do you know of any software library that exposes the Geoip database (or at least Geoip Lite which you one easily obtain for free) in a nice API? Like how a lot of programming languages have tzinfo/tzdata libraries for querying the Tz database.
So it has ruined my second favorite wordpress security plugin - and MaxMind not really usable like it once was (?)
https://dev.maxmind.com/geoip/geoip2/geolite2/
In practice it's good enough for many purposes. It's actually the version of the database that ifconfig.co uses.