Extract text from PDFs for LLMs and RAG
A lot of the useful information on the web is locked in PDFs: annual reports, tender documents, research papers, product manuals, price lists. Language models can't read a PDF link directly, and copying text out by hand doesn't scale past a handful of files.
What you get
PDF to Text downloads each PDF and returns its text, plus pageCount, title, subject, language, createdAt and modifiedAt. Turn on per-page text to get a pages list (handy when an answer needs to cite a page number), or set a chunk size to get chunks that go straight into an embedding step.
Steps
- Paste the PDF links, e.g. a set of annual reports or tender documents.
- Optional: set Chunk size for RAG (around 1,000 to 2,000 characters works for most embedding models) and Max characters per PDF to fit a model's context window.
- Run, then export JSON or pull it from the API.
curl -X POST "https://api.apify.com/v2/acts/datasetworks~pdf-to-text/run-sync-get-dataset-items?token=YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"startUrls": [{"url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf"}], "chunkSize": 1500}'
Use it from an AI agent
The tool is available through Apify's MCP server, so an agent in Claude, Cursor or any MCP client can read a PDF it finds while researching. For HTML pages, use Web to Text instead.
What it can't do
It reads the text layer inside the PDF. Scanned, image-only PDFs come back with hasTextLayer: false (OCR isn't included), and password-protected files are skipped and not charged. It follows each site's robots.txt and never logs in.
Cost: $3 per 1,000 PDFs, any number of pages, no start fee.