Skip to main content

Quick Start

Install the SDK using npm:
npm i clearproxy

Basic Usage

import { ClearProxy } from "clearproxy";
import fs from "fs";

const client = new ClearProxy("clearpx_yourkey");

(async () => {
  const result = await client.check("proxies.txt", {
    region: "us1",
    timeout: 4000,
    type: "http"
  });

  console.log("Summary:", result.summary);
  console.log("Working:", result.working.length);

  // Save to file
  fs.writeFileSync("working.txt", client.export(result.working, "txt", true));
})();

Configuration Options

OptionTypeDescriptionDefault
regionstringTesting region (us1, eu1, asia1)us1
timeoutnumberTimeout in milliseconds5000
typestringProxy type (http, https, socks4, socks5)http

Methods

check(file, options)

Check proxies from a file. Parameters:
  • file (string) - Path to proxy file
  • options (object) - Configuration options
Returns: Promise with check results

export(proxies, format, auth)

Export proxies to different formats. Parameters:
  • proxies (array) - Array of proxy objects
  • format (string) - Export format (txt, json, csv)
  • auth (boolean) - Include authentication
Returns: Formatted string

Response Structure

[
  {
    "proxy": {
      "host": "67.67.67.67",
      "port": 80,
      "hasAuth": false
    },
    "status": "working",
    "statusCode": 200,
    "responseTime": "1549.48 ms",
    "anonymity": "anonymous",
    "origin": "67.67.67.67",
    "country": "ID",
    "location": "Jakarta",
    "isp": "Six Seven LLC",
    "asn": 6767
  },
]