IPtool Robots API

These pages are very useful for automatic requests to be used in many services.
It is very easy to implement the identification of IP address with these tools,
without writing special scripts and maintaining the IP database.

PHP

$IP = "8.8.8.8"; // use any IP
// create a new cURL resource
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "http://iptool.xyz/robot/city/$IP/");
//TRUE to return the transfer as a string of the return value (remove ending 1)
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$city = curl_exec($ch); // get COUNTRY and save it for future use
curl_close($ch); // close cURL resource, and free up system resources
print $city; // output results wih CITY name