PHP guide

Use FindIP with PHP

Call FindIP from PHP and parse the combined geolocation, network, and intelligence response.

Endpoint

Authenticated IP lookup

GET https://api.findip.net/{ip}/?token={token}
Use HTTPSSend the token over HTTPS and keep it server-side.
JSON modelThe intelligence object is always returned with the normal geolocation payload.

PHP example

Uses cURL for status handling and timeouts.

<?php
$ip = '8.8.8.8';
$token = 'YOUR_API_KEY';

$url = "https://api.findip.net/{$ip}/?token=" . urlencode($token) . "&returnIp=true";

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_HTTPHEADER => ['Accept: application/json'],
]);

$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);

if ($status < 200 || $status >= 300) {
    throw new RuntimeException("FindIP request failed with status {$status}");
}

$data = json_decode($body, true, flags: JSON_THROW_ON_ERROR);
$intelligence = $data['intelligence'];

echo "City: " . ($data['city']['names']['en'] ?? 'n/a') . PHP_EOL;
echo "Country: " . ($data['country']['names']['en'] ?? 'n/a') . PHP_EOL;
echo "ISP: " . ($data['traits']['isp'] ?? 'n/a') . PHP_EOL;
echo "ASN: " . ($data['traits']['autonomous_system_number'] ?? 'n/a') . PHP_EOL;

echo "Verdict: " . $intelligence['summary']['verdict'] . PHP_EOL;
echo "Risk: " . $intelligence['risk']['score'] . " " . $intelligence['risk']['level'] . PHP_EOL;
echo "VPN: " . ($intelligence['flags']['is_vpn'] ? 'true' : 'false') . PHP_EOL;
echo "Proxy: " . ($intelligence['flags']['is_proxy'] ? 'true' : 'false') . PHP_EOL;
echo "Tor: " . ($intelligence['flags']['is_tor'] ? 'true' : 'false') . PHP_EOL;