PDF Citation Chunker avatar

PDF Citation Chunker

Pricing

from $0.22 / 1,000 pdf pages

Go to Apify Store
PDF Citation Chunker

PDF Citation Chunker

Deterministically convert public embedded-text PDFs into page-aware, citation-ready JSON chunks with provenance, SHA-256 stable IDs, and RAG-ready output for API, MCP, and AI-agent workflows.

Pricing

from $0.22 / 1,000 pdf pages

Rating

0.0

(0)

Developer

Dakota Myers

Dakota Myers

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

4 days ago

Last modified

Share

Convert public PDF documents into clean, page-aware, citation-ready JSON chunks for AI agents, RAG pipelines, search systems, APIs, and automated document workflows.

PDF Citation Chunker downloads one or more public PDFs, extracts embedded text page by page, normalizes the content, divides it into configurable overlapping chunks, and returns structured records that preserve source provenance.

Machine contract

INPUT: Public HTTP(S) embedded-text PDF URL or batch of URLs.

OUTPUT: Deterministic, page-aware, citation-ready JSON chunks with stable document/chunk IDs, SHA-256 hashes, and provenance.

USE WHEN: Preparing embedded-text PDFs for RAG, retrieval, vector ingestion, citation-grounded AI, APIs, MCP, or other machine processing.

DO NOT USE WHEN: The PDF is scanned or image-only and requires OCR.

FAILURE MODEL: One bad PDF does not destroy useful output from the rest of a batch.

CURRENT BILLING: Pay Per Event. The current published configuration is $0.25 per 1,000 successfully processed text pages plus an Actor start event of $0.00005. page-processed is charged only after useful text output; empty/no-text pages are not charged. Check the Actor Pricing section before running because published rates can change.

What it does

For every extracted chunk, the Actor returns:

  • Original PDF URL
  • Resolved PDF URL after redirects
  • Downloaded PDF byte size
  • PDF-byte SHA-256 and stable document ID
  • Document position within the batch
  • Document title
  • Source PDF page
  • Document-wide chunk index
  • Page-local chunk index
  • Normalized text
  • Character count
  • Estimated token count
  • SHA-256 content hash
  • Stable chunk ID and chunking configuration
  • Extraction method
  • Processing timestamp

The result is structured for machine consumption rather than manual copy-and-paste.

Typical uses include:

  • Retrieval-Augmented Generation (RAG)
  • Vector database ingestion
  • AI-agent document analysis
  • Citation-aware retrieval
  • Search indexing
  • Document pipelines
  • Knowledge-base ingestion
  • Archival and research workflows
  • MCP and API-based automation

Input

Single PDF

{
"url": "https://example.com/document.pdf",
"chunkSize": 3000,
"overlap": 300
}

Multiple PDFs

Up to 25 PDFs can be submitted in a single run:

{
"urls": [
"https://example.com/document-1.pdf",
"https://example.com/document-2.pdf"
],
"chunkSize": 3000,
"overlap": 300
}

You may use either url, urls, or both.

Duplicate URLs are automatically removed while preserving their original order.

Chunking

chunkSize controls the approximate maximum number of characters in each output chunk.

Default:

3000 characters

Allowed range:

500 - 20000

overlap controls how much text is carried from one chunk into the next.

Default:

300 characters

Overlap helps preserve context across chunk boundaries when the output is used for embeddings, retrieval, or language-model processing.

Chunks remain page-aware. PDF page provenance is preserved for every result.

Output

Each chunk is stored as a structured dataset record.

Example:

{
"sourceUrl": "https://example.com/document.pdf",
"resolvedUrl": "https://cdn.example.com/document.pdf",
"sourceByteSize": 482193,
"documentSha256": "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789",
"documentId": "sha256:abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789",
"documentIndex": 1,
"documentTitle": "Example Document",
"pageStart": 4,
"pageEnd": 4,
"chunkIndex": 7,
"pageChunkIndex": 2,
"chunkId": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"chunking": {
"chunkSize": 3000,
"overlap": 300
},
"text": "Extracted document text...",
"characterCount": 2874,
"estimatedTokens": 719,
"sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"extractionMethod": "pypdf",
"processedAt": "2026-08-25T00:00:00+00:00"
}

Run summary

Each run also generates a machine-readable SUMMARY record containing:

  • Submitted document count
  • Completed document count
  • Successful document count
  • Failed document count
  • Total pages extracted
  • Total chunks produced
  • Chunk-size setting
  • Overlap setting
  • Overall run status
  • Per-document outcomes (inputUrl, status, pagesProcessed, chunksProduced, and an unsuccessful reason when applicable)
  • URLs not processed because a spending limit stopped the batch
  • Processing timestamp

Example:

