Download the PHP package proxycheck/proxycheck-php without Composer
On this page you can find all versions of the php package proxycheck/proxycheck-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download proxycheck/proxycheck-php
More information about proxycheck/proxycheck-php
Files in proxycheck/proxycheck-php
Package proxycheck-php
Short Description proxycheck.io PHP Library
License MIT
Homepage https://proxycheck.io/
Informations about the package proxycheck-php
proxycheck-php
php library for calling the proxycheck.io v2 API which allows you to check if an IP address is a Proxy or VPN and get the Country, ASN and Provider for the IP address being checked. This library also supports checking email addresses to determine if they belong to a disposable email service or not.
Install via Composer
You can install the library via Composer by running the following command:
To use the library, use Composer's autoload:
Dependencies
The library requires the following extensions in order to work properly:
curl
(Please make sure your cacert.pem is up to date if you intend to use TLS querying)json
Service Limits
- Free users without an API Key = 100 Daily Queries
- Free users with an API Key = 1,000 Daily Queries
- Paid users with an API Key = 10,000 to 10.24 Million+ Daily Queries
Get your API Key at proxycheck.io it's free.
Getting Started
Performing a check on an address (IPv4 and IPv6 IP addresses are supported along with email addresses for disposable mailbox checking.).
In the above example we have included both countries and isocodes in both the and field. That is because as of 0.1.3 (May 2019) this library now supports both for use in these arrays. You can think of these two fields like a local whitelist/blacklist feature but only for countries.
Viewing the query result
When performing a query you will receive back an array which contains various information. Below is an example of parsing that array to determine if this user should be blocked or not. Please note the block and block_reason results are only populated when checking a single address, when passing an array of addresses to perform a multi-check these variables will both contain .
Extra information included in the query result
When performing a query you will receive not just and but also the entirety of the API response from proxycheck.io, we do this so you can either make an easy block system or utilise the data presented by the API as you see fit. A full result example is shown below.
In the above example the field lets you know the status of this query. You can view all our API responses here within our API documentation page. Also where in our example we show you will receive the actual address you sent to the API for checking.
Viewing Statistics from your Dashboard
In version 0.1.3 (May 2019) we added the ability to view statistics from your account dashboard through this library. Below is an example of how to do that.
When accessing dashboard API's an API Key is always required as the dashboard is only for registered users (both free and paid have full dashboard access). You will also need to make sure you have Dashboard API access enabled within your dashboard on our website.
You can see that in the field we are providing the name of the stat we would like to view. In this example we have selected but you can also check detections or queries. This library will also support future stat types automatically.
Below is an example of how this result would look.
When viewing the stat you can also provide a limit (which is how many entries to show you) and offset (which is how many entries to skip over before starting to show you any results).
So for example if you had 100 entries and you only wanted to view entries 31 to 40 you would supply 10 as a limit and 30 as an offset.
Manipulating your CORS Origins, Whitelist or Blacklist
In version 0.1.2 (Nov 2018) we added the ability to view, add, remove, set and clear your whitelist and blacklist through this library, in December 2020 a CORS API was added to proxycheck.io and the below code also works for that. Below is an example of adding three entries to your whitelist in a single query.
When accessing dashboard API's an API Key is always required as the dashboard is only for registered users (both free and paid have full dashboard access). You will also need to make sure you have Dashboard API access enabled within your dashboard on our website.
You can see that in the LIST_ENTRIES field we are providing an array of three seperate entries, this field is only used if you're performing an add, remove or set action. When providing entries in the LIST_ENTRIES field you can include comments, for example would create a new entry with the comment intact.
This LIST_ENTRIES field can also be used when adding, setting or removing origins for use with the CORS feature. In this situation comments are not supported, only domains (including wildcard domains such as *.example.com). All LIST_ACTION types are supported with CORS in the same way they are with Whitelist/Blacklist manipulation.
If a white or blacklist entry you're removing has a comment next to it you will need to include that comment in the removal request aswell, like in the example above where we included a comment next to the IP address we were adding you would do the same when removing it.
All versions of proxycheck-php with dependencies
ext-curl Version *
ext-json Version *