C Library
PHP Module
Perl Module
Ruby Library
Python Library
.NET Component
Java Component
Apache Module
Nginx Module
Node.js Module
HTTP Module
Go Package
D Library
Lua Package
OpenResty Package
Splunk Add-on
Erlang Module
Haskell Package
Kotlin Module
Scala Library
Apache Kafka Transform
Deno Module
R Package
IP2Proxy PHP API
This PHP module helps the user to find the IP addresses which are used as virtual private networks (VPN), open proxies, web proxies, Tor exits, data center & web hosting ranges (DCH), search engine robots (SES), residential proxies (RES), consumer privacy networks (CPN), and enterprise private networks (EPN) by calling the IP2Proxy API.
NOTE: This module will require an IP2Proxy Web Service API key to function.
-
Run the command:
composer require ip2location/ip2proxy-php
Note: You just need to include the below code in order to use the library.
require 'vendor/autoload.php';
<?php
require 'class.IP2Proxy.php';
// Lookup by Web API
$ws = new \IP2Proxy\WebService('YOUR_API_KEY', 'PX10', false);
$results = $ws->lookup('1.0.241.135');
if ($results !== false) {
echo '<p><strong>Country Code: </strong>' . $results['countryCode'] . '</p>';
echo '<p><strong>Country Name: </strong>' . $results['countryName'] . '</p>';
echo '<p><strong>Region: </strong>' . $results['regionName'] . '</p>';
echo '<p><strong>City: </strong>' . $results['cityName'] . '</p>';
echo '<p><strong>ISP: </strong>' . $results['isp'] . '</p>';
echo '<p><strong>Domain: </strong>' . $results['domain'] . '</p>';
echo '<p><strong>Usage Type: </strong>' . $results['usageType'] . '</p>';
echo '<p><strong>ASN: </strong>' . $results['asn'] . '</p>';
echo '<p><strong>AS: </strong>' . $results['as'] . '</p>';
echo '<p><strong>Last Seen: </strong>' . $results['lastSeen'] . ' Day(s)</p>';
echo '<p><strong>Proxy Type: </strong>' . $results['proxyType'] . '</p>';
echo '<p><strong>Is Proxy: </strong>' . $results['isProxy'] . '</p>';
echo '<p><strong>Threat: </strong>' . $results['threat'] . '</p>';
}
?>
Discover Your User Locations
Retrieve geolocation data for FREE now!