Below you'll find code examples written by both us and 3rd party developers which enable you to integrate the proxycheck.io API with your software and services. If you've written a publicly available implementation of the proxycheck.io API such as a code example, function, class or plugin please contact us and we'll be happy to include it below. You can find ready to use plugins on our plugins page.
If you don't want to use the Composer library at all and instead would prefer a basic function we have provided that here on our GitHub page.
Below is the install command for our composer library. You can find the instructions for using the library here on GitHub.
composer require proxycheck/proxycheck-php
Below is an example calling the library and retrieving the result of the query into an array.
// Get your visitors IP Address
// If you're using CloudFlare change $_SERVER["REMOTE_ADDR"] to $_SERVER["HTTP_CF_CONNECTING_IP"]
$ip = $_SERVER["REMOTE_ADDR"];
// Input your options for this query including your optional API Key and query flags.
$proxycheck_options = array(
'API_KEY' => '######-######-######-######', // Your API Key.
'ASN_DATA' => 1, // Enable ASN data response.
'DAY_RESTRICTOR' => 7, // Restrict checking to proxies seen in the past # of days.
'VPN_DETECTION' => 1, // Check for both VPN's and Proxies instead of just Proxies.
'RISK_DATA' => 1, // 0 = Off, 1 = Risk Score (0-100), 2 = Risk Score & Attack History.
'INF_ENGINE' => 1, // Enable or disable the real-time inference engine.
'TLS_SECURITY' => 0, // Enable or disable transport security (TLS).
'QUERY_TAGGING' => 1, // Enable or disable query tagging.
'CUSTOM_TAG' => '', // Specify a custom query tag instead of the default (Domain+Page).
'BLOCKED_COUNTRIES' => array('Wakanda', 'CN'), // Specify an array of countries or isocodes to be blocked.
'ALLOWED_COUNTRIES' => array('Azeroth', 'US') // Specify an array of countries or isocodes to be allowed.
);
$result_array = \proxycheck\proxycheck::check($ip, $proxycheck_options);
The above library supports all of our API features which includes all of our query flags and custom query tagging. We've also added library-side country blocking so you can use the API as a country blocking system aswell. You can view its dedicated page which includes full instructions here at packagist.org
If you don't want to use composer you can instead install the library yourself manually from our github page here where you will also find the instructions for using the library.
Accessing our API through curl either by commandline or within a language such as PHP is very easy. All our API responses are in JSON so you will need to parse those responses but you can call our API from curl with the command below.
$ curl "http://proxycheck.io/v2/8.8.8.8"
When you do so you should receive a response like so:
{
"8.8.8.8": {
"proxy": "no",
"provider": "GOOGLE - Google LLC, US"
}
}
Developer hollow87 has made available a nuget package for proxycheck.io at nuget.org available here thanks hollow87! - We've included some install commands for popular clients below for your convenience.
Install-Package ProxyCheck
dotnet add package ProxyCheck
paket add ProxyCheck
DefianceCoding has created a free Java API and example classes for creating Java plugins and applets that integrates the proxycheck.io v2 API. You can view the latest version of PCDetectionAPI on GitHub here and the documentation here
If you need support or have found a bug you can email DefianceCoding at [email protected] or on Discord here
neo773 has created a free Node.js Library for integrating the proxycheck.io v2 API with your projects, it supports Typescript.. You can view the latest version on npm here and view the project on GitHub here.
PLASMAchicken has created a free Node.js Library for integrating the proxycheck.io v2 API with your projects. You can view the latest version on npm here and view the project on GitHub here.
WardPearce has created a free python wrapper for integrating the proxycheck.io v2 API with your projects. You can view the latest version on GitHub here with documentation here.
Roxana has created a free python-based CLI for proxycheck.io's v2 API available for FreeBSD, Unix, Windows, Mac and Linux. You can view the source code on GitHub here and the latest compiled releases on GitHub here.
proxycheck-cli also supports managing your CloudFlare firewall via their API allowing you to check IP's with proxycheck and then add them to your CloudFlare firewall if desired.
Accessing the API with Python is very easy as shown by the code snippet below.
requests.get('http://proxycheck.io/v2/8.8.8.8')
When you do so you should receive a JSON response that you will need to parse like so:
{
"8.8.8.8": {
"proxy": "no",
"provider": "GOOGLE - Google LLC, US"
}
}
Jonathan has been kind enough to create a gem for utilising the proxycheck.io API and you can find it on the rubygems.org website here thanks jonathan! - We've included the gem install command below for your convenience.
gem install proxycheck
Below we've included a simple way to query the API with Ruby.
require 'json'
require 'open-uri'
JSON.parse(open('http://proxycheck.io/v2/8.8.8.8').read)
When you do so you should receive a JSON response like so:
{
"8.8.8.8": {
"proxy": "no",
"provider": "GOOGLE - Google LLC, US"
}
}