Skip to content

PLASMAchicken/proxycheck-node.js

Repository files navigation

proxycheck-node.js

node.js 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.

Install via npm/yarn

You can install the library via npm by running the following command:

npm i proxycheck-node.js

Usage

One IP

async/await

const proxy_check = require('proxycheck-node.js'); 
const check = new proxy_check({api_key: '111111-222222-333333-444444'}); 
const result = await check.check('127.0.0.1');
console.log(result)

.then

const proxy_check = require('proxycheck-node.js'); 
const check = new proxy_check({api_key: '111111-222222-333333-444444'}); 
const result = check.check('127.0.0.1').then(result => console.log(result));

async/await with options

const proxy_check = require('proxycheck-node.js'); 
const check = new proxy_check({api_key: '111111-222222-333333-444444'}); 
const result = await check.check('127.0.0.1', { vpn: true });
console.log(result)

Multiple IPs

async/await with options

const proxy_check = require('proxycheck-node.js'); 
const check = new proxy_check({api_key: '111111-222222-333333-444444'}); 
const result = await check.check(['8.8.8.8', '1.1.1.1'], { vpn: true });
console.log(result)
{
  status: 'ok',
  '8.8.8.8': { proxy: 'no' },
  '1.1.1.1': { proxy: 'no' }
}

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.

Docs

Classes

proxycheck

Typedefs

proxycheck_Constructor : Object
proxycheck_Options : Object
proxycheck_getUsageReturn : Object
proxycheck_getDetectionsOptions : Object

proxycheck

Kind: global class

new proxycheck(param0)

Param Type Description
param0 cmdConstructor Constructor.

Example

const proxy_check = require('proxycheck-node.js');
const check = new proxy_check({api_key: '111111-222222-333333-444444'});

proxycheck.check(ip, options) ⇒ Object

Checks IP(s) with the proxycheck v2 api.

Kind: instance method of proxycheck
Returns: Object - Command Class.

Param Type Description
ip String | Array.<String> Ip to check
options proxycheck_Options Options for the IP_check

Example

const check = new proxy_check({api_key: '111111-222222-333333-444444'});
const result = await check.check(['8.8.8.8', '1.1.1.1'], { vpn: true });
console.log(result)

Example

const check = new proxy_check({api_key: '111111-222222-333333-444444'});
const result = check.check('8.8.8.8', { vpn: true }).then(result => console.log(result))

proxycheck.getUsage() ⇒ proxycheck_getUsageReturn

Dashboard: Gets your Usage

Kind: instance method of proxycheck
Returns: proxycheck_getUsageReturn - Result
Example

const check = new proxy_check({ api_key: '111111-222222-333333-444444' });
const result = await check.getUsage();
console.log(result);

proxycheck.getQuerys() ⇒ Object

Dashboard: Gets your Querys

Kind: instance method of proxycheck
Returns: Object - Result
Example

const check = new proxy_check({ api_key: '111111-222222-333333-444444' });
const result = await check.getQuerys();
console.log(result);

proxycheck.getDetections(options) ⇒ Object

Gets the Detections

Kind: instance method of proxycheck
Returns: Object - Result

Param Type
options proxycheck_getDetectionsOptions

Example

const check = new proxy_check({ api_key: '111111-222222-333333-444444' });
const result = await check.getDetections({ limit: 50 });
console.log(result);

proxycheck_Constructor : Object

Kind: global typedef
Properties

Name Type Description
api_key string The Api Key

proxycheck_Options : Object

Kind: global typedef
Properties

Name Type Default Description
[vpn] Boolean false When the vpn flag is supplied we will perform a VPN check on the IP Address and present the result to you.
[asn] Boolean false When the asn flag is supplied we will perform an ASN check on the IP Address and present you with the provider name, ASN, country, country isocode, city (if it's in a city) and lang/long for the IP Address.
[node] Boolean node When the node flag is supplied we will display which node within our cluster answered your API call. This is only really needed for diagnosing problems with our support staff.
[time] Boolean false When the time flag is supplied we will display how long this query took to be answered by our API excluding network overhead.
[inf] Boolean true When the inf flag is set to 0 (to disable it) we will not run this query through our real-time inference engine. In the absence of this flag or if it's set to 1 we will run the query through our real-time inference engine.
[risk] false | 1 | 2 false When the risk flag is set to 1 we will provide you with a risk score for this IP Address ranging from 0 to 100. Scores below 33 can be considered low risk while scores between 34 and 66 can be considered high risk. Addresses with scores above 66 are considered very dangerous. When the risk flag is set to 2 we will still provide you with the above risk score but you'll also receive individual counts for each type of attack we witnessed this IP performing across our customer network and our own honeypots within the days you specify by the &days= flag.
[port] Boolean false When the port flag is supplied we will display to you the port number we saw this IP Address operating a proxy server on.
[seen] Boolean false When the seen flag is supplied we will display to you the most recent time we saw this IP Address operating as a proxy server.
[days] Number 7 When the days flag is supplied we will restrict our proxy results to between now and the amount of days you specify. For example if you supplied &days=2 we would only check our database for Proxies that we saw within the past 48 hours. By default without this flag supplied we search within the past 7 days.
[tag] String When the tag flag is supplied we will tag your query with the message you supply.

proxycheck_getUsageReturn : Object

Kind: global typedef
Properties

Name Type Description
[error] String Error?
[queries_today] Number
[daily_limit] Number
[queries_total] Number
[plan_tier] String

proxycheck_getDetectionsOptions : Object

Kind: global typedef
Properties

Name Type Default
[limit] Number 100
[offset] Number 0

Releases

No releases published

Packages

No packages published