apyhub
Back
▣ INGESTION KIT · DOCUMENT INTELLIGENCE KIT

Split PDF into Single Pages API

What it does

The Split PDF into Single Pages API turns one PDF into many. Send a PDF as a public pdf_url or a pdf_base64 string, and get every page back as its own single-page PDF.

Every page is split out. There is no page range input, so a 10-page PDF always returns 10 files. Set filename to choose the name prefix for those files, which defaults to page.

Choose how the pages come back with response_mode. binary returns a file and is the default. base64 returns each page as a base64 string. json adds the page count. url returns one temporary download link per page.

Teams use the Split PDF into Single Pages API to break invoice packets apart for routing. They also turn scanned batches into one file per page and prepare pages for review or OCR. It works in backends and serverless functions that never write files to disk.

To keep only some pages, use the Split PDF by Page Range API instead. Before splitting, the Rotate PDF from URL API can fix sideways pages. After splitting, the Extract PDF Content API reads the text of each page.

AI agents can call it through ApyHub MCP.

POST
Split PDF into pages
https://api.eu.apyhub.com/sarvasoft/split-pdf-into-single-pages/pdf/split

QUICKSTART

GUIDE

Quickstart

Split a PDF into single pages and get each page back as base64 in JSON.

curl -X POST "https://api.eu.apyhub.com/sarvasoft/split-pdf-into-single-pages/pdf/split" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"pdf_url":"https://assets.apyhub.com/samples/sample.pdf","response_mode":"json"}'

What you'll get back

Returns a JSON object with the page count and one base64 entry per page.

{
  "page_count": 2,
  "pages": {
    "page_1.pdf": "JVBERi0xLjMKJb/3ov4KMSAwIG9iago8PCAvUGFnZXMgMiAwIFI...",
    "page_2.pdf": "JVBERi0xLjMKJb/3ov4KMSAwIG9iago8PCAvUGFnZXMgMiAwIFI..."
  }
}
TRY ITLIVE · 15 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*
body*

About this endpoint

What it does

Splits a PDF into single pages and returns each page as its own PDF. Send the PDF as a public URL or base64 in a JSON body, and choose how the pages come back.

Request Body

ParameterTypeDescription
pdf_urlStringRequired if pdf_base64 is not set. Public URL of the PDF to split. Must be http or https. Max length 2083 characters. Provide exactly one of pdf_url or pdf_base64.
pdf_base64StringRequired if pdf_url is not set. Base64-encoded PDF to split.
filenameStringName prefix for the page files. Max length 255 characters. Default: page.
response_modeStringHow the pages are returned. Allowed values: binary, base64, json, url. Default: binary.
output_modeStringLegacy container option for older clients. Allowed values: zip, array. Default: zip. Use response_mode instead.

Response

Returns the pages in the shape set by response_mode. In json mode, returns a JSON object with the page count and one entry per page.

ParameterTypeDescription
page_countIntegerNumber of pages produced.
pagesObjectMap of page file name to the base64-encoded single-page PDF.

Notes

  • Provide exactly one of pdf_url or pdf_base64.
  • Every page is returned. There is no page range option.
  • binary returns a file, not JSON. base64 returns only pages. url returns a files array with page, name, file_url, expires_at and expires_in_seconds for each page. The links need no authentication and stop working after they expire.
  • The request body must be under 5 MB. Larger bodies return 413.
  • A password-protected PDF returns 422.
  • pdf_url must be a public address.
▣ 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.