PDF to Text API — Extract PDF Text to Clean JSON for LLM & RAG
Pricing
from $1.44 / 1,000 pdf page extracteds
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
Maintained by CommunityActor 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
textstraight into your chunking/embedding step;pageandpdfUrlgive 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
| Field | Description |
|---|---|
text | Clean page text — de-hyphenated, whitespace-normalized |
page | Page number (1-based) |
pageCount | Total pages in the document |
charCount | Characters extracted on the page |
pdfUrl | Source PDF URL |
ok, scrapedAt | Status & 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.