SDK Libraries

Official ProxyHat SDK libraries let you integrate residential proxy management into your applications with just a few lines of code. Each SDK wraps the ProxyHat REST API in a convenient, idiomatic interface for your language of choice.

Available SDKs

We provide official SDKs for three languages. The Go SDK is published to its module registry; the Python and Node.js SDKs are currently pre-release and install directly from GitHub while we finish publishing them to PyPI and npm.

Installation

Install the SDK for your language. The Go SDK resolves from the Go module registry; the Python and Node.js SDKs install straight from their GitHub repositories while they remain pre-release.

Python and Node.js are pre-release. These packages are not yet published to PyPI or npm, so pip install proxyhat and npm install proxyhat will not work. Install from GitHub using the commands below — the import/require name is still proxyhat once installed. The Go SDK is fully published.
# Pre-release: install from GitHub
pip install "git+https://github.com/ProxyHatCom/python-sdk"
# Pre-release: install from GitHub
npm install ProxyHatCom/node-sdk
go get github.com/ProxyHatCom/go-sdk

Common Features

All SDKs share the same core feature set:

Source Code

All SDKs are open source and hosted on GitHub:

Authentication

All SDKs authenticate using your ProxyHat API key. You can create an API key from the dashboard or via the Authentication API.

from proxyhat import ProxyHat

client = ProxyHat(api_key="YOUR_API_KEY")
const { ProxyHat } = require("proxyhat");

const client = new ProxyHat({ apiKey: "YOUR_API_KEY" });
import "github.com/ProxyHatCom/go-sdk/proxyhat"

client := proxyhat.New("YOUR_API_KEY")

Quick Example

Here's a quick example showing how to list your sub-users using each SDK:

from proxyhat import ProxyHat

client = ProxyHat(api_key="YOUR_API_KEY")

# List all sub-users
sub_users = client.sub_users.list()
for user in sub_users:
    print(f"{user.username}: {user.used_traffic} bytes used")
const { ProxyHat } = require("proxyhat");

const client = new ProxyHat({ apiKey: "YOUR_API_KEY" });

// List all sub-users
const subUsers = await client.subUsers.list();
for (const user of subUsers) {
  console.log(`${user.username}: ${user.usedTraffic} bytes used`);
}
client := proxyhat.New("YOUR_API_KEY")

// List all sub-users
subUsers, err := client.SubUsers.List(context.Background())
if err != nil {
    log.Fatal(err)
}

for _, user := range subUsers {
    fmt.Printf("%s: %d bytes used\n", user.Username, user.UsedTraffic)
}