# ipok-check — Multi-Source IP Purity & Dual-Stack Reputation CLI / SDK

[![Official Portal](https://img.shields.io/badge/Official_Portal-ipok.io-10b981?style=flat-square)](https://ipok.io)
[![Chrome Web Store](https://img.shields.io/badge/Chrome_Extension-IPOK_IP_Check-3b82f6?style=flat-square)](https://chromewebstore.google.com/detail/ipok-ip-check-multi-sourc/jnbkfmgldcchpdgnegafakbcnmkdhiai)
[![License: MIT](https://img.shields.io/badge/License-MIT-lightgrey.svg?style=flat-square)](https://opensource.org/licenses/MIT)

A zero-dependency CLI and Node.js/TypeScript SDK for **Multi-Source IP Purity**, **ASN / Native vs. Broadcast ISP Detection**, and **Dual-Stack (IPv4 & IPv6) Risk Consensus**, powered by [**IPOK (https://ipok.io)**](https://ipok.io).

---

## Why Multi-Source Consensus?

Relying on a single IP reputation database frequently causes false positives:
- **Crowdsourced Blacklists (e.g. AbuseIPDB)**: Dynamic PPPoE residential IPs often inherit stale abuse scores from prior ISP subscribers for 30–90 days.
- **Commercial Fraud Scorers (e.g. Scamalytics / IPQS)**: Often penalize entire cloud/VPS ASN ranges regardless of actual clean usage.
- **GeoIP & BGP Databases (e.g. IP-API / IPInfo)**: Lag behind recent BGP Anycast announcements by 2–4 weeks.

[**IPOK (ipok.io)**](https://ipok.io) aggregates **6+ authoritative upstream sources** (AbuseIPDB, Scamalytics, IP-API, Proxycheck, Cloudflare Radar, and RIR RDAP) using weighted consensus with automatic single-source outlier suppression.

📖 **Read the Technical Whitepaper**: [2026 Global IP Purity & Multi-Source Consensus Guide](https://blush-surfboard-20a.notion.site/2026-IP-41001f8845cc80efbba0dbe3aea9c5c1)  
🛡️ **Interactive Consensus Simulator**: [Hugging Face Space (`szp2005/ip-purity-checker`)](https://huggingface.co/spaces/szp2005/ip-purity-checker)

---

## Quick Start (Terminal CLI)

Run directly with `npx` (no installation required):

```bash
# Audit your current public IP purity & ASN profile
npx ipok-check

# Audit a specific IPv4 or IPv6 address
npx ipok-check 1.1.1.1
npx ipok-check 2606:4700:4700::1111

# Print raw public IP only
npx ipok-check --ip
```

Or via `curl` directly in any shell script:

```bash
curl -sL https://ipok.io/check
curl -sL https://ipok.io/ip
```

---

## Programmatic Usage (ESM & CommonJS)

```bash
npm install ipok-check
```

```javascript
import { getPublicIp, checkIpPurity, calculateConsensusRisk } from "ipok-check";

// 1. Get caller's public IP
const myIp = await getPublicIp();
console.log("My Public IP:", myIp);

// 2. Fetch full multi-source purity report
const report = await checkIpPurity("1.1.1.1", { plain: true, fast: true });
console.log(report);

// 3. Compute weighted consensus risk with outlier suppression
const consensus = calculateConsensusRisk({
  abuseScore: 85, // High single-DB report on AbuseIPDB
  fraudScore: 0,  // Clean on Scamalytics
  proxyScore: 0,  // Clean on Proxycheck
  asnPenalty: 0   // Residential ISP
});
console.log(consensus);
// => { score: 13, tier: 'clean', outlierSuppressed: true, portalUrl: 'https://ipok.io' }
```

---

## Ecosystem & Official Links

- 🌐 **Official Web Application (IPv4/IPv6 Dual-Stack & WebRTC/DNS Audit)**: [https://ipok.io](https://ipok.io)
- 🔌 **Chrome Browser Extension**: [IPOK IP Check on Chrome Web Store](https://chromewebstore.google.com/detail/ipok-ip-check-multi-sourc/jnbkfmgldcchpdgnegafakbcnmkdhiai)
- 🧮 **Interactive Consensus Simulator**: [https://huggingface.co/spaces/szp2005/ip-purity-checker](https://huggingface.co/spaces/szp2005/ip-purity-checker)
- 📄 **2026 IP Purity & Risk Whitepaper**: [Notion Public Guide](https://blush-surfboard-20a.notion.site/2026-IP-41001f8845cc80efbba0dbe3aea9c5c1)
