GeoIP Database

Find out the geographic location of your website's visitors.

Your Geolocation Information

Country:
State:
City:
Postal:
Latitude:
Longitude:
IP:

Become an expert on your visitors with geolocation statistics

GeoIP Database is a free service that keeps track of your visitor's geolocation, based on their IP address.

Free as in free?

GeoIP Database is free for small developer projects. We allow 1000 calls per day.

How to use?

By using one of our services, either a JSON-object or JSONP callback function is returned. You can use our services with one of the following URLs. The objects have the following structure:


JSON object
https://www.geoip-db.com/json
{
    "country_code":"US",
    "country_name":"United States",
    "city":"Minneapolis",
    "postal":55455,
    "latitude":44.9733,
    "longitude":-93.2323,
    "IPv4":"126.101.76.251",
    "state":"Minnesota"
}

JSONP callback
https://geoip-db.com/json/geoip.php?jsonp=callback
callback({
    "country_code":"US",
    "country_name":"United States",
    "city":"Minneapolis",
    "postal":55455,
    "latitude":44.9733,
    "longitude":-93.2323,
    "IPv4":"126.101.76.251",
    "state":"Minnesota"
})

A basic jQuery JSONP example:
<!DOCTYPE html>
<html>
<head>
<title>GeoIP locator</title>
<script src="jquery/2.1.4/jquery.min.js"></script>
</head>
<body>
   <div>Country: <span id="country"></span>
   <div>State: <span id="state"></span>
   <div>City: <span id="city"></span>
   <div>Latitude: <span id="latitude"></span>
   <div>Longitude: <span id="longitude"></span>
   <div>IP: <span id="IPv4"></span>
   <script>
     $.getJSON('https://geoip-db.com/json/geoip.php?jsonp=?') 
        .done (function(location)
        {
          $('#country').html(location.country_name);
          $('#state').html(location.state);
          $('#city').html(location.city);
          $('#postal').html(location.postal);
          $('#latitude').html(location.latitude);
          $('#longitude').html(location.longitude);
          $('#ip').html(location.IPv4);               
        });
    </script>
</body>
</html>

Note: This only works for public ip-addresses, not 127.0.0.1, localhost, 192.168...