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"
const data = new FormData();
data.append('file', 'FILE_URL');
data.append('text', 'SEARCH_TEXT');
fetch('https://apdf.io/api/pdf/ocr/search', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/ocr/search', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL',
'text' => 'SEARCH_TEXT'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/ocr/search',
{
'file' => 'FILE_URL',
'text' => 'SEARCH_TEXT'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/ocr/search',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL',
'text': 'SEARCH_TEXT'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL",
"text": "SEARCH_TEXT"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/ocr/search")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.add("text", "SEARCH_TEXT")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/ocr/search")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
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.
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"
-
page 6 1 matchPortable document format
-
page 17 2 matchesPortable Document Format Portable Document Format
- 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.
One authenticated POST from any language. Copy-paste samples in cURL, Node.js, Python and more.
POST /api/pdf/ocr/search
Pick the action in any Zap and map files from earlier steps. No code and no servers to run.
Search PDF Text With OCR
Add the Apdf node to any workflow, on n8n Cloud or self-hosted, and chain it with your automation.
Search PDF content with OCR
Let Claude, ChatGPT, Gemini or your own agent run it through the MCP server, on any paid plan.
search-pdf-content-with-ocr
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.
OCR search, answered
OCR search tutorials
Search Inside Scanned Contracts and Documents with PHP
Find specific text within scanned PDF documents using PHP and the Apdf OCR Search API. Perfect for legal compliance, contract review, and searching through digitized archives where standard PDF search doesn't work.
Turn Scanned Invoices into Structured Data with an Agent
OCR reads tabular scans in scrambled order — the wall every regex parser dies against, and exactly where the agent shines: it reassembles vendor, number, date and line items from the mess, cross-checks the sums against each stated total, and flags mismatches for human eyes instead of your books.
OCR Scanned PDFs by Asking Claude
That folder of scans — old leases, signed contracts, photographed paperwork — becomes searchable conversationally: Claude checks the text layer, runs the OCR job through the Apdf MCP tools, and answers questions from the recovered text with page-level receipts.
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.
API · Webhook · MCP