apyhub
DATA EXTRACTION · DEVELOPER TOOLS

Extract Text from PDF Document API

What it does

PDF Text Extraction lets you send a PDF file and get the text from every page back in a structured response. It is built for documents where you need the contents, not the layout: contracts, invoices, reports, manuals, and scanned records.

The endpoint accepts a single binary file in the request body, with a maximum size of 20 MB. The response returns the combined text for the document, the total number of pages, and a pages_detail array with per-page page numbers and text values. That gives you both a document-level result and page-level output you can index, search, or review independently.

Use PDF Text Extraction when you need to feed document text into search, analytics, review workflows, or downstream automation. For example, you can extract contract text before clause parsing, pull invoice text into an accounting pipeline, or split a report into page-level text for auditing and summarisation.

If the PDF contains mostly text, this is a straightforward way to turn it into machine-readable content without building your own parser.

POST
Extract text from every page of a PDF file
http://localhost:8080/dosvak/extract-pdf-text
QUICKSTARTGUIDE

Quickstart

Upload a PDF to extract its text.

curl -X POST "http://localhost:8080/dosvak/extract-pdf-text" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/document.pdf"

What you'll get back

Returns a JSON object with optional text string, pages integer, and pages_detail array fields. text contains the extracted text, pages is the number of pages processed, and pages_detail contains per-page objects with page and text.

{
  "text": "Example extracted text",
  "pages": 3,
  "pages_detail": [
    {
      "page": 1,
      "text": "First page text"
    }
  ]
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
PDF file (max 20 MB)

About this endpoint

What it does

Extracts text from every page of an uploaded PDF file and returns the extracted content as a JSON object. The response also includes the total number of pages and per-page text details.

Request Body

ParameterTypeMandatoryDescription
fileStringYesPDF file upload in binary format. Maximum size: 20 MB.

Response

Returns a JSON object with text as a string, pages as an integer, and pages_detail as an array of objects. Each item in pages_detail contains a page integer and text string for that page.

ParameterTypeMandatoryDescription
textStringNoExtracted text from the PDF.
pagesIntegerNoTotal number of pages in the PDF.
pages_detailObject ArrayNoPer-page extracted text entries.
pages_detail[].pageIntegerNoPage number for the entry.
pages_detail[].textStringNoText extracted from that page.

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.