GeoIP2 for retrieving city and region ?

Michael Torrie torriem at gmail.com
Fri Jul 12 18:15:27 EDT 2013


On 07/12/2013 10:32 AM, Νικόλας wrote:
> So, my question now is, if there is some way we can get an accurate Geo 
> City database.

As has been said pretty much by every other poster, there is no way to
do get an accurate location database.  Period.

The databases that do exist were built by hand, and also guessed at
based on routing information.  The best you can really do is region, or
country, and even that fails sometimes.

If you want to know a visitor's city you should ask them using the new
browser location apis available to javascript.

http://diveintohtml5.info/geolocation.html

Since IPs can be dynamic, sometimes even assigned across a region,
there's no way to accurately map ip addresses to a city with the
reliability that you seem to want.  Google is pretty accurate because
they've spent a lot of time building up their own database, and also
convincing users to reveal their locations to them.  Unless you do the
same thing, you have to just get by with what others have provided for you.



More information about the Python-list mailing list