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

# PII Redaction

> Redact personally identifiable information from scrape and parse output

PII redaction replaces personally identifiable information in returned markdown before you send it downstream to agents, logs, vector stores, or analytics pipelines.

## How it works

Set `redactPII: true` on a scrape request. Firecrawl redacts the generated markdown and returns the redacted version in `markdown`. You do not need to pass `formats`; markdown is the default output.

<CodeGroup>
  ```python Python theme={null}
  from firecrawl import Firecrawl

  firecrawl = Firecrawl(
    # No API key needed to get started — add one for higher rate limits:
    # api_key="fc-YOUR_API_KEY",
  )

  doc = firecrawl.scrape(
      "https://example.com/contact",
      redact_pii=True,
  )

  print(doc.markdown)
  ```

  ```javascript JavaScript theme={null}
  import { Firecrawl } from 'firecrawl';

  const firecrawl = new Firecrawl({
    // No API key needed to get started — add one for higher rate limits:
    // apiKey: "fc-YOUR_API_KEY",
  });

  const doc = await firecrawl.scrape('https://example.com/contact', {
    redactPII: true,
  });

  console.log(doc.markdown);
  ```

  ```bash cURL theme={null}
  # No API key needed to get started — add -H "Authorization: Bearer fc-YOUR_API_KEY" for higher rate limits:
  curl -X POST https://api.firecrawl.dev/v2/scrape \
    -H 'Content-Type: application/json' \
    -d '{
      "url": "https://example.com/contact",
      "redactPII": true
    }'
  ```

  ```bash CLI theme={null}
  # Return markdown with personally identifiable information redacted.
  firecrawl https://example.com/contact --redact-pii
  ```
</CodeGroup>

## Redaction options

For most requests, use `redactPII: true`. To tune redaction, pass an options object:

```json theme={null}
{
  "redactPII": {
    "mode": "accurate",
    "entities": ["EMAIL", "PHONE", "SECRET"],
    "replaceStyle": "tag"
  }
}
```

| Option         | Values                                                        | Default      | Description                                                                                                                                         |
| -------------- | ------------------------------------------------------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `mode`         | `accurate`, `aggressive`, `fast`                              | `accurate`   | Redaction strategy. `accurate` uses the model-only path, `aggressive` increases recall with additional heuristics, and `fast` skips the model call. |
| `entities`     | `PERSON`, `EMAIL`, `PHONE`, `LOCATION`, `FINANCIAL`, `SECRET` | All entities | Limit redaction to specific entity buckets.                                                                                                         |
| `replaceStyle` | `tag`, `mask`, `remove`                                       | `tag`        | Replace spans with tags like `<EMAIL>`, mask them with `*`, or remove the characters entirely.                                                      |

<Note>
  The Firecrawl CLI and MCP server expose simple boolean redaction. Advanced options are available through the API and SDKs that expose the full `redactPII` options object.
</Note>

## Response

When redaction succeeds, `markdown` contains the redacted content:

```json theme={null}
{
  "success": true,
  "data": {
    "markdown": "Contact us at <EMAIL> or <PHONE>.",
    "metadata": {
      "sourceURL": "https://example.com/contact"
    }
  }
}
```

For command-line viewing, pipe the markdown into your preferred renderer:

```bash cURL theme={null}
curl -X POST https://api.firecrawl.dev/v2/scrape \
  -H "Authorization: Bearer $FIRECRAWL_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
    "url": "https://dlptest.com/sample-data.pdf",
    "redactPII": true
  }' | jq -r ".data.markdown" | glow
```

## Billing

PII redaction costs 5 credits per page: 1 base scrape credit plus 4 additional credits for redaction.

For parsed PDFs, each additional PDF page still incurs the normal PDF parsing credit and also receives the additional redaction charge.

## Availability

PII redaction is supported anywhere Firecrawl accepts scrape options:

* **Scrape** - set `redactPII` on `/v2/scrape`.
* **Crawl, batch scrape, and search** - pass `redactPII` inside `scrapeOptions`.
* **Parse** - pass `redactPII` inside the multipart `options` JSON.
* **SDKs** - Python uses `redact_pii`; JavaScript and other SDKs use `redactPII` or their native option casing.
* **CLI** - pass `--redact-pii` to `firecrawl scrape`.
* **MCP server** - include `"redactPII": true` in `firecrawl_scrape` tool arguments for simple boolean redaction.

> Are you an AI agent that needs a Firecrawl API key? See [firecrawl.dev/agent-onboarding/SKILL.md](https://www.firecrawl.dev/agent-onboarding/SKILL.md) for automated onboarding instructions.
