SDK reference

SDKs

SDKs default to https://predax.io. Override the base URL for local development.

PHP SDK

Path: sdks/php

composer require predax/php-sdk

# Example
php examples/basic-check.php
use Predax\Client;

$client = new Client("prdx_...");
$res = $client->checkIP("8.8.8.8");
echo $res["classification"]["risk_score"];

Python SDK

Path: sdks/python

pip install predax

# Example
python examples/basic_check.py
from predax import Client

client = Client("prdx_...")
res = client.check_ip("8.8.8.8")
print(res.classification.risk_score, res.classification.is_proxy)

Node.js / TypeScript SDK

Path: sdks/nodejs

npm i @predax/sdk

node examples/basic-check.js
import { PredaxClient } from "@predax/sdk";

const client = new PredaxClient({ apiKey: "prdx_..." });
const res = await client.checkIp("8.8.8.8");
console.log(res.classification.risk_score);

Local development

If your API is running locally (e.g. http://localhost:8000), pass the base URL explicitly.

# Python
client = Client("prdx_...", base_url="http://localhost:8000")

# Node
new PredaxClient({ apiKey: "prdx_...", baseUrl: "http://localhost:8000" })

If your client runs inside Docker (WordPress/WooCommerce), prefer host.docker.internal or your host IP instead of localhost.