{
"submittedDocuments": 3,
"completedDocuments": 3,
"successfulDocuments": 2,
"failedDocuments": 1,
"totalPages": 49,
"totalChunks": 121,
"chunkSize": 1200,
"overlap": 150,
"status": "partial_success",
"documentOutcomes": [
{
"inputUrl": "https://example.com/valid.pdf",
"status": "success",
"pagesProcessed": 49,
"chunksProduced": 121
},
{
"inputUrl": "https://example.com/scanned.pdf",
"status": "failed",
"reason": "no_extractable_text",
"pagesProcessed": 0,
"chunksProduced": 0
}
],
"unprocessedUrls": [],
"processedAt": "2026-08-25T00:00:00+00:00"
}

Partial failure handling

One bad PDF does not automatically destroy an entire batch.

If a document:

  • Returns an HTTP error
  • Is inaccessible
  • Is malformed
  • Is not actually a PDF
  • Cannot be processed

the Actor records a machine-readable document outcome and continues with the remaining documents.

A batch is success only when every submitted document produces useful chunks. It is partial_success when useful output survives one or more failed documents, and failed when no document produces useful chunks.

If a user spending limit stops the batch, the summary status is spending_limit_reached. It includes completed document outcomes and unprocessedUrls for the URLs skipped because of that limit.

This makes the Actor suitable for autonomous pipelines where partial results are more useful than losing an entire batch because of one invalid source.

PDF limitations

The current version extracts embedded PDF text.

Image-only or scanned PDFs without an embedded text layer produce a failed document outcome with reason no_extractable_text; they are not counted as successfully processed.

OCR is not currently performed.

Other current limitations:

  • Maximum PDF size: 50 MB per document
  • Maximum batch size: 25 PDFs
  • Password-protected PDFs may fail
  • Corrupted PDFs may fail
  • Private URLs requiring unsupported authentication may fail

OCR and additional document formats may be added in future versions.

Integrity metadata

Every chunk includes a SHA-256 hash calculated from the exact normalized chunk text.

documentSha256 is the SHA-256 digest of the original downloaded PDF bytes. documentId is sha256:<documentSha256>, so it is stable for the same PDF regardless of input order or processing time.

chunkId is a SHA-256 digest of a canonical JSON object containing the version string pdf-citation-chunker:chunk:v1, documentSha256, page number, page-local chunk index, chunk text SHA-256, chunkSize, and overlap. It is stable for the same emitted chunk and changes when its document, page-local position, content, or chunking configuration changes.

sourceUrl preserves the submitted URL; resolvedUrl records the final HTTP response URL after redirects when available; sourceByteSize records downloaded PDF bytes; and chunking records the chunkSize and overlap used for that record. Together these fields support provenance, deduplication, and idempotent ingestion without relying on batch order or timestamps.

This allows downstream systems to:

  • Detect duplicate chunks
  • Verify content stability
  • Build deterministic caches
  • Track document changes
  • Identify repeated data across runs

Token estimates

Each result includes an approximate token count.

The estimate is intended for planning downstream LLM and embedding workloads. It is not tied to any specific model tokenizer and should not be treated as an exact billing value.

API and automation

Because PDF Citation Chunker runs as an Apify Actor, it can be invoked through:

  • Apify Console
  • Apify API
  • Other Actors
  • Automated workflows
  • Schedules
  • Webhooks
  • External applications
  • Agentic workflows
  • Machine-to-machine systems

The resulting citation chunks are stored in the default Apify dataset and can be retrieved programmatically.

For AI agents and MCP

Contract: public embedded-text PDF URL → deterministic, page-aware citation-ready JSON chunks.

Use this Actor for PDF chunking, RAG ingestion, citation chunks, page provenance, and stable RAG chunk IDs. For scans or image-only PDFs, use OCR Citation Chunker instead.

Designed for machine consumption

The Actor intentionally favors predictable JSON over human-oriented document formatting.

A typical pipeline may look like:

PDF URL
PDF Citation Chunker
page-aware JSON chunks
embedding model
vector database
RAG / AI agent / search system

The Actor can also be used as a preprocessing primitive inside larger automated systems.

Privacy and responsible use

Only process documents you are authorized to access and process.

The Actor operates on URLs provided as run input and stores extracted results in the run's Apify storage.

Avoid submitting confidential or sensitive documents unless your Apify environment and intended workflow are appropriate for that data.

Current capabilities

Version 0.1.x includes:

  • Single-PDF processing
  • Multi-PDF batch processing
  • Up to 25 PDFs per run
  • Embedded-text extraction
  • Page-aware chunking
  • Configurable chunk size
  • Configurable chunk overlap
  • PDF provenance metadata
  • SHA-256 chunk hashes
  • Estimated token counts
  • Partial-failure isolation
  • Machine-readable run summaries
  • Pay-per-event billing support
  • Spending-limit awareness
  • API-ready structured output

Output philosophy

PDF Citation Chunker does one job:

Turn a PDF into predictable, provenance-preserving chunks that another machine can immediately use.

No AI-generated summaries are inserted into the document.

No interpretation is performed.

No source text is intentionally rewritten.

The Actor focuses on creating a reliable document-processing primitive that can be composed with other systems.