IP Address API

IP Address API Documentation

Sending request to api

curl method: curl https://any.ge/api/ip/api.php?ip=

results will be: {"name":"United States","code":"US","ccode":"USA"}

Field Description
name United States is a country full name
code US is a country 2 symbol code
ccode USA is a country 3 symbol code

With JQuery

$.get("https://any.ge/api/ip/api.php?ip=", function (response) {
	console.log(JSON.stringify(response, null, 4));
	var name = response.name;
	var code = response.code;
	var ccode = response.ccode;

With PHP

$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, 'https://any.ge/api/ip/api.php?ip='.$ip);
$result = curl_exec($ch);

$obj = json_decode($result);

$name = $obj->name;
$code = $obj->code;
$ccode = $obj->ccode;