Ipdata.co is a fast, highly available IP Geolocation API with reliable performance.
It's extremely scalable with 10 endpoints around the world each able to handle >10,000 requests per second!
This answer uses a 'test' API Key that is very limited and only meant for testing a few calls. Signup for your own Free API Key and get up to 1500 requests daily for development.
In php
php > $ip = '8.8.8.8';
php > $details = json_decode(file_get_contents("https://api.ipdata.co/{$ip}?api-key=test"));
php > echo $details->region;
California
php > echo $details->city;
Mountain View
php > echo $details->country_name;
United States
php > echo $details->latitude;
37.751
Here's a client-side example showing how you'd get the country, region and city;
$.get("https://api.ipdata.co?api-key=test", function (response) {
$("#response").html(JSON.stringify(response, null, 4));
$("#country").html('Country: ' + response.country_name);
$("#region").html('Region ' + response.region);
$("#city").html('City' + response.city);
}, "jsonp");
Disclaimer;
I built the service.
For examples in multiple languages see the Docs
Also see this detailed analysis of the best IP Geolocation APIs.