PDF Text Extractor & Scraper: PDF to Text for AI and RAG avatar

PDF Text Extractor & Scraper: PDF to Text for AI and RAG

Pricing

Pay per event

Go to Apify Store
PDF Text Extractor & Scraper: PDF to Text for AI and RAG

PDF Text Extractor & Scraper: PDF to Text for AI and RAG

PDF text extractor and PDF scraper: extract text from PDF URLs in bulk. Full document text, optional per-page text, page count, word count and document info. Fast, no browser. Text-layer PDFs only (no OCR). For RAG, LLM pipelines and search indexing. $2 per 1,000 PDFs. Plus $0.00005 start.

Pricing

Pay per event

Rating

0.0

(0)

Developer

fecklesspleb

fecklesspleb

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

12 days ago

Last modified

Features

Limited permissions

Share

PDF Text Extractor

Turn public PDF URLs into clean text, with optional OCR for scanned pages. For each PDF you get the full document text, optional per-page text, page count, word count, PDF version and document info (title, subject, keywords, producer, dates). Fast HTTP download and parsing, no browser. Built for RAG, LLM pipelines, search indexing and document analysis.

At a glance: $2.00 per 1,000 PDFs, plus $0.00005 per run start. Optional OCR for scanned pages: $0.002 per OCR-ed page. Pay per result with no subscription, set a maximum cost per run, export to JSON, CSV or Excel, or call it from the Apify API, Make, Zapier or n8n.

Features

  • Bulk: paste hundreds of PDF URLs, processed in parallel.
  • Per-page text (includePages) for citations and chunking.
  • maxPagesPerPdf and maxCharacters to control output size.
  • Clear error rows for broken links, non-PDF files, password-protected files and oversized files.
  • hasTextLayer tells you when a PDF is a scanned image.
  • Optional OCR (ocrMode, off by default): reads scanned pages with Tesseract OCR in 8 languages, only where the text layer is missing (auto) or on every page (always).
  • Respects robots.txt.

Input

{
"pdfUrls": [{"url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf"}],
"includePages": true,
"maxPagesPerPdf": 0
}

Output example

{
"url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf",
"finalUrl": "https://www.irs.gov/pub/irs-pdf/fw9.pdf",
"statusCode": 200,
"fileSizeBytes": 140815,
"pageCount": 6,
"pagesExtracted": 6,
"wordCount": 6279,
"hasTextLayer": true,
"pdfVersion": "1.7",
"documentInfo": {"title": "Form W-9 (Rev. March 2024)", "subject": "Request for Taxpayer Identification Number and Certification"},
"text": "Form W-9\n(Rev. March 2024)\nRequest for Taxpayer\nIdentification Number and Certification ...",
"pages": [{"pageNumber": 1, "text": "..."}],
"error": null
}

OCR for scanned PDFs (optional)

OCR is off by default; with it off the Actor works and costs exactly as before. Turn it on with ocrMode:

InputDefaultWhat it does
ocrModeoffauto: OCR pages whose text layer has fewer than ocrMinChars non-space characters. always: OCR every extracted page.
ocrLanguages["eng"]Any of eng, deu, fra, spa, ita, por, nld, pol.
ocrMaxPagesPerPdf10At most this many pages of each PDF are OCR-ed (1-500).
ocrMinChars20The auto threshold (0-100000).
ocrDpi200Render resolution (72-400).

With OCR on, each row also has ocrPages (page numbers), ocrPageCount, ocrPagesSkipped (over the page cap or the cost limit), ocrMeanConfidence (0-100), textSource (text-layer, ocr or mixed) and ocrError. With includePages, every page has textSource too. hasTextLayer still describes the PDF's own text layer.

Example from a real local run ({"ocrMode": "auto", "includePages": true} on a one-page scanned letter; the file was served locally, so the URL is a placeholder and documentInfo is left out):

{
"url": "https://example.com/scan.pdf",
"pageCount": 1,
"pagesExtracted": 1,
"text": "SCANNED LETTER\n\nThe meeting moved to Thursday at 10:00.\nPlease bring the signed form.",
"characterCount": 85,
"wordCount": 14,
"hasTextLayer": false,
"pages": [{"pageNumber": 1, "text": "SCANNED LETTER\n\nThe meeting moved to Thursday at 10:00.\nPlease bring the signed form.", "textSource": "ocr"}],
"ocrMode": "auto",
"ocrLanguages": ["eng"],
"ocrPages": [1],
"ocrPageCount": 1,
"ocrPagesSkipped": 0,
"ocrMeanConfidence": 96.4,
"textSource": "ocr",
"ocrError": null,
"error": null
}

OCR quality depends on the scan. Clean printed text at 200-300 DPI reads well; handwriting, photos of pages and complex layouts do not.

Pricing

Pay per result: $2.00 per 1,000 PDFs ($0.002 per PDF), any page count up to the size limit. Plus the standard Apify run start event of $0.00005 per run (the default Apify recommends). Turn off includeFailedUrls to pay only for PDFs that were read. Set Maximum cost per run and the Actor stops cleanly when it is reached.

OCR: $0.002 per OCR-ed page (ocr-page event), on top of the per-PDF price, only when ocrMode is on and only for pages actually OCR-ed. With a maximum cost per run, OCR pages are only started when the PDF's own row can still be paid for, so you are never charged for OCR whose result is not delivered.

Limits

  • With OCR off (the default), text layer only: scanned PDFs return empty text with hasTextLayer: false. Turn on ocrMode to read them.
  • OCR: at most ocrMaxPagesPerPdf pages per PDF; 8 languages; printed text only; tables and columns come out as reading-order lines.
  • Layout (tables, columns) is flattened to reading-order text.
  • Author and creator names from the document info are not returned.
  • On the Apify platform, PDF URLs whose address is private, loopback or link-local (also after a redirect) are not fetched. Their row is free: error: "not fetched: private, loopback and link-local addresses are not allowed".

The Actor downloads files that are publicly linked, obeys robots.txt and never logs in. Respect the copyright and terms of the documents you process.

FAQ

Can I call it from code or an AI agent? Yes, through the Apify API, the Apify clients, or Apify's MCP server.

What happens with invalid input? If the input is not a JSON object, or a field has the wrong type (for example a number where a list of URLs is expected, or "abc" for a number), the run fetches nothing and ends with one free status row: Invalid input, nothing was fetched and no results were charged: <reason>. No results are charged for it; the standard Apify start event still applies.

Can it read local files? Upload them to any public URL (for example an Apify key-value store record) and pass that URL.