Logo
POST /api/pdf/content/search

PDF Search API

Send a PDF URL and a search term, get back every match with its page number and line. Search for plain words or regular expressions, case-sensitive when you need it.

  • Free plan
  • No credit card

Request

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

Find the term.
Know the page.

Every match comes back with its page and the line it was found in. The exact words show how the document actually writes them.

portable document format 3 matches
Pages with a match example
1
2
3
4
5
6 1
7
8
9
10
11
12
13
14
15
16
17 2
18
19
20
Page 6

7. "ISO 32000-1:2008 – Document management – Portable document format – Part 1: PDF

Page 17

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"

Search options
text
The word, phrase or pattern to find
case=1
Match upper and lower case exactly
regex=1
Treat the text as a regular expression
async=1
Run in the background, get a job ID
(defaults)
Plain text, upper and lower case alike

Answers with page numbers.

When you need to know whether a document mentions something, and where, one call tells you.

Compliance checks

Flag contracts that contain a clause your legal team wants to review, and send reviewers straight to the right page.

Reference numbers

Find invoice, order or policy numbers with a regular expression and pass the exact values on to your system.

Document routing

Route incoming PDFs by the words they contain, like a customer name, a product or a deadline in the text.

Search in your app

Let users search the PDFs in your product and jump to the page and the line where their term appears.

Search from anywhere.

Check documents for a term wherever they arrive. 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/content/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
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
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
See what agents can do

1,000 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

Searching PDFs, answered

No. A scan has no text layer to search, so it returns no results. Use OCR search for scans: it recognizes the words first and returns the same result fields.
With regex=1 the text is read as a Perl-compatible regular expression, so a pattern like INV-\d{6} finds invoice numbers such as INV-104823 and returns each one as exact_word.
Every occurrence is its own result. A line with two matches shows up twice, with the same page and line and each match as its own exact_word.
Yes, the matches are in the response. For long documents you can send async=1 to get a job ID instead, then check the job status endpoint or pass a webhook_url to have the result posted to you.
As a URL: Apdf downloads the file, up to 100 MB. In Zapier and n8n you can map the file from an earlier step instead.
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

Find what your PDFs say,
and on which page.