Free IP Locator API - Convert IP Addresses to Zip Codes with PHP

If you just want a free site to use:
IP Address Locator with Map

If you want a quick PHP solution, try this:

$ip = '';

If you want quick responses, you can install the freegeoip server on ubuntu. This will give you your own personal IP locator service to use privately (or publicly if you are a nice guy):

Install golang 1.1.1

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:duh/golang
sudo apt-get update
sudo apt-get install golang
go version

Set your go environment variables

export GOROOT=/usr/lib/go

Install freegeoip

git clone
cd freegeoip
go build

Download the database

cd db
file ipdb.sqlite

Run it

cd ..

cron script to keep the server running (replace $FREEGEOIP_PATH)

ps cax | grep -v grep | grep freegeoip > /dev/null
echo "${result}"
if [ "${result}" -eq "0" ] ; then
        echo "freegeoip is already running" #>>/home/work/cgcron
        cd $FREEGEOIP_PATH
        ./freegeoip &

cron script to update the database regularly (replace $FREEGEOIP_PATH)

./updatedb &