AI Search PDF

AI Search PDF

Pro

AI Search PDF is a REST API tool that locates content in PDF documents by category or natural-language description, even when the exact wording is not known in advance. It returns the matched source text and its page location for your application to review and use. Choose from supported search categories or describe the content to find, then decide how selected results should move through your workflow.

Key Benefits of AI Search PDF API

  • Find information by meaning or category instead of supplying the exact phrase that appears in the PDF.
  • Use supported categories for common content types or provide a custom description for a more specific search intent.
  • Receive matched source text and page coordinates so your application can present findings in their document context.
  • Use returned confidence information to help prioritize and review candidate matches in your application.
  • Search selected pages or ranges when the relevant content is limited to part of a document.
  • Send reviewed findings to Highlight PDF, Redact PDF, or Replace PDF Text for a controlled follow-up operation.
Pro
What are Pro Tools?
Pro Tools are a suite of advanced and specialized API tools designed to tackle more complex document processing challenges. These powerful features, offering enhanced capabilities, are included with Pro and Enterprise plans. Premium plan users can also access Pro Tools on a per-call basis, allowing flexible access to premium functionalities when needed.
Build Your Solution

You have document processing problems, we have Solutions. Explore the many ways pdfRest can align your documents with your business objectives.

Browse all solutions
Ensure GDPR Compliance for PDF Processing with EU-Based Cloud API
Ensure GDPR Compliance for PDF Processing with EU-Based Cloud API
The pdfRest logo is added to the Microsoft Power Automate logo with a representation of a PNG to PDF conversion workflow
Integrate pdfRest with Microsoft Power Automate
The Salesforce logo with APEX programming language is connected with the pdfRest logo around a PDF toolkit icon
Integrate PDF API Tools with Salesforce Apex Code
Why is pdfRest the best API for AI-powered PDF search?
pdfRest offers the best solution for AI search in PDFs because it finds text by category or description, returns the original passages with page locations, and connects search to targeted edits.

Find PDF Passages by Meaning

The same idea can appear in different words across PDFs. One agreement might say it “automatically renews,” while another says it “continues for a further term.” AI Search PDF helps locate both kinds of passages when you know what the text means but don’t know how it will be phrased.

Choose how to describe the text you want to find:

  • Built-in categories: Find types of information such as organization names, postal addresses, or monetary amounts across documents with different wording and layouts.
  • Custom descriptions: Look for text specific to your task, such as a clause explaining how much notice a customer must give to cancel a service agreement.

For an agreement review app, a custom description can narrow the findings to renewal conditions and deadlines, giving reviewers a way to locate the passages relevant to their decision.

Locate AI Search Matches in the PDF

AI Search PDF returns the information an application needs to show each finding in context:

  • Matched source text: Display the wording from the document so a reviewer can read what was actually found.
  • Page numbers and coordinates: Open the PDF at the relevant page and draw attention to the exact passage. The coordinates come from the text located in the PDF.
  • Confidence information: Use the confidence data to help prioritize candidate matches for review.

For example, a contract review app can show a list of candidate renewal clauses alongside the original agreement. A reviewer can jump to each passage and read the surrounding language, such as whether the deadline applies to the initial term or to later renewals. That context helps the reviewer decide which findings to carry into the next step.

Use AI Search Results in PDF Workflows

Use AI Search PDF to locate candidate passages, then choose which matches to act on. Submit the selected findings with the same PDF to the tool that makes the change:

  • Highlight PDF creates annotations on selected passages, such as renewal clauses a contract reviewer needs to see.
  • Redact PDF targets selected text for removal, such as names of organizations covered by a disclosure policy.
  • Replace PDF Text updates selected text once your application supplies the new wording for each retained match.

For example, a contract team can identify and mark candidate passages in a review copy. Once the team decides what should be removed from a version for external sharing, the application can submit just those findings for redaction against the PDF it searched.

Start from Code Examples
See more code examples in our GitHub repository

Need more help?

Start with a Tutorial for step-by-step guidance

Customize Your Solution

Learn about the parameters for this tool to create your custom solution.

Searches

The required searches parameter accepts a nonempty array of definitions. Set the type and value for each definition:

  • ai_preset: Set value to a supported category such as organization_name, postal_address, or monetary_amount.
  • prompt: Set value to a description of the text to find, such as “the clause that states how much notice is required to cancel the agreement.”

You can submit several definitions in one request. Send an array in a JSON request or a JSON-encoded array string in the multipart field. The input PDF needs a text layer. Use OCR PDF first for scanned pages that contain only images.

