Logo
POST /api/pdf/ocr/search

PDF OCR Search API

Send the URL of a scanned PDF and a search term, get back every match with its page and line. OCR reads the scan first, so paper documents become searchable too.

  • Free plan
  • No credit card

Request

curl -X POST https://apdf.io/api/pdf/ocr/search \
  -H "Authorization: Bearer TOKEN" \
  -d file="FILE_URL" \
  -d text="SEARCH_TEXT"

Search the paper.
Find the page.

OCR turns each scanned page into text, then the search runs on it. Every match comes back with its page, its line and the exact words.

portable document format example

37. Adobe Systems Inc. (July 1, 2008). "Document Management – Portable Document Format –

64. "Processing Dangerous Paths – On Security and Privacy of the Portable Document Format"

17
  • page 6 1 match
    Portable document format
  • page 17 2 matches
    Portable Document Format Portable Document Format
results_total 3 results_pages 2
How OCR search works
Scanned pages
Recognized with OCR, then searched
Typed pages
Searched as they are
Options
text, case and regex, as in PDF search
Runs
In the background, always
Result
The same fields as PDF search

Find it on paper.

Scanned files are invisible to a normal text search. OCR search finds the term and tells you the page.

Case and contract review

Search boxes of scanned contracts and letters for a name or a clause, and get the pages a lawyer should read.

Numbers on scans

Find order, invoice or case numbers on scanned paperwork with a regular expression, along with their page.

Checks on old files

Check scanned archives for terms that must or must not appear, before the files are moved, shared or deleted.

Sorting scanned mail

Route scanned letters by the words on them, like a customer number, a department or a contract reference.

Search scans from anywhere.

Look inside scanned paperwork wherever it lands. One account and one monthly allowance behind every route.

Your code

One authenticated POST from any language. Copy-paste samples in cURL, Node.js, Python and more.

POST /api/pdf/ocr/search
Open the endpoint docs
Zapier

Pick the action in any Zap and map files from earlier steps. No code and no servers to run.

Search PDF Text With OCR
Use it in Zapier
n8n

Add the Apdf node to any workflow, on n8n Cloud or self-hosted, and chain it with your automation.

Search PDF content with OCR
Use it in n8n
AI agents

Let Claude, ChatGPT, Gemini or your own agent run it through the MCP server, on any paid plan.

search-pdf-content-with-ocr
See what agents can do

1,000 OCR searches
a month. Free.

Start on the free plan and move up only when your volume does — up to 1,000,000 operations a month on Business.

  • One call is one operation, however many pages.
  • Only calls that do the work are counted.
  • Hard limits, so no surprise overage charges.
Plan PDF operations / month
Hobby Free
$0 / month
1,000
Pro
$39–$99 / month
20,000 – 60,000
Business
$149–$899 / month
100,000 – 1,000,000

OCR search, answered

When the PDF is a scan, or when you can't tell. PDF search only sees text a file already contains and answers in the same request, so it is the better fit for PDFs that were created digitally.
OCR reads what is printed, so faint, blurred or unusual print can come out slightly different from what you see. A looser pattern with regex=1, like invoice\s*no, catches small differences such as a missing space.
OCR recognizes English text, and there is no language parameter. Text in other languages may be found less reliably.
Each OCR search recognizes the scan again. Convert it once with OCR convert, then run PDF search on the new file for each term, with the matches in the same request.
The call returns a job ID. Check it on the job status endpoint, or pass a webhook_url and the matches are posted to you when they are ready.
After the API call

Your code made the PDF.
Then it went dark.

Opened, read, signed or ignored — you never see any of it. Send the PDFs you generate as personal links, and every open, page read, comment and signature comes back to your software as a webhook. Need it signed? Same link. Same account, same API key, one more call.

Your PDF, after sending Live
document:loaded CFO
page:read p4 · 38s
signature:signed 11:48

API · Webhook · MCP

Search the paper
you already have.