<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->
<!-- NERF is a trademark of defconxt. -->
# API Reference — Dark Web Monitoring

## Have I Been Pwned API v3

**Base URL:** `https://haveibeenpwned.com/api/v3`

### List All Breaches
```bash
curl -H "hibp-api-key: $HIBP_KEY" "https://haveibeenpwned.com/api/v3/breaches"
```

### Check Email
```bash
curl -H "hibp-api-key: $HIBP_KEY" \
  "https://haveibeenpwned.com/api/v3/breachedaccount/user@example.com"
```

### Check Pastes
```bash
curl -H "hibp-api-key: $HIBP_KEY" \
  "https://haveibeenpwned.com/api/v3/pasteaccount/user@example.com"
```

**Rate Limit:** 10 requests per minute (paid key).

## IntelX API

**Base URL:** `https://2.intelx.io`

### Search
```bash
curl "https://2.intelx.io/intelligent/search" \
  -H "x-key: $INTELX_KEY" \
  -d '{"term":"example.com","buckets":["pastes","darknet"],"sort":2,"media":0}'
```

### Get Result
```bash
curl "https://2.intelx.io/intelligent/search/result?id=$SEARCH_ID" \
  -H "x-key: $INTELX_KEY"
```

## Ransomware.live API

**Base URL:** `https://api.ransomware.live`

### List Victims
```bash
curl "https://api.ransomware.live/v2/victims"
```

### List Groups
```bash
curl "https://api.ransomware.live/v2/groups"
```

### Recent Victims
```bash
curl "https://api.ransomware.live/v2/recentvictims"
```

## Tor SOCKS Proxy

### Verify Connection
```bash
# Check Tor status
curl --socks5-hostname 127.0.0.1:9050 https://check.torproject.org/api/ip

# Fetch .onion site
curl --socks5-hostname 127.0.0.1:9050 http://example.onion/
```

### Python with Tor
```python
import requests
session = requests.Session()
session.proxies = {
    "http": "socks5h://127.0.0.1:9050",
    "https": "socks5h://127.0.0.1:9050",
}
resp = session.get("https://check.torproject.org/api/ip")
```

## Environment Variables

| Variable | Description |
|----------|-------------|
| `HIBP_API_KEY` | Have I Been Pwned API key |
| `INTELX_KEY` | IntelX API key |
| `TOR_SOCKS_PORT` | Tor SOCKS port (default: 9050) |
