> ## 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のマスキング

> スクレイピングおよび解析の出力から個人を特定できる情報をマスキングします

PIIのマスキングでは、返されたMarkdown内の個人を特定できる情報を、エージェント、ログ、ベクトルストア、分析パイプラインへ渡す前に置き換えます。

<div id="how-it-works">
  ## 仕組み
</div>

スクレイピングリクエストで `redactPII: true` を設定します。Firecrawl は生成された markdown をマスキングし、マスキング済みの内容を `markdown` に返します。`formats` を渡す必要はありません。markdown がデフォルトの出力です。

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

  firecrawl = Firecrawl(
    # 開始にAPIキーは不要です — より高い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({
    // 開始にAPIキーは不要です — より高いレート制限が必要な場合は追加してください:
    // apiKey: "fc-YOUR_API_KEY",
  });

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

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

  ```bash cURL theme={null}
  # 開始にAPIキーは不要です — より高いrate limitsを利用するには -H "Authorization: Bearer fc-YOUR_API_KEY" を追加してください:
  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}
  # 個人を特定できる情報をマスクした状態でmarkdownを返す。
  firecrawl https://example.com/contact --redact-pii
  ```
</CodeGroup>

<div id="redaction-options">
  ## マスキング オプション
</div>

ほとんどのリクエストでは、`redactPII: true` を指定します。マスキングを調整するには、options オブジェクトを渡します:

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

| オプション          | 値                                                             | デフォルト      | 説明                                                                                            |
| -------------- | ------------------------------------------------------------- | ---------- | --------------------------------------------------------------------------------------------- |
| `mode`         | `accurate`, `aggressive`, `fast`                              | `accurate` | マスキングの方式です。`accurate` はモデルのみの経路を使用し、`aggressive` は追加のヒューリスティクスで再現率を高め、`fast` はモデルの呼び出しを省略します。 |
| `entities`     | `PERSON`, `EMAIL`, `PHONE`, `LOCATION`, `FINANCIAL`, `SECRET` | すべてのエンティティ | マスキングの対象を特定のエンティティ区分のみに限定します。                                                                 |
| `replaceStyle` | `tag`, `mask`, `remove`                                       | `tag`      | 対象箇所を `<EMAIL>` のようなタグに置き換える、`*` でマスクする、または文字を完全に削除します。                                       |

<Note>
  Firecrawl CLI と MCP Server では、単純なブール値によるマスキングを利用できます。高度なオプションは、完全な `redactPII` オプションオブジェクトを公開している API と SDKs で利用できます。
</Note>

<div id="response">
  ## レスポンス
</div>

マスキングに成功すると、`markdown` には秘匿化後の内容が含まれます。

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

コマンドラインで表示するには、Markdown をお好みのレンダラーにパイプしてください：

```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
```

<div id="billing">
  ## 課金
</div>

PIIのマスキングには、1ページあたり5クレジットかかります: ベースのスクレイピングクレジット1に加え、マスキング用の追加4クレジットが必要です。

PDFを解析する場合、追加の各PDFページにも通常のPDF解析クレジットが発生し、さらにマスキングの追加料金も適用されます。

<div id="availability">
  ## 利用可能な箇所
</div>

PIIのマスキングは、Firecrawl がスクレイピングのオプションを受け付けるすべての場所でサポートされています。

* **スクレイピング** - `/v2/scrape` で `redactPII` を設定します。
* **クロール、バッチスクレイプ、検索** - `scrapeOptions` 内で `redactPII` を渡します。
* **解析** - multipart の `options` JSON 内で `redactPII` を渡します。
* **SDKs** - Python では `redact_pii` を使用します。JavaScript とその他の SDKs では、`redactPII` または各言語のオプション命名規則に従った形式を使用します。
* **CLI** - `firecrawl scrape` に `--redact-pii` を渡します。
* **MCP server** - 単純な真偽値でのマスキングを行う場合は、`firecrawl_scrape` ツールの引数に `"redactPII": true` を含めます。

> Firecrawl APIキーが必要な AI agent ですか？ 自動オンボーディング手順については、[firecrawl.dev/agent-onboarding/SKILL.md](https://www.firecrawl.dev/agent-onboarding/SKILL.md) を参照してください。
