> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oathnet.org/llms.txt
> Use this file to discover all available pages before exploring further.

# cURL Examples

> Copy-paste cURL examples for the current API surface

## Authentication

All requests require the `x-api-key` header.

```bash theme={null}
curl -H "x-api-key: YOUR_API_KEY" https://oathnet.org/api/service/v2/breach/search?q=test@example.com
```

## Search Session

```bash theme={null}
curl -X POST "https://oathnet.org/api/service/search/init" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "user@example.com"}'
```

## V2 Breach Search

<Note>
  Use `/service/v2/breach/search` for new breach-search integrations.
</Note>

```bash theme={null}
curl -G "https://oathnet.org/api/service/v2/breach/search" \
  -H "x-api-key: YOUR_API_KEY" \
  --data-urlencode "q=user@example.com" \
  --data-urlencode "dbname[]=linkedin_2012"
```

## V2 AI Filter

```bash theme={null}
curl -X POST "https://oathnet.org/api/service/v2/ai/filter" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "index": "breach",
    "query": "US banking users with gmail addresses"
  }'
```

## V2 Breach Autocomplete

```bash theme={null}
curl -G "https://oathnet.org/api/service/v2/breach/autocomplete/dbnames" \
  -H "x-api-key: YOUR_API_KEY" \
  --data-urlencode "q=link"
```

## V2 Stealer Search

```bash theme={null}
curl -G "https://oathnet.org/api/service/v2/stealer/search" \
  -H "x-api-key: YOUR_API_KEY" \
  --data-urlencode "q=user@example.com" \
  --data-urlencode "has_log_id=true" \
  --data-urlencode "domain[]=google.com"
```

## V2 Victims

### Search Victims

```bash theme={null}
curl -G "https://oathnet.org/api/service/v2/victims/search" \
  -H "x-api-key: YOUR_API_KEY" \
  --data-urlencode "q=user@example.com" \
  --data-urlencode "total_docs_min=10"
```

### Get Manifest

```bash theme={null}
curl -X GET "https://oathnet.org/api/service/v2/victims/vic_xxx_user_yyy" \
  -H "x-api-key: YOUR_API_KEY"
```

### Get File Content

```bash theme={null}
curl -X GET "https://oathnet.org/api/service/v2/victims/vic_xxx_user_yyy/files/file_id" \
  -H "x-api-key: YOUR_API_KEY"
```

### Download Archive

```bash theme={null}
curl -X GET "https://oathnet.org/api/service/v2/victims/vic_xxx_user_yyy/archive" \
  -H "x-api-key: YOUR_API_KEY" \
  -o victim_archive.zip
```

## V2 File Search

### Create Job

```bash theme={null}
curl -X POST "https://oathnet.org/api/service/v2/file-search" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "expression": "api[_-]?key",
    "search_mode": "regex",
    "log_ids": ["vic_xxx_user_yyy"],
    "include_matches": true,
    "context_lines": 2,
    "max_matches": 100
  }'
```

### Poll Job

```bash theme={null}
curl -X GET "https://oathnet.org/api/service/v2/file-search/JOB_ID" \
  -H "x-api-key: YOUR_API_KEY"
```

## V2 Exports

### Create Export

```bash theme={null}
curl -X POST "https://oathnet.org/api/service/v2/exports" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "service": "breach",
    "format": "csv",
    "limit": 10000,
    "fields": ["email", "password", "dbname"],
    "search": {
      "query": "user@example.com"
    }
  }'
```

### Poll Export

```bash theme={null}
curl -X GET "https://oathnet.org/api/service/v2/exports/JOB_ID" \
  -H "x-api-key: YOUR_API_KEY"
```

### Download Export

```bash theme={null}
curl -X GET "https://oathnet.org/api/service/v2/exports/JOB_ID/download" \
  -H "x-api-key: YOUR_API_KEY" \
  -o export.csv
```

## Scanners API

### Check Quota

```bash theme={null}
curl -X GET "https://oathnet.org/api/scanners/quota" \
  -H "x-api-key: YOUR_API_KEY"
```

### List Scanners

```bash theme={null}
curl -X GET "https://oathnet.org/api/scanners" \
  -H "x-api-key: YOUR_API_KEY"
```

### Create Scanner

```bash theme={null}
curl -X POST "https://oathnet.org/api/scanners/create" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Credential Exposure Monitor",
    "scanner_type": "breach",
    "query_config": {
      "q": "user@example.com"
    },
    "notification_type": "email",
    "notify_on_zero_results": false
  }'
```

## Utility Endpoint

```bash theme={null}
curl -G "https://oathnet.org/api/service/dbname-autocomplete" \
  -H "x-api-key: YOUR_API_KEY" \
  --data-urlencode "q=link"
```

## Tips

### Pretty-print JSON

```bash theme={null}
curl ... | jq .
```

### Save A File

```bash theme={null}
curl ... -o output.json
```

### Reuse Shell Variables

```bash theme={null}
API_KEY="your_api_key"
QUERY="user@example.com"

curl -G "https://oathnet.org/api/service/v2/breach/search" \
  -H "x-api-key: ${API_KEY}" \
  --data-urlencode "q=${QUERY}"
```

<CardGroup cols={2}>
  <Card title="SDK Overview" icon="brackets-curly" href="/sdks/overview">
    Back to SDK overview
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/overview">
    Full API documentation
  </Card>
</CardGroup>
