Check quotes against scanned pages
Prepare a retained OCR reading of a scanned source so batch quote checks and source preview can match quotes whose text OCR broke, and read reflowed matches correctly.
Last updated
Endpoint and minimal request
POST https://api.webcite.co/api/v2/sources/{versionId}/representations/{representationId}/prepare-ocr-rescue takes no body fields; the path names an OCR source version and parser representation you own. Send an Idempotency-Key header. Agents call prepare_ocr_rescue.
curl --fail-with-body -X POST 'https://api.webcite.co/api/v2/sources/YOUR_VERSION_ID/representations/YOUR_REPRESENTATION_ID/prepare-ocr-rescue' \
-H "x-api-key: $WEBCITE_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'Content-Type: application/json' \
-d '{}'Called on a page that was read from its text layer rather than by OCR, the recorded response declines:
{
"attempted": false,
"code": "not_ocr",
"reason": "No OCR pages available"
}Recorded file. The OCR provenance example shows a prepared reading.
Read a reflowed match
After preparation, a quote checked with batch quote checks or source preview can bind as reflowed, meaning it matched a derived OCR reading rather than the stored text. A reflowed match always stays needs_review, and the response keeps the original matched_text and the rescue provenance. A quote binds only when every figure in it matches the source: value, digit order, decimal point, sign, percent versus percentage points, currency, and million versus billion. Formatting differences such as thousands separators, non-breaking spaces, dash styles, a space before a percent sign and line breaks still bind.
When to use it, and what to use instead
Use it when quotes from scanned pages fail to bind because OCR split or merged words. For pages with a text layer, ordinary binding already works. To read a scan in the first place, use extraction, which applies OCR and reports how each page was read.