ip2location facebbook  ip2location twitter  ip2location google+ ip2location github

IP2Proxy PHP API

This PHP module helps the user to find the IP addresses which are used as VPN anonymizer, open proxies, web proxies and Tor exits by calling the IP2Proxy API

NOTE: This module will require that API key to function.

Source GitHub Repository

 

Installation
Composer Installation
  1. Add the below line into your composer.json file.
    							{
    							  "require": {
    								"ip2location/ip2proxy-php-api": "1.*"
    							  }
    							}
    							
  2. Run the command: composer install
  3. Done.

Note: You just need to include the below code in order to use the library.

						require 'vendor/autoload.php';
						

 

Sample Codes
			<?php
				$apiKey = 'YOUR_API_KEY';
				$ip = '8.8.8.8';

				$ipx = new IP2ProxyAPI($apiKey, false);

				if (!$ipx->query($ip)) {
					die('ERROR');
				}

				echo '<pre>';
				echo 'Response     : ' . $ipx->response . "\n";
				echo 'Country Code : ' . $ipx->countryCode . "\n";
				echo 'Country Name : ' . $ipx->countryName . "\n";
				echo 'Region Name  : ' . $ipx->regionName . "\n";
				echo 'City Name    : ' . $ipx->cityName . "\n";
				echo 'ISP          : ' . $ipx->isp . "\n";
				echo 'Proxy Type   : ' . $ipx->proxyType . "\n";
				echo 'Is Proxy     : ' . $ipx->isProxy . "\n";
				echo '</pre>';

			?>