PDF to Text & Markdown Extractor with Page Hashes avatar

PDF to Text & Markdown Extractor with Page Hashes

Pricing

from $1.33 / 1,000 pdf page processeds

Go to Apify Store
PDF to Text & Markdown Extractor with Page Hashes

PDF to Text & Markdown Extractor with Page Hashes

Extracts clean text and Markdown from 1 to 5 public PDF URLs, page by page, with deterministic SHA-256 page hashes and batch manifests. Automatic contact scrubbing protects privacy. Deterministic extraction designed for document ingestion and LLM embedding pipelines.

Pricing

from $1.33 / 1,000 pdf page processeds

Rating

0.0

(0)

Developer

PlainKit bin

PlainKit bin

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

3 days ago

Last modified

Features

Limited permissions

Share

Introduction

This Actor takes public PDF URLs and returns the text and Markdown of each page, with SHA-256 hashes for each page and for the whole document. Operating as a deterministic extractor, it downloads public PDF documents from web URLs, extracts page text using pypdf, converts each page into clean Markdown, and computes deterministic SHA-256 hashes for each page and the overall document manifest from the normalized, scrubbed text and Markdown.

Scanned or image-only PDFs give empty text for their pages, because this Actor has no OCR.

Use cases

  • Document ingestion pipelines: Convert technical manuals, legal filings, and whitepapers into structured page-by-page Markdown for LLM embedding.
  • Pipeline change tracking: Track deterministic SHA-256 page hashes of normalized, scrubbed text and Markdown across batch runs to identify identical extracted pages.
  • Batch text extraction: Extract clean text from multiple public PDF URLs with bounded page, memory, and timeout limits.

Tutorial

Step-by-step guide

  1. Prepare a JSON input object containing pdf_urls with 1 to 5 public HTTP or HTTPS PDF links.
  2. Run the Actor on the Apify platform or start a run via the Apify API.
  3. The Actor verifies robots.txt compliance, downloads the PDF files within size limits, parses text page-by-page, scrubs contact details, and computes hashes.
  4. Export the resulting batch summary, page Markdown, and integrity manifests in JSON, CSV, or Excel format.

Pricing

The Actor is priced per extracted page under the Pay-Per-Event model using the pdf-page event.

Usage tierPrice per pdf-page event
FREE$0.002
BRONZE$0.0018
SILVER$0.0016
GOLD, PLATINUM, DIAMOND$0.001333

Charge contract

Each row is pushed first and charged right after a successful push; a refused charge stops work and that row stays delivered and uncharged; a reached limit stops work after that row was charged; failed items are neither pushed nor charged. Documents blocked by robots.txt, download failures, or malformed PDF streams produce no billable page items and are not charged.

  • Restarted runs: Pages already in the dataset of a restarted run are skipped and not charged again; the run reads the dataset first, and if it cannot be read or a row is malformed, the run fails with DATASET_READ_FAILED before any new row or charge. On restarted runs, skipped pages are excluded from the summary manifest, which covers only newly delivered pages. The restart tests prove that a rerun on a dataset holding pages 1 and 2 of a 3-page document pushes and charges only page 3 (RESTART_NO_DOUBLE_CHARGE=PASS), and that a raising read, a non-list documents, a malformed page row, a non-object row, or a non-object page entry each end the run as failed with no push, no charge and no fetch (DATASET_READ_FAIL_STOPS=PASS).
  • Largest bill: For the largest input the limits allow, 5 documents of 200 pages each (1,000 pages), the bill is $2.00 at the FREE price ($0.002 per page) and $1.333 at the GOLD, PLATINUM or DIAMOND price ($0.001333 per page). The byte limits can make this input unreachable, so it is an upper bound.

Operational limits

  • Accepts 1 to 5 PDF document URLs per run (pdf_urls).
  • Document size is capped at 25,000,000 bytes per document and 50,000,000 bytes across the run.
  • Up to 200 pages per document; maximum 2,000,000 extracted text characters per page.
  • URL length is limited to 2,048 characters with .pdf suffix required.
  • Requests have a 20-second socket timeout and follow at most 5 redirects.
  • Evaluates robots.txt rules before fetching; disallowed documents are skipped safely.

Input and output examples

Input example

{
"pdf_urls": [
"https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
]
}

Output example

{
"status": "SUCCESS",
"documents": [
{
"source_id": "3d7d1b17f7597eedac3f418a",
"source_kind": "pdf_url",
"status": "SUCCESS",
"pages": [
{
"page": 1,
"text": "Dummy PDF file",
"markdown": "# Page 1\n\nDummy PDF file\n",
"text_sha256": "4a75ab26b9047bbb1e89e8c47545aa668a01a3186e8ed8e629518c3aab6576d9",
"markdown_sha256": "4fe62875fdd288a552d83dfda89bdfcb84774cea3d8b808237c7b5a35cf25fb0",
"page_sha256": "c90d847510847ac327f52ec66360e7ad0a41bbe58c689bf3d8b0f75394548755"
}
],
"limit_reached": false,
"integrity": {
"page_hashes": [
"c90d847510847ac327f52ec66360e7ad0a41bbe58c689bf3d8b0f75394548755"
],
"manifest_sha256": "62937d4d23c019f65b55871066286bd48f898d28a006f801cae8bbc2de77389c"
}
}
],
"total_bytes": 13264,
"integrity": {
"document_manifests": [
"62937d4d23c019f65b55871066286bd48f898d28a006f801cae8bbc2de77389c"
],
"manifest_sha256": "98b620bc678c7cd8d89fe8b80414e120e0f7521c643c61a7ccd21fef19a9d11b"
}
}

Output fields

FieldTypeDescription
statusStringOverall batch execution status code (SUCCESS)
documentsArrayArray of document result objects
documents[].pagesArrayArray of extracted page objects with text and Markdown
documents[].pages[].pageInteger1-based page number within the document
documents[].pages[].source_idStringSource identity; with page, it is the key of one page for restarted runs. Each page is also pushed on its own as a row with source_id and page before it is charged
documents[].pages[].markdownStringFormatted Markdown text of the page
documents[].pages[].page_sha256StringSHA-256 hash computed from page number, scrubbed text hash, and scrubbed markdown hash
documents[].integrity.manifest_sha256StringSHA-256 hash of page hashes delivered in this run for the document
total_bytesIntegerTotal bytes processed across all documents
integrity.manifest_sha256StringMaster SHA-256 hash across document manifests delivered in this run

Actor recommendations

Pair this Actor with:

  • CSV and JSON Integrity Parser: Validate tabular data and compare integrity manifests alongside PDF data.
  • Inline HTML and Markdown to Clean Markdown: Clean and normalize extracted PDF markdown for downstream publishers.
  • Readable Article Extractor: When source content is available as HTML web articles rather than static PDF files.

FAQ and support

Does the Actor perform OCR on scanned PDF pages?

No. The Actor extracts digital text streams directly using pypdf. Image-only or scanned PDFs produce empty text for those pages.

How does the Actor ensure data privacy?

Contact information (including email addresses and phone numbers) in extracted text is scrubbed and replaced with [email removed] and [phone removed]. Page hashes (text_sha256, markdown_sha256, page_sha256) are computed after contact scrubbing and text normalization.

Are failed pages charged?

No. A timeout, robots disallow, or extraction failure leaves that page unpushed and uncharged.

Support and inquiries

For technical support, questions, or issues, submit a ticket in the Apify Console.

⌂ 换网址