PDF to Text API — Extract PDF Text to Clean JSON for LLM & RAG avatar

PDF to Text API — Extract PDF Text to Clean JSON for LLM & RAG

Pricing

from $1.44 / 1,000 pdf page extracteds

Go to Apify Store
PDF to Text API — Extract PDF Text to Clean JSON for LLM & RAG

PDF to Text API — Extract PDF Text to Clean JSON for LLM & RAG

Extract clean, structured text from any PDF by URL, page by page. Returns one row per page with de-hyphenated, whitespace-normalized text. Fast, no setup.

Pricing

from $1.44 / 1,000 pdf page extracteds

Rating

0.0

(0)

Developer

Marouane Oulabass

Marouane Oulabass

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

1

Monthly active users

15 days ago

Last modified

Categories

Share

Convert any PDF to clean, structured text by URL — one JSON row per page. Give this Actor one or many PDF links and get back de-hyphenated, whitespace-normalized text that's ready for LLMs, RAG pipelines, search indexes or your database. No OCR setup, no local tooling, no PDF libraries to install.

AI-agent ready: this Actor is callable and payable by AI agents via x402 (USDC on Base), no Apify account required.

How to extract text from a PDF by URL (no libraries)

Skip pdfminer, PyPDF and their edge cases: send a URL, get JSON. The Actor downloads each PDF, extracts the embedded text layer page by page, rejoins hyphenated line-breaks, normalizes whitespace and returns one clean row per page. Works on reports, invoices, research papers, contracts, manuals and ebooks.

How to prepare PDFs for LLMs, embeddings and RAG

Each page arrives as a separate, already-clean chunk — a natural unit for embedding:

  • RAG pipelines — feed the per-page text straight into your chunking/embedding step; page and pdfUrl give you citations for free.
  • LLM context — pull exactly the pages you need instead of pasting whole documents.
  • Search & indexing — make a PDF library full-text searchable with page-level hits.
  • Document processing — extract text from invoices, statements and forms at scale.

What you get — one clean row per page

FieldDescription
textClean page text — de-hyphenated, whitespace-normalized
pagePage number (1-based)
pageCountTotal pages in the document
charCountCharacters extracted on the page
pdfUrlSource PDF URL
ok, scrapedAtStatus & provenance

Example — PDF URL in, JSON out

Input

{ "pdfUrls": ["https://example.com/annual-report.pdf"], "maxPagesPerPdf": 50 }

Output (one item = one page)

{
"pdfUrl": "https://example.com/annual-report.pdf",
"page": 1,
"pageCount": 48,
"text": "Annual Report 2025. In this financial year the company delivered...",
"charCount": 2184,
"ok": true
}

Export the dataset as JSON, CSV, Excel or HTML, or pull it via the API into Google Sheets, a vector store or your app.

Why this PDF text extractor

  • Clean, usable text — hyphenated line-breaks rejoined, whitespace normalized; no post-processing needed.
  • 📑 Page-level granularity — one row per page keeps document structure and enables citations.
  • 🌐 Any PDF by URL — public reports, papers, statements, manuals; batch as many as you like.
  • Pay per page extracted — failed or empty pages are never billed.
  • 🤖 LLM-ready by design — each page is already a natural chunk for embeddings and RAG.

Input options

  • pdfUrls (required) — one or more PDF URLs (https:// added if missing).
  • maxPagesPerPdf — cap pages per PDF. Leave empty for all pages.

FAQ

How do I convert a PDF to text online via API? POST the Actor run with your pdfUrls (or use the Apify console), then read the dataset — one JSON row per page.

Does it work on scanned/image PDFs? It extracts embedded text layers (digital PDFs). Purely scanned image-only PDFs without a text layer won't yield text.

Can I process many PDFs in one run? Yes — pass a list of URLs; every row carries its pdfUrl and page, so results stay attributable.

How is the text cleaned? Hyphenated words split across line breaks are rejoined and whitespace is normalized for readable, model-friendly output.

Can I export to CSV, Excel or Google Sheets? Yes — one-click dataset export, or live via the API.

What does it cost? Pay-per-page — you're only charged for pages actually extracted.


Tip: feed the per-page text straight into your embedding pipeline — each page is already a natural chunk.