ip2location/ip2proxy-php-api

PHP module to check if an IP address was being used as open proxy, web proxy, VPN anonymizer and TOR exits via IP2Proxy API.

1.0.1 2019-07-15 01:11 UTC

This package is auto-updated.

Last update: 2024-11-19 03:21:56 UTC


README

This project has been merged into IP2Proxy-PHP-Module. We will no longer maintain and support this project. Please visit IP2Proxy-PHP-Module for latest updates or enhancements.

This module allows user to query an IP address if it was being used as VPN anonymizer, open proxies, web proxies, Tor exits, data center, web hosting (DCH) range, search engine robots (SES), residential proxies (RES), consumer privacy networks (CPN), and enterprise private networks (EPN). It lookup the proxy IP address using IP2Proxy API.

Getting Started

To begin, an API key is required for this module to function. Find further information at https://www.ip2location.com/ip2proxy-web-service

Installation

Add the following to your composer.json file:

{
  "require": {
	"ip2location/ip2proxy-php-api": "1.*"
  }
}

Usage

<?php

require 'class.IP2ProxyAPI.php';

// Second parameter supports PX1 to PX10
$api = new IP2ProxyAPI('YOUR_API_KEY', 'PX8');

if ($api->query('1.2.3.4')) {
	echo '<strong>Country Code</strong>: ' . $api->countryCode . '<br>';
	echo '<strong>Country Name</strong>: ' . $api->countryName . '<br>';
	echo '<strong>Region</strong>: ' . $api->regionName . '<br>';
	echo '<strong>City</strong>: ' . $api->cityName . '<br>';
	echo '<strong>ISP</strong>: ' . $api->isp . '<br>';
	echo '<strong>Domain</strong>: ' . $api->domain . '<br>';
	echo '<strong>Usage Type</strong>: ' . $api->usageType . '<br>';
	echo '<strong>ASN</strong>: ' . $api->asn . '<br>';
	echo '<strong>AS</strong>: ' . $api->as . '<br>';
	echo '<strong>Last Seen</strong>: ' . $api->lastSeen . '<br>';
	echo '<strong>Proxy Type</strong>: ' . $api->proxyType . '<br>';
	echo '<strong>Is Proxy</strong>: ' . $api->isProxy . '<br>';
    echo '<strong>Threat</strong>: ' . $api->threat . '<br>';
}

Response message

Usage Type
  • (COM) Commercial
  • (ORG) Organization
  • (GOV) Government
  • (MIL) Military
  • (EDU) University/College/School
  • (LIB) Library
  • (CDN) Content Delivery Network
  • (ISP) Fixed Line ISP
  • (MOB) Mobile ISP
  • (DCH) Data Center/Web Hosting/Transit
  • (SES) Search Engine Spider
  • (RSV) Reserved