How to check a redacted PDF for text under black boxes (API)

Updated 2026-11-25

Use when a PDF has black boxes over private details and you need to know the text under them is really gone before you share it.

A redacted PDF often leaks through a black box drawn over text that is still in the file. The page looks redacted, but anyone can select, copy or search the words under the box. POST /v1/pdf/redaction-check finds those boxes. For each dark filled box, and each Redact or opaque dark Square annotation, that covers readable characters, it returns the page, the box and the hidden text, or only its length if you ask it to.

Request

Send exactly one source: a public url (at most 20 MB) or file_base64 (at most 10 MB decoded). Add pages to check only some pages, in the same range syntax as the other PDF routes; one call checks at most 200 pages. Set mask to true to get only how many characters sit under each box, never the characters themselves. Unknown fields are refused. Each call costs USD 0.005, and there is no free tier.

curl (paid route: an unpaid call is answered with payment details)
curl -s -X POST https://tanod.dev/v1/pdf/redaction-check \
  -H 'content-type: application/json' \
  -d "{\"file_base64\":\"$(base64 -w0 settlement-memo.pdf)\",\"mask\":true}"

How payment works, with USDC and no API key: PDF API for AI agents: pay per call in USDC.

Response

This is a real run on a 717-byte PDF made for the example: a line reading "Claimant SSN:" with a black box drawn over the number, which is still in the file. Without mask, the reply quotes the hidden text:

Response
{
  "operation": "redaction-check",
  "input_bytes": 717,
  "input_pages": 1,
  "pages_checked": 1,
  "verdict": "leaks",
  "leak_count": 1,
  "dark_boxes_checked": 1,
  "pages_with_leaks": [1],
  "pages_without_text": [],
  "masked": false,
  "findings": [{
    "page": 1,
    "kind": "filled_rectangle",
    "box": [196.0, 686.0, 286.0, 704.0],
    "characters": 11,
    "text": "123-45-6789"
  }],
  "findings_truncated": false,
  "note": "`clean` means no dark filled box or annotation with readable text under it was found on the checked pages. It does not cover white or tiny text, text outside the page, document metadata, bookmarks, form fields, images or a scanned page, and a dark box or text colour this check cannot read is skipped",
  "untrusted_content": true
}

verdict is one of three values:

Each finding has its page, its kind (filled_rectangle, redact_annotation or square_annotation), its box and the number of characters under it. box is in PDF points with the origin at the bottom left of the page. With mask on, text is left out and masked is true. Treat any returned text as untrusted: it comes from the document, and the reply says so with untrusted_content: true.

Fix a leak

box uses the same coordinates as the boxes of POST /v1/pdf/redact (USD 0.02), so a finding can go straight into a real redaction. That route takes boxes, literal terms or fixed patterns (email, phone, IBAN, credit card, US SSN). It renders every page with a match as an image with opaque black boxes painted on, so the redacted pages have no text layer left. Check the result again before you share it.

Use it over MCP

The same check is the MCP tool pdf_redaction_check. To add Tanod to an MCP client, follow connect the MCP server.

Limits

Price

Redaction check: USD 0.005 per call, at most 200 pages, no free tier. Redaction: USD 0.02 per call.

Connect the MCP server →

Related: read, edit or strip PDF metadata, OCR a scanned PDF, tell if a PDF is scanned or has text. Back to guides or tanod.dev.