Complete Developer Documentation
Everything you need to integrate HackNode REST API, curl CLI, Bulk Risk Analysis, Webhooks, MCP Server for AI Agents, and Enterprise Local Sidecar.
1. Quick Start & curl CLI
Calling hacknode.net from curl, wget, or HTTPie automatically routes to our in-memory Go API and returns pretty-printed JSON immediately.
# 1) Inspect your own public IP address
curl https://hacknode.net
# 2) Inspect any IPv4 or IPv6 address directly
curl https://hacknode.net/20.171.207.12
curl https://hacknode.net/2606:4700:4700::1111
# 3) Authenticated lookup with User-Agent spoof verification
curl -s "https://api.hacknode.net/v1/lookup/73.15.22.9?ua=GPTBot/1.2" \
-H "Authorization: Bearer hn_live_your_api_key"2. Authentication & Rate Limits
Anonymous requests are allowed up to 60 requests/hour per IP for quick evaluation. For production use, generate a free API key (1,000 req/day) inside the Developer Console. Keys use the prefix hn_live_ and can be passed in three ways:
# Recommended: Bearer Authorization Header
Authorization: Bearer hn_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Alternative 1: Custom Header
X-API-Key: hn_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Alternative 2: Query Parameter
GET https://api.hacknode.net/v1/lookup/1.1.1.1?api_key=hn_live_xxxx| Tier | Monthly Quota | Burst QPS | Max Bulk | Webhooks |
|---|---|---|---|---|
| Anonymous | 60 / hour | 2 QPS | 50 IPs | — |
| Free ($0) | 30,000 / mo (1k/day) | 5 QPS | 50 IPs | 1 |
| Pro ($19) | 150,000 / mo | 50 QPS | 100 IPs | 2 |
| Scale ($79) | 1,000,000 / mo | 200 QPS | 100 IPs | 10 |
| Enterprise | Unlimited / Sidecar | 2,000+ QPS | 500 IPs | 50 |
Response headers returned on every metered call: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset (Unix timestamp).
3. REST API Reference (https://api.hacknode.net)
| Method & Path | Auth | Description |
|---|---|---|
| GET /v1/lookup/me | Optional Key | Inspect caller's real IP (reads CF-Connecting-IP / X-Forwarded-For). Pass ?check_ua=1 to verify caller's User-Agent. |
| GET /v1/lookup/{ip}?ua=... | Optional Key | Lookup any IPv4/IPv6 with Geo, ASN, Cloud, Proxy/VPN/Tor/Abuser flags, AI Bot ownership, and spoof check. |
| POST /v1/bulk | Optional Key | Batch inspect up to 50 (Free) or 100 (Pro/Scale) unique IPs in one JSON request. |
| GET /v1/asn/{asn} | Public | Get organization, country, network type, IPv4/IPv6 counts, and baseline risk for ASxxxx. |
| GET /v1/asns?q=&type=&country= | Public | Search & paginate global ASN directory (supports offset/limit). |
| GET /v1/ai-bots | Public | Retrieve full AI crawler catalog with live official CIDR counts. |
| GET /v1/ai-bots/rules?format=&preset= | Public | Export ready-to-deploy plain-text rules (format=robots|nginx|cloudflare, preset=training|all). |
| GET /openapi.json | Public | Machine-readable OpenAPI 3.1 specification. |
| GET /healthz | Public | Node status, loaded hacknode.db version, db_age_hours, and index counts. |
| GET|POST|DELETE /v1/webhooks | Session JWT | Manage HMAC-SHA256 signed real-time risk alert webhooks (+ POST /v1/webhooks/{id}/test). |
| GET /v1/logs?limit=50 | Session JWT | Fetch recent authenticated IP lookup audit logs. |
4. Response Schema & Explainable Risk Scoring
Every lookup produces a deterministic, explainable 0–100 score so you never have to guess why an IP was flagged: Tor (+75), Abuser/Blocklist (+70), Proxy/VPN (+55), Datacenter (+40), and Spoofed AI Bot (minimum score 85). Recommended actions map cleanly: <35 = allow, 35–74 = challenge, 75+ = block.
{
"ip": "20.171.207.12",
"geo": {
"country": "US",
"region": "Washington",
"city": "Redmond",
"latitude": 47.673988,
"longitude": -122.121513,
"timezone": "America/Los_Angeles"
},
"network": {
"asn": "AS8075",
"asn_num": 8075,
"org": "Microsoft Corporation",
"type": "hosting",
"provider": "azure"
},
"flags": {
"is_datacenter": true,
"is_proxy": false,
"is_vpn": false,
"is_tor": false,
"is_abuser": false,
"is_ai_bot": true,
"is_spoofed_bot": false
},
"bot": {
"name": "GPTBot",
"owner": "OpenAI",
"category": "ai_training",
"verified": true
},
"risk": {
"score": 40,
"level": "medium",
"recommendation": "challenge",
"reasons": [
"Originates from cloud / datacenter hosting IP range (+40)",
"Verified official GPTBot (OpenAI) crawler IP"
]
},
"meta": {
"latency_ms": 0.14,
"db_version": "2026-11-30"
}
}5. AI Bot Spoof Detection & Automated Rule Export
Pass the request's User-Agent via ?ua=.... If the header claims to be GPTBot, ClaudeBot, or PerplexityBot while the source IP is outside that vendor's official published CIDRs, HackNode immediately sets flags.is_spoofed_bot = true and elevates risk.score >= 85.
# Download latest robots.txt blocking AI training crawlers (keeps AI search allowed)
curl -fsSL "https://api.hacknode.net/v1/ai-bots/rules?format=robots&preset=training" -o public/robots.txt
# Export Nginx map rules blocking all tracked AI crawlers
curl -fsSL "https://api.hacknode.net/v1/ai-bots/rules?format=nginx&preset=all" -o /etc/nginx/conf.d/ai-bots.conf
# Export Cloudflare WAF Custom Rule expression
curl -fsSL "https://api.hacknode.net/v1/ai-bots/rules?format=cloudflare&preset=training"6. Bulk Lookup API (POST /v1/bulk)
curl -s -X POST "https://api.hacknode.net/v1/bulk" \
-H "Authorization: Bearer hn_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"ips": ["20.171.207.12", "185.220.101.45", "73.15.22.9", "2606:4700::1111"],
"user_agent": ""
}'7. Real-Time Risk Alert Webhooks & HMAC Verification
Configure webhook URLs in the Developer Console. Whenever an authenticated lookup exceeds your min_risk_score or triggers is_spoofed_bot, HackNode sends a signed JSON POST with headers X-HackNode-Event and X-HackNode-Signature: sha256=<hex>.
import crypto from "crypto";
export function verifyHackNodeWebhook(rawBody: string, sigHeader: string, secret: string): boolean {
const expected = "sha256=" + crypto.createHmac("sha256", secret).update(rawBody).digest("hex");
return crypto.timingSafeEqual(Buffer.from(sigHeader), Buffer.from(expected));
}8. MCP Server for AI Agents (https://mcp.hacknode.net/mcp)
HackNode implements the Model Context Protocol (JSON-RPC 2.0 over Streamable HTTP, protocol 2025-03-26). Connect Cursor, Claude Desktop, Windsurf, or any custom AI agent directly without installing local packages.
Args: ip (required), user_agent (optional). Full Geo, ASN, proxy/Tor & risk analysis.
Args: ip, user_agent. Returns verified official bot status or flags spoofed crawlers.
Args: asn (e.g. AS13335). Returns org, network type, IPv4/IPv6 scale & risk baseline.
{
"mcpServers": {
"hacknode": {
"url": "https://mcp.hacknode.net/mcp",
"headers": {
"Authorization": "Bearer hn_live_your_api_key"
}
}
}
}curl -s -X POST "https://mcp.hacknode.net/mcp" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer hn_live_your_api_key" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "verify_ai_bot",
"arguments": {
"ip": "73.15.22.9",
"user_agent": "ClaudeBot/1.0"
}
}
}'9. Production SDK & Edge Middleware Recipes
func CheckHackNode(ip, ua, apiKey string) (bool, error) {
u := fmt.Sprintf("https://api.hacknode.net/v1/lookup/%s?ua=%s", url.PathEscape(ip), url.QueryEscape(ua))
req, _ := http.NewRequest(http.MethodGet, u, nil)
req.Header.Set("Authorization", "Bearer "+apiKey)
resp, err := http.DefaultClient.Do(req)
if err != nil {
return false, err
}
defer resp.Body.Close()
var out struct {
Flags struct{ IsSpoofedBot bool `json:"is_spoofed_bot"` } `json:"flags"`
Risk struct{ Recommendation string `json:"recommendation"` } `json:"risk"`
}
_ = json.NewDecoder(resp.Body).Decode(&out)
return out.Flags.IsSpoofedBot || out.Risk.Recommendation == "block", nil
}10. Standard Error Codes
| HTTP | error.code | Meaning |
|---|---|---|
| 400 | invalid_ip / invalid_asn | Malformed IPv4/IPv6 or ASN parameter. |
| 401 | invalid_api_key | API key is missing, invalid, or revoked. |
| 403 | webhook_limit_reached / enterprise_required | Feature requires a higher subscription plan. |
| 429 | rate_limit_exceeded | Exceeded QPS or monthly quota; inspect X-RateLimit-Reset header. |
11. Enterprise Local Sidecar (In-VPC Deployment)
For ad-tech, fintech, and high-QPS platforms requiring zero external latency and strict data residency, Enterprise plans ($399+/mo billed annually) ship our licensed Go Sidecar Docker container (hacknode-sidecar). It loads watermarked daily updates into local RAM and automatically halts updates if the license expires.
docker run -d --name hacknode-sidecar -p 127.0.0.1:8090:8090 \
-e HACKNODE_LICENSE_KEY="hn_live_enterprise_license_key" \
ghcr.io/hacknode-net/hacknode-engine:latest hacknode-sidecar
# Sub-millisecond local VPC lookup
curl http://127.0.0.1:8090/v1/lookup/20.171.207.12?ua=GPTBot/1.2Enterprise onboarding & custom threat feeds: enterprise@hacknode.net