IP-to-Country lookup, for free and 95% accurate

April 21, 2009 by AcidRaZor · Leave a Comment
Filed under: JavaScript, Programming 101 

One of my recent posts showed you how to convert an IP address to an IP number so you could do a lookup on a IP-to-Country database.

However, I’ve found the next best thing. Maxmind.com is one of the leaders in GeoIP location and sports a database that is more than 99% accurate. That’s the paid version. For my project though, I only needed to know the country, and had to be pretty accurate.

Welcome Maxmind’s free JavaScript addon API! 95% accurate and does what I want it to do.

1
2
3
<script type="text/javascript" src="http://j.maxmind.com/app/country.js"></script>
var countryCode = geoip_country_code();
alert(countryCode);

And that’s IT! You don’t have to host the database, you don’t have to do the number conversion yourself and pretty much everything else is taken care for you. The free service also included City lookups! Include and enjoy!

Here’s the link to their site: http://www.maxmind.com/app/javascript_city

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • blogmarks
  • De.lirio.us
  • Faves
  • Furl
  • IndianPad
  • LinkaGoGo
  • LinkedIn
  • Live
  • MisterWong
  • MisterWong.DE
  • MySpace
  • Netvouz
  • NewsVine
  • Propeller
  • Reddit
  • scuttle
  • Spurl
  • StumbleUpon
  • Technorati
  • TwitThis
  • Yahoo! Buzz

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!


SEO Powered by Platinum SEO from Techblissonline