Ted Patrick - Demos & MAX @ Adobe Systems


Note: This is the personal blog of Ted Patrick. The opinions and statements voiced here are my own.



Ip to Geolocation

DIGG IT!     34 Comments Published Saturday, January 24, 2009 at 9:18 PM .

I have been looking for a good geo-location API that I can host on my own server. I set this one up and want to see how close the results are in accuracy (please leave comments). The returned geolocation should match your ISP given proxies, overall it should be accurate down to city level.



Here are the JSON and XML versions.

It is pretty cool that you can derive a location from a single http request.

And to properly credit the database used:
"This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com/."

Cheers,

ted :)

34 Responses to “Ip to Geolocation”

  1. # Blogger Paul Hastings

    it got the country & city right.

    which one are you using?  

  2. # Blogger Ted Patrick

    Paul,

    It is using Maxmind GeoLite City found here:

    http://www.maxmind.com/app/geolitecity

    It is pretty nice that you can swap this out with the more accurate commercial version.

    Ted :)  

  3. # Blogger Marc

    One town off, but really close considering the size of my town.  

  4. # Blogger oneandonly

    accurate upto the city level..
    cool to know, that it's free..  

  5. # Anonymous Anonymous

    Mine was spot on, and I live in a little area just outside of Pittsburgh, you know, Steelers Country (sorry, I felt compelled to do that for some reason...maybe because it's 3 am)  

  6. # Blogger jdk

    Missed the last digit (of 5) of the zip code by 4.  

  7. # Anonymous Anonymous

    The country was right but the city was wrong.
    I send my request from a city 60 km (40 mi) away from the shown city.  

  8. # Blogger Fréderic Cox

    Hi Ted,

    The country is right but the city is not that accurate. It says Lummen and that's about 20 kilometres outside of where I am. But pretty cool still :)

    I'm in a little country called Belgium :D maybe that is the reason  

  9. # Anonymous Savvas Malamas

    I get the right city-country too, nice!  

  10. # Blogger Erki Esken

    Pretty good, only about 1.5 km off from real location.  

  11. # Blogger nickdean

    24.128.62.242
    US
    USA
    United States
    MA
    Quincy

    42.2654
    -71.0185
    617
    506
    America/New_York
    ===============================
    I live one town over, In East Milton, Ma.  

  12. # OpenID mazharhasan

    Wow its working fine for me too :) got the right location:

    115.186.xxx.xxx PK PAK Pakistan 05 Karachi 24.8667 67.05 Asia/Karachi  

  13. # Blogger elvezpablo

    Worked for me down to the city. Good stuff!  

  14. # Blogger Josh

    Got the city and state right, the zip code was a little off, but probably accurate for my cable provider. We've used GeoLite and it works well.  

  15. # Blogger Adam Gray

    Accurate down to the zip code. Pretty good.  

  16. # Anonymous doug

    Hi Ted,

    I've been using the MaxMind web service for a couple of years now over at my site http://www.strangeloopstudios.com/player/ - Never had a problem and the results are usually pretty acurate in most cases.

    If you test it now you'll get an error with the GEOIP as they've recently changed servers but that's being sorted at the mo.

    I think i purchased 50,000 requests for £20 - so not bad and they're always able to be contacted. It's typical that my first and only issue has recently occured... I run my request via amfphp so to check it just look at the first result from player_gateway if you're using a proxy.

    Doug  

  17. # Blogger Marc Baiges

    ouch, 500km error for me!
    checking from Barcelona (Spain), but pointed me in Madrid (Spain).  

  18. # Blogger corl3an

    worked for me. off on the zip but right on for the rest! cheers!  

  19. # Blogger 2bsravan

    Right down to the city. Pretty good.  

  20. # Blogger Paul Hastings

    i would be amiss if i didn't mention http://javainetlocator.sourceforge.net/ we use it for country/locale guessing. it's blazing fast (several people have tried to use the sql versions of maxmind, etc but these seem to be slower compared to the binary versions) but gets out of date.  

  21. # Anonymous DavidW

    Right city, state and coordinates. Wrong state ;-(  

  22. # Blogger Jason

    I blogged about this including a Flex/Google Maps API mashup over here if anyone's interested - http://blog.wrench.com.au/2008/12/13/google-maps-geo-location-by-ip-flex-example/  

  23. # Anonymous Anonymous

    Wrong country (and obviously wrong city hehe).

    So I guess not good enough service..  

  24. # Blogger KiteBoy

    Not very accurate I am afraid. I am in Edinburgh in Scotland and it thought I was in Hartlepool in England. But at least the continent was right ;-)  

  25. # Blogger dbmuse

    only 6 miles off by air..
    the city name is wrong
    i'm in Ada Mi not Grand Rapids.
    Pretty good considering its source data.
    Someday all computers will be required to have GPS just like cell phones... i predict.  

  26. # Anonymous Evan Gifford

    Off by about 3 miles. That's funny, according to this method we live in the same house in SoCal!  

  27. # Blogger mYxuS

    correct. Moscow is a big city, its hard to miss the mark -)  

  28. # Anonymous leif

    Dead-on. Seems to work well for me.  

  29. # Blogger Ben

    City, state and zip correct for a Minneapolis resident  

  30. # Anonymous Jens Wegar

    One city off for me. But if it's tracking my ISP, then it was correct (because my ISP has their server in the city that was found)  

  31. # Blogger Ted Patrick

    The GEO-IP is tied to the location of your ISP, not where you are exactly. In some cases this is close, others not so much.

    I tested with the Adobe VPN system and the IP changes depending on if you are logged in tracking back to the data center you are VPN'd into.

    Ted :)  

  32. # Anonymous Anonymous

    Got my country right (NZ) but the city is way off. Said I'm in Dunedin, but shoud be Wellington.
    Cheers.  

  33. # Blogger Fabien

    Here is an example of how to use the MaxMing GeoLite API with PHP (installation and stuff). And a small tutorial to display the information on a Yahoo! Map (french):
    Flex / Yahoo Maps API - Géo-localisation par IP d'un visiteur (Exemple)
     

  34. # Anonymous romantique

    Regards from Novosibirsk :)  

Post a Comment

Where to find me:

Ted on Twitter - @AdobeTed
Ted on Adobe Groups
Ted on LinkedIn
Ted on Facebook
Ted at Adobe


Latest

Lists

Links

Jobs

Flex Jobs
city, state, zip

Archives