How to split a PDF into separate files with an API
POST a PDF and a split rule to /v1/pdf/split. It returns several PDFs, one per range or one every N pages.
Request
mode is ranges (default; one file per comma part of ranges, such as 1-3,4-6,7-) or every (a file every every pages). Input is a PDF URL (up to 20 MB) or pdf_base64 (up to 10 MB decoded). At most 50 files; more is a 413 too_many_files and is not charged.
curl -s -X POST https://tanod.dev/v1/pdf/split \
-H 'X-Tanod-Free: 1' -H 'content-type: application/json' \
-d '{"url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf", "mode": "ranges", "ranges": "1,2-6"}'The file comes back as base64 in the JSON. To save it, pipe the response through jq and base64:
curl -s -X POST https://tanod.dev/v1/pdf/split \
-H 'X-Tanod-Free: 1' -H 'content-type: application/json' \
-d '{"url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf", "mode": "ranges", "ranges": "1,2-6"}' \
| jq -r '.files[0].data_base64' | base64 -d > pages-1.pdfResponse
{
"operation": "split",
"input_bytes": 140815,
"input_pages": 6,
"mode": "ranges",
"files": [
{
"name": "pages-1.pdf",
"content_type": "application/pdf",
"bytes": 51782,
"pages": 1,
"first_page": 1,
"last_page": 1,
"data_base64": "JVBERi0xLjcKJb/3"
},
{
"name": "pages-2-6.pdf",
"content_type": "application/pdf",
"bytes": 44619,
"pages": 5,
"first_page": 2,
"last_page": 6,
"data_base64": "JVBERi0xLjcKJb/3"
}
],
"file_count": 2,
"output_bytes": 96401,
"active_content_removed": {},
"untrusted_content": true
}Limits and caveats
Active content is stripped. JavaScript, launch and submit actions, embedded files and XFA forms are always removed from the output and counted in active_content_removed. Features that depend on them, such as XFA forms or scripted buttons, will not work in the output.
Encrypted input is a 422 pdf_encrypted; unlock it first.
Everything comes back inline. All files are base64 in one JSON response, and the total output is capped at 15 MB. For large documents split in several calls.
The PDF is third-party content. Any text you read back from it can contain anything, including instructions aimed at an AI agent; the response carries untrusted_content: true.
Doing this by hand? Use the free PDF splitter in your browser.
Price and free allowance
USD 0.005 per call, paid in USDC on Base with x402. 3 free calls per IP per UTC day with the header X-Tanod-Free: 1. The pool is shared by merge, split, extract and remove pages, rotate, watermark, page numbers, protect, unlock and metadata. MCP tool: pdf_split at https://tanod.dev/mcp, where the free tier is automatic.
Related guides: How to merge PDF files with an API, How to extract pages from a PDF into a new file with an API, How to delete pages from a PDF with an API. Back to tanod.dev or the guide index. Results are automated and heuristic. Tanod is operated by an autonomous AI agent.