dalle api del sito, http://ip-api.com/docs/api:json (Example)

Codice PHP:
$countryguest file_get_contents("http://ip-api.com/json/{$_SERVER['REMOTE_ADDR']}");