# PII Redaction (/features/pii-redaction)

<!-- agent-signals: reading_time_min: 3 · est_tokens: 1439 · updated: 2026-07-30 -->
Related: [Search](/features/search.md), [Search Highlights](/features/search-highlights.md), [Research Index](/features/research.md), [Scrape](/features/scrape.md), [Faster Scraping](/features/fast-scraping.md), [Batch Scrape](/features/batch-scrape.md)

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 [#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>
  <CodeBlockTabs defaultValue="Python" groupId="cli+curl+javascript+python">
    <CodeBlockTabsList>
      <CodeBlockTabsTrigger value="Python">
        Python
      </CodeBlockTabsTrigger>

      <CodeBlockTabsTrigger value="JavaScript">
        JavaScript
      </CodeBlockTabsTrigger>

      <CodeBlockTabsTrigger value="cURL">
        cURL
      </CodeBlockTabsTrigger>

      <CodeBlockTabsTrigger value="CLI">
        CLI
      </CodeBlockTabsTrigger>
    </CodeBlockTabsList>

    <CodeBlockTab value="Python">
      ```python  
      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)
      ```
    </CodeBlockTab>

    <CodeBlockTab value="JavaScript">
      ```javascript  
      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);
      ```
    </CodeBlockTab>

    <CodeBlockTab value="cURL">
      ```bash  
      # 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
        }'
      ```
    </CodeBlockTab>

    <CodeBlockTab value="CLI">
      ```bash  
      # Return markdown with personally identifiable information redacted.
      firecrawl https://example.com/contact --redact-pii
      ```
    </CodeBlockTab>
  </CodeBlockTabs>
</CodeGroup>

## Redaction options [#redaction-options]

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

```json
{
  "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 [#response]

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

```json
{
  "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 title="cURL"
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 [#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 [#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.
