IPAbuse Developers

SDKs & Libraries

Official SDKs are available for Node.js/TypeScript, PHP, and Python. All libraries are open-source, fully typed, and follow semantic versioning.

Node.js / TypeScript Official

Install

cURL
npm install @ipabuse/sdk

Quick start

TypeScript
import { IPAbuseClient } from "@ipabuse/sdk";

const client = new IPAbuseClient({ apiKey: process.env.IPABUSE_API_KEY });

// IP reputation
const rep = await client.ip.getReputation("1.2.3.4");
console.log(rep.riskLevel, rep.reputationScore);

// Submit a report
const report = await client.ip.report({
  ipAddress: "1.2.3.4",
  category: "SPAM",
  description: "Sending spam emails",
  severity: 2,
});

PHP Official

Install

cURL
composer require ipabuse/sdk

Quick start

PHP
<?php
use IPAbuse\Client;

$client = new Client(['api_key' => getenv('IPABUSE_API_KEY')]);

$rep = $client->ip->getReputation('1.2.3.4');
echo $rep->riskLevel . PHP_EOL;

$report = $client->ip->report([
    'ipAddress'   => '1.2.3.4',
    'category'    => 'SPAM',
    'description' => 'Spam source',
    'severity'    => 2,
]);

Python Official

Install

cURL
pip install ipabuse

Quick start

Python
from ipabuse import Client

client = Client(api_key="YOUR_API_KEY")

rep = client.ip.get_reputation("1.2.3.4")
print(rep.risk_level, rep.reputation_score)

report = client.ip.report(
    ip_address="1.2.3.4",
    category="SPAM",
    description="Spam source",
    severity=2,
)

Community libraries

Have you built a library for another language? Open a PR to add it here or let us know.

Next steps