apyhub
DATA EXTRACTION · FILE CONVERSION

Extract Text from PDF API

What it does

PDF Text Extractor pulls plain text from a PDF and returns it in a single data field. Send either an uploaded PDF file or a remote PDF URL, and get the extracted text back.

Use the /file endpoint when the document is already in your request body as binary PDF data. Use /url when the PDF is hosted elsewhere and you want to pass a url instead. Both endpoints support page-range extraction with start_page and end_page, where end_page set to 0 means all pages.

If you need to capture only part of a page, you can also provide starting_x_coordinate, starting_y_coordinate, ending_x_coordinate, and ending_y_coordinate to limit extraction to a defined region. The preserve_paragraphs setting lets you keep paragraph structure when you need text that is easier to read or process downstream.

This is useful for document ingestion, search indexing, quote extraction, and turning reports, invoices, or manuals into text your application can parse, store, or analyze.

▣ ENDPOINT 01 / 02
POST
Extract text from uploaded PDF file
https://api.eu.apyverse.com/apyhub/extract-pdf-text/file

QUICKSTART

GUIDE

Quickstart

Upload a PDF to extract its text.

curl -X POST "https://api.eu.apyverse.com/apyhub/extract-pdf-text/file" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/document.pdf"

What you'll get back

Returns a JSON object with a data string field containing the extracted PDF text.

{
  "data": "Chapter 1. Sample PDF text content extracted from the document."
}
TRY ITLIVE · 50 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 (.pdf).
Last page (0 = all pages).

About this endpoint

What it does

Extracts text from an uploaded PDF file and returns the extracted content as a string.

Request Body

ParameterTypeMandatoryDescription
fileStringYesPDF file (.pdf).
end_pageIntegerNoLast page to extract. Default: 0 (all pages). Minimum: 0.
start_pageIntegerNoFirst page to extract. Default: 1. Minimum: 1.
ending_x_coordinateIntegerNoEnding X coordinate for extraction area. Default: 0. Range: 0 to 100.
ending_y_coordinateIntegerNoEnding Y coordinate for extraction area. Default: 0. Range: 0 to 100.
preserve_paragraphsENUMNoWhether to preserve paragraph structure. Allowed values: true, false. Default: false.
starting_x_coordinateIntegerNoStarting X coordinate for extraction area. Default: 0. Range: 0 to 100.
starting_y_coordinateIntegerNoStarting Y coordinate for extraction area. Default: 0. Range: 0 to 100.

Response

Returns a JSON object with a data string field containing the extracted PDF text.

ParameterTypeMandatoryDescription
dataStringYesExtracted text from the PDF document.

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.

▣ ENDPOINT 02 / 02
POST
Extract text from PDF at remote URL
https://api.eu.apyverse.com/apyhub/extract-pdf-text/url

QUICKSTART

GUIDE

Quickstart

Extract text from a PDF at a public URL by sending the document link in the request body.

curl -X POST "https://api.eu.apyverse.com/apyhub/extract-pdf-text/url" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://assets.apyhub.com/samples/sample.pdf"}'

What you'll get back

Returns a JSON object with a data string field containing the extracted PDF text.

{
  "data": "Chapter 1. Sample PDF text content extracted from the document."
}
TRY ITLIVE · 50 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.
body*

About this endpoint

What it does

Extracts text from a PDF available at a remote URL and returns the extracted text in a JSON response.

Request Body

ParameterTypeMandatoryDescription
urlStringYesRemote PDF URL to extract text from. Must be a URI.
end_pageIntegerNoLast page to include. Default: 0. Minimum: 0.
start_pageIntegerNoFirst page to include. Default: 1. Minimum: 1.
ending_x_coordinateIntegerNoEnding X coordinate for text extraction. Default: 0. Range: 0 to 100.
ending_y_coordinateIntegerNoEnding Y coordinate for text extraction. Default: 0. Range: 0 to 100.
preserve_paragraphsBooleanNoPreserve paragraph structure in the extracted text. Default: false.
starting_x_coordinateIntegerNoStarting X coordinate for text extraction. Default: 0. Range: 0 to 100.
starting_y_coordinateIntegerNoStarting Y coordinate for text extraction. Default: 0. Range: 0 to 100.

Response

Returns a JSON object with a data string field containing the extracted PDF text.

ParameterTypeMandatoryDescription
dataStringYesExtracted text from the PDF.

Body

Name
Type
Description
bodyREQUIRED
object
▣ 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.