IP2Location.io
$ch = curl_init('https://api.ip2location.io/?ip=8.8.8.8'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $json = curl_exec($ch); curl_close($ch); $api_result = json_decode($json, true); echo '<pre>'; var_dump($api_result); echo '</pre>';
APIキーなしでも動作するが、1日あたり1,000件のクエリに制限される。
無料プランに登録するとAPIキーを取得でき、1か月あたり5万件のクエリを利用できる。