Tools
PDF to chunks API
Submit any PDF. Get back structured text chunks with page numbers, ready for RAG pipelines and search indexing.
Try it below:
Split PDFs into searchable text chunks
Upload a PDF or submit a URL, get structured text chunks back.
What is Exabase's PDF to chunks API?
Submit a PDF to the Exabase Extract API and get the text content back as structured chunks. Each chunk has a sequence number, the extracted text, and the page number it came from. The chunks are sized for retrieval and search, not dumped as a single text blob.
This is the same POST /v2/extract endpoint used for all content types. Submit the PDF, poll for completion (or use a webhook), then fetch the chunks from GET /v2/extract/{jobId}/chunks. The API handles text extraction, chunking, and page mapping. No PDF parsing library on your end, no chunking logic to write, no page boundary detection.
What you get back
Each chunk carries three fields: sequence (its position in the document), text (the extracted content), and pageNumber (the page it came from). The extraction response also includes the total chunkCount, so you know how many chunks to page through. Alongside the chunks, the job response includes document metadata (page count, author, title, creation date), a CDN-hosted thumbnail, and a rendered PDF. The API reference has the complete response schema.
One multi-modal API
The same POST /v2/extract endpoint handles every content type Exabase supports. For PDFs, it returns text chunks with page numbers. For audio and video, chunks carry timestamps instead of page numbers. For images, it runs OCR and returns the text as chunks. For web pages, it renders JavaScript and extracts the content as chunks.
The submission flow is identical across all types: one endpoint, one SDK method, one webhook configuration. You learn the pattern once and use it for everything. The Extract docs cover each content type in detail.
What you can build with it
The chunks are the right shape for retrieval-augmented generation. Feed them into your RAG pipeline and cite the page number when your agent uses a chunk. Build a document Q&A system where users ask questions and get answers grounded in specific pages of specific documents. Index a library of PDFs and make every paragraph searchable.
Store the chunks as Resources in a Base and they become searchable through Deep Search at the paragraph level. Workers can re-extract updated documents on a schedule, keeping your search index current without manual work.
Beyond chunking
The Extract API returns more than text chunks. You get document metadata, a CDN-hosted thumbnail, a rendered PDF, and (for invoices, contracts, and resumes) structured field extraction. Store the output as a Resource and it's searchable through Deep Search immediately. The Submitting Jobs guide at https://exabase.io/docs/developer-guide/extraction/submitting-jobs walks through the full flow.
How do I use it?
Get your API key
Free, no credit card:
Sign up at exabase.io and copy your API key from the dashboard.
Submit a PDF
Using the SDK (Node.js):
Get the chunks
Poll the job until state reaches completed, then fetch the chunks.
One API call to extract. One call to fetch chunks. No PDF library, no chunking logic.
Why Exabase
Comparisons
Works with other Exabase features
Use cases
FAQs
What is Exabase?
Exabase is infrastructure for AI agents. It gives your agents memory, versioned file storage, AI deep search, and context automation through a set of APIs. Store what your agent learns, search inside any content type, and keep knowledge bases current automatically. Built for production use. Give your agent precise context and cut your token spend by up to 81%.
Who uses Exabase?
Developers and teams building AI agents, copilots, and RAG applications. If your agent needs to remember things between sessions, store and retrieve files, search across documents and media, or stay up to date without manual maintenance, Exabase handles that infrastructure so you can focus on your product.
How are chunks sized?
The API handles chunk sizing automatically. Chunks are sized for retrieval and search, not raw page splits. The exact size depends on the document content and structure.
Do chunks respect page boundaries?
Each chunk includes a pageNumber field indicating which page the text came from. Chunks generally respect structural boundaries in the document rather than splitting mid-sentence.
Does it handle scanned PDFs?
Yes. OCR is built in. Submit a scanned PDF the same way you'd submit a digital one. The API detects the content type and processes accordingly.
Can I control the chunk size?
The API uses automatic chunk sizing optimised for retrieval use cases. Custom chunk sizes are not currently configurable.
How do I page through chunks?
Use the start and end query parameters on GET /v2/extract/{jobId}/chunks. The chunkCount field on the extraction response tells you the total.
Can I submit a URL instead of uploading a file?
Yes. Pass a url field in the JSON request body pointing to a publicly accessible PDF. Exabase fetches and processes it.
Do I have to poll for results?
No. You can configure a webhook URL and Exabase will POST the full result to your server when processing completes. The webhooks guide covers setup.
What happens if extraction fails?
The job state moves to failed. You can call the reprocess endpoint to retry without re-uploading the original file.
How long are files retained?
Stored files are retained for 1 day from job creation, then permanently deleted. Download or copy anything you need before the retention window expires.
How is this different from the PDF to JSON tool?
The PDF to JSON page covers the full extraction response: metadata, thumbnails, document properties, and structured data. PDF to Chunks focuses specifically on the text chunk output for RAG and search use cases. Same underlying API, different emphasis.
Can I chunk content types other than PDFs?
Yes. The same POST /v2/extract endpoint returns chunks for images (OCR text), audio (transcript with timestamps), video (transcript with timestamps), and web pages. See the Audio to JSON, Video to JSON, Image to JSON, and Website to JSON tool pages.
Is there an SDK?
Yes. The @exabase/sdk package for Node.js/TypeScript handles file streaming, job polling, and chunk retrieval. Install with npm install @exabase/sdk.