Document AI — DMS

Find search term inside a document (page + rectangle)

Find where a search term occurs inside ONE document: returns each occurrence with page number, percent rectangle (box = exact OCR rectangle, x/y/w/h = padded display marker) and a snippet. Read-only, no OCR run. Pricing: API minimum...

get/documents/ocr-search-hits

Request

  • Base URL: https://api.paperoffice.ai/latest
  • URL: https://api.paperoffice.ai/latest/documents/ocr-search-hits
  • Auth: HTTP bearer

Query parameters

pofidstring required

PaperOffice File ID of the document (from document-search / documents-list). Numeric documents_id is also accepted.

querystring required

Search term or phrase, 2 to 160 characters. Matched as substring, case-insensitive, accent-folded.

match'auto' | 'phrase' | 'any'

auto: whole phrase first, single words if the phrase has no hit. phrase: whole phrase only. any: every word on its own.

Response

Success

status'success' required
pofidstring required
total_pagesinteger

Pages of the document

querystring required

Normalized query

match'auto' | 'phrase' | 'any'

Requested mode

match_mode'phrase' | 'tokens' | 'none' required

Mode that produced the hits

coordinates'percent_of_page'
totalinteger required

Number of occurrences found (before the 2000 cap)

truncatedboolean

true when hits were capped; the first hit of every page is kept

pages_truncatedboolean

true when more than 2000 pages matched

page_countinteger

Distinct pages with at least one hit

Changes

No recorded changes to this operation across all 1 revision of this API.