PHPCountry is a json response api for getting factbook data about the country of the website visitor based upon his/her ip or a specific given ip. It runs PHP and the code of the project is available in https://code.google.com/p/phpcountry/
I have a blog in spanish where i comment the project updates.
Hope you find it useful. I will update the provided data with more new ASAP.
-- This product includes GeoIP data created by MaxMind, available from http://maxmind.com/ --
© 2011 leandro me fecit