WikiMedia's Geo IP Lookup JSONP call
geoiplookup.wikimedia.org
geoiplookup.wikimedia.org
I know the security-minded among you are going to start complaining that it would be easy to add a nonce, but we'd rather avoid that. Our strategy is to serve virtually everything from cache.
All user request have an X-AppEngine-Country header which contains the ISO-3166-1 alpha-2 country code for the user, based on the IP address of the client request.
(from Version 1.5.1 http://code.google.com/p/googleappengine/wiki/SdkReleaseNote...)
Geo = { /* object literal */ }
I assume this service is meant to be consumed via <script> tag injection. Without a JSONP-style callback parameter, what are consumers to do, inject-then-poll until a "Geo" object is found in the global scope? <script src="http://geoiplookup.wikimedia.org/"></script>
<script>geoloaded()</script>
</body></html> <script type="text/javascript">
var response = undefined;
</script>
<script type="text/javascript" src="...">
// response = { .... };
</script>
<script type="text/javascript">
_callbacks[1234](response); // response == undefined means error
response = undefined; // allow garbage collection
</script>
It's a bit more administration, but I really like not having to worry about dynamic callback names, delayed errors, or non-existent callback functions any more.http://www.geoplugin.net/json.gp
Other formats here: http://www.geoplugin.com/webservices
Have been using it in production now for several months, works great.
https://github.com/krickert/IPAddressZipCodeStateCountryLuce...
It downloads one of the many free DBs of IP addys and makes it into an index. You can do geo spatial searching APIs with IP addys.. Fun stuff.
It's a sinatra app which uses the MaxMind data, typically responds in < 1ms, and it has caching built in (if you deploy it to heroku).
I find it strange that depending on the device, that I will be detected in different areas (even within the same service).
For example: Google Maps says I'm at a park about a 10 minute drive from my current location. But if I view the mobile version of it on my iPod, it can find me to the room of the building I am in.
Anything that's not google or apple puts me in Hamanako, which is a 2 hour drive on the expressway.
I can't seem to find the relevant mailing list threads, but here's some evidence of ad-hoc accuracy testing last August: http://meta.wikimedia.org/wiki/MaxMindCityTesting