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 -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:
{
"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:
leaks: at least one dark box has readable text under it.leak_countcounts them andpages_with_leakslists their pages.clean: no dark box with readable text under it was found on the checked pages. It says nothing beyond that (see the limits below).no_text_layer: none of the selected pages has a text layer, so there was nothing to check.
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
- Only dark boxes are checked. Light text on a dark bar is not counted.
- White or tiny text, text outside the page, document metadata, bookmarks, form fields, images and scanned pages are not examined. A scanned page has no text layer to read.
- Results are automated and heuristic. A
cleanverdict does not prove a file is safe to share. - A file that is not a PDF, is encrypted or names a page that does not exist gets a 4xx answer and is not charged. A
cleanorno_text_layerverdict is a normal, charged answer. - A call that cannot finish within about 78 seconds is answered with a 503 and is not charged.
- The document and the hidden text are never logged.
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.