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

## Nuclei Extractor Types

| Type | Fields | Purpose |
|------|--------|---------|
| `regex` | regex, group, part | Pattern-based text extraction |
| `json` | json, part | JQ-style JSON path extraction |
| `kval` | kval | Key-value header extraction |
| `xpath` | xpath, part | XPath-based HTML/XML extraction |
| `dsl` | dsl | Expression-based computed extraction |

## Extractor Options

| Field | Type | Description |
|-------|------|-------------|
| `name` | string | Named extractor for identification |
| `part` | string | Response part (body, header, all) |
| `group` | int | Regex capture group number |
| `internal` | bool | Internal-only (not in output) |

## Internal vs External Extractors

| Mode | `internal` | Output | Use Case |
|------|-----------|--------|----------|
| External | false | Included in results | Reporting values |
| Internal | true | Hidden from output | Template chaining |

## Response Parts for Extraction

| Part | Content |
|------|---------|
| `body` | Response body |
| `header` | Response headers |
| `all` | Full response |
| `body_N` | Nth response body (multi-request) |
| `header_N` | Nth response headers (multi-request) |

## DSL Functions for Extraction

| Function | Description |
|----------|-------------|
| `to_string()` | Convert value to string |
| `to_number()` | Convert to number |
| `len()` | String/array length |
| `contains()` | Substring check |
| `regex()` | Pattern extraction |
| `base64_decode()` | Decode base64 value |
| `url_decode()` | Decode URL encoding |
| `md5()` | MD5 hash of value |
| `sha256()` | SHA256 hash of value |

## JSON Output Format

```bash
# Standard JSON output
nuclei -u https://target.com -t template.yaml -json

# JSON lines output
nuclei -u https://target.com -t template.yaml -json -silent

# JSON with extracted results
# Output includes "extracted-results" array per finding
```
