GeoIP2 for retrieving city and region ?

Chris Angelico rosuav at
Sat Jul 13 02:36:28 CEST 2013

On Sat, Jul 13, 2013 at 9:04 AM, Dennis Lee Bieber
<wlfraed at> wrote:
> On Sat, 13 Jul 2013 02:47:38 +1000, Chris Angelico <rosuav at>
> declaimed the following:
>>Oh, and just for laughs, I tried a few of my recent mobile IP
>>addresses in the GeoIP lookup. All of them quoted Melbourne someplace,
>>some in the CBD and some out in the suburbs, but all vastly wrong, and
>>places I haven't been. But I'd never expect it to be accurate on
>         Well... the MaxMind demo of "my IP" did get the proper metropolitan
> area... But they list the ISP as "AT&T"... My real ISP is Earthlink
> (piggybacking on AT&T DSL service).
>         The Lat/Long, however shows as
> 42.9634 -85.6681
> whereas a recent GPS readout shows
> 42.9159 -85.5541
> or 2m50s too far north, and 6m50s too far west.
>         Same website, accessed from my Blackberry phone, gave a result of
> "United States, NA" and location 38 -97

When you try to place a visitor geographically by IP address, the only
thing you can be absolutely 100% certain of is which RIR they're at
(proxies aside - you're just testing the proxy rather than the
ultimate origin). Country is also highly likely to be right, though
not certain (I've never known it to be wrong, but I've never been able
to confirm what happens with some of the small European countries -
for all I know they could share ISPs and netblocks). Anything tighter
than that is goign to be pretty hit-and-miss. But I have to say, it's
improved a lot over the years. Back in the early 2000s - say, about 8
years ago, I think - I was playing with this sort of technology, and
it placed me in Sydney. That's one state away, lots of rivalry
separating us (friendly rivalry, of course; in a country that's doing
its best to kill us all, we can't afford to really hate each other),
and roughly 750-1000km wrong by distance (depending on how you measure
- most people don't put an odometer on a crow). So at least now it
gets within the same degree of latitude and longitude... most of the


More information about the Python-list mailing list