ProxyCheck is a Type Safe Node.js library for interacting with the ProxyCheck.io API. This library provides an easy-to-use interface for checking if an IP address is a proxy, VPN, or has been involved in any malicious activities. It also provides usage statistics, query history, and detection history from your ProxyCheck.io account.
npm install --save proxycheck-ts
import ProxyCheck from 'proxycheck-ts'
const proxyCheck = new ProxyCheck({ api_key: 'your-api-key' });
// Check single IP
async function run() {
try {
// Check single IP
const singleIPResult = await proxyCheck.checkIP('8.8.8.8', {
// For all flags check https://proxycheck.io/api/#query_flags
asn: 1,
vpn: 3
});
console.log(singleIPResult['8.8.8.8']);
// Check multiple IPs
const multipleIPsResult = await proxyCheck.checkIP(['8.8.8.8', '8.8.4.4']);
console.log(multipleIPsResult);
// Get usage
const usage = await proxyCheck.getUsage();
console.log(usage);
// Get queries
const queries = await proxyCheck.getQueries();
console.log(queries);
// Get detections
const detections = await proxyCheck.getDetections({ limit: 10, offset: 0 });
console.log(detections);
} catch (error) {
console.error(error);
}
}
run();
-
checkIP(ip: string | string[], options: ProxyCheckOptions = {}, timeout?: number)
: Checks if an IP or array of IPs are proxies or VPNs. Returns aProxyCheckResponse
. -
getUsage()
: Retrieves your ProxyCheck.io account usage. Returns aProxyCheckGetUsageReturn
. -
getQueries()
: Retrieves your ProxyCheck.io account query history. Returns aProxyCheckQueryHistory[]
. -
getDetections(options: ProxyCheckGetDetectionsOptions = {})
: Retrieves your ProxyCheck.io account detection history. Returns aProxyCheckDetectionHistory[]
.
For detailed information on the data types returned by these methods, refer to the code comments in the library.
This library is not officially affiliated with ProxyCheck.io.
MIT