apyhub
DATA EXTRACTION · FILE MANIPULATION

Extract Text from PDF API

Hosted on ApyHub

What it does

PDF Text Extraction lets you send a PDF from a remote URL or upload a PDF file and get the extracted text back in a single data field. Use it when you need the readable text from reports, invoices, contracts, or scanned documents without building your own parser.

With POST /url, pass a url to a PDF and optional page controls: start_page, end_page, and coordinate bounds with starting_x_coordinate, starting_y_coordinate, ending_x_coordinate, and ending_y_coordinate. Set preserve_paragraphs when you want the output to keep paragraph structure. With POST /file, upload the PDF as file and use the same page and coordinate options, including preserve_paragraphs.

The response is intentionally simple: data contains the extracted text as a string. That makes PDF Text Extraction easy to drop into indexing pipelines, document search, compliance review, content migration, or any workflow where you need text before further processing.

If you only need text from specific pages or a defined region of a page, the page and coordinate filters help you narrow the extraction without post-processing the full document.

▣ ENDPOINT 01 / 02
POST
submit url: extracted data
http://localhost:8080/apyhub/extract-text-from-pdf/url
QUICKSTARTGUIDE

Quickstart

Extract text from a PDF by sending its URL in a minimal JSON request.

curl -X POST "http://localhost:8080/apyhub/extract-text-from-pdf/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 text from the PDF.

{
  "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 located at a remote URL and returns the extracted content as a string. You can optionally limit the extraction to a page range and define coordinate bounds for the extracted area.

Request Body

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

Response

Returns a JSON object with a data string field containing the extracted text. Success responses are represented as a JSON object shaped like { data: string }.

ParameterTypeMandatoryDescription
dataStringYesExtracted text content from the PDF.

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 02 / 02
POST
upload file: extracted data
http://localhost:8080/apyhub/extract-text-from-pdf/file
QUICKSTARTGUIDE

Quickstart

Upload a PDF file to extract its text.

curl -X POST "http://localhost:8080/apyhub/extract-text-from-pdf/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

Uploads a PDF file and extracts text from it. You can optionally limit extraction to a page range and a coordinate bounding box, and control whether paragraphs are preserved in the extracted text.

Request Body

ParameterTypeMandatoryDescription
fileStringYesPDF file (.pdf). Binary upload.
end_pageIntegerNoLast page to extract. 0 means all pages. Default: 0.
start_pageIntegerNoFirst page to extract. Default: 1.
ending_x_coordinateIntegerNoEnding X coordinate for extraction bounds. Minimum 0, maximum 100. Default: 0.
ending_y_coordinateIntegerNoEnding Y coordinate for extraction bounds. Minimum 0, maximum 100. Default: 0.
preserve_paragraphsENUMNoWhether to preserve paragraphs in the extracted text. Allowed values: true, false. Default: false.
starting_x_coordinateIntegerNoStarting X coordinate for extraction bounds. Minimum 0, maximum 100. Default: 0.
starting_y_coordinateIntegerNoStarting Y coordinate for extraction bounds. Minimum 0, maximum 100. Default: 0.

Response

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

ParameterTypeMandatoryDescription
dataStringYesExtracted text content from the uploaded PDF file.

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.