Each definition also accepts an optional content_scope. Use all (default) for all existing text or body to exclude detected headers and footers.

Safe & Secure

Confidently process your sensitive data with pdfRest. Our platform is built for robust, Enterprise-grade security and compliance. We meet rigorous standards for GDPR and HIPAA, and our controls are independently audited to ensure strict SOC 2 Type 2 compliance. Your data's protection is our commitment.

Frequently Asked Questions
Need more help? Contact Us or visit our documentation.

AI Search PDF looks for existing PDF text by category or description. For example, contracts from different suppliers may use several phrases to describe automatic renewal. Describe the renewal terms you want to locate, and the API returns candidate passages with their source text and locations. Your application can show those passages alongside the original PDF and decide which findings to carry forward.

Start with a PDF containing a few examples of a known category. Compare the returned passages with the source, then try a custom description for text whose wording varies.

To test POST /ai-search-results directly, get a pdfRest API key and send a request from your HTTP client using the Api-Key header. To explore browser-based requests for supported tools, open the API Lab. The cURL example shows a complete request for AI Search PDF.

Upload a local PDF in the multipart file field, or pass the id of a PDF already uploaded to pdfRest. To use a JSON request body, send the resource ID together with your operation parameters. For example, you can send a PDF through Upload Files once and use its ID for multiple requests without transferring the same file each time.

Read the inline JSON for immediate use in your application, or set output_type to file if you want a downloadable JSON file. The default is inline JSON. An empty matches array and a warning mean the completed search found no matches. Your application can handle that as a valid outcome, such as showing an empty results state or skipping a downstream step.

AI Search PDF works with text embedded in the PDF, including a text layer produced by OCR. A page that contains only a scanned image needs a text layer before the tool can find words on it. First process the file with OCR PDF, then pass the resource ID of the OCR output. If you plan to use search selections afterward, generate them from that same OCR output.

Send an HTTP POST to /ai-search-results with your API key, the PDF input, and the operation parameters. Start with searches for a request that defines what to find or process. Any language with an HTTP client can call the endpoint. Use the Cloud API Reference for authentication, request formats, and resource handling, then keep the API key on your server when building a browser-facing application. The pdfRest code samples on GitHub show request patterns in several languages.

Use AI Search PDF when a category or description is a better way to identify the text than a fixed phrase. For example, you can look for paragraphs describing when a customer may cancel an agreement. Use Search PDF when the input has an exact value or follows a known pattern, such as a specific account label or an internal work order ID.

Use an AI preset for a defined category, such as organization names, postal addresses, or monetary amounts. Choose a custom description for a more specific task, such as finding the clause that states the notice period for terminating a contract.

Each search definition has its own type and value. You can submit several definitions together, for example a preset for organization names and a custom description for the section that identifies each party’s responsibilities.

Treat confidence information as one input when sorting or prioritizing candidate matches. The source text, page, and coordinates give your reviewer the details needed to read a finding in context. For example, a contract app can bring reviewers directly to the passage and show the surrounding clauses. A reviewer can decide which results apply before the application sends any follow-up action.

Use AI Search PDF to find candidate passages, then keep the findings that belong in the review copy. Submit them as selections to Highlight PDF together with the unchanged PDF used for the search. A contract team can use this approach to mark renewal terms even when suppliers use different wording. The separate highlighting request lets the application control which passages are annotated.

Use a category or description to identify candidate text, review the source passages, and select what needs to be removed. Pass those results and the same PDF to Redact PDF to create the redaction preview, then apply the redactions separately. For example, an application can find organization names and select only the entities covered by a disclosure policy.

Use AI Search PDF to locate the passages and Replace PDF Text to make the edits. Your application supplies the replacement text for each retained match and submits the selections with the same unchanged PDF. For example, find party names by category, then use an application lookup to supply the correct standardized name for each selected occurrence. Keep the original matched text and geometry intact.

Set pages to the page numbers or ranges your application needs. For example, 3-6,10-last covers pages 3 through 6 and page 10 through the end. Targeting relevant sections is useful when a document follows a consistent template, such as an agreement where renewal terms are grouped in an appendix. If you omit pages, AI Search PDF searches the entire document.

AI Search PDF is available on the standard US Cloud API at https://api.pdfrest.com. The Cloud API Reference lists the Cloud base URLs and explains how to authenticate requests. If your application uses the EU Cloud endpoint or a self-hosted deployment, check which endpoint your integration targets before adding this operation. For exact wording and known patterns, evaluate Search PDF for the workflow.

Generate a self-service API Key now!
Create your FREE API Key to start processing PDFs in seconds, only possible with pdfRest.