Website & PDF to RAG Chunks avatar

Website & PDF to RAG Chunks

Pricing

from $2.00 / 1,000 pages processed

Go to Apify Store
Website & PDF to RAG Chunks

Website & PDF to RAG Chunks

Crawl any website (JavaScript too) or PDF (scanned too) and get clean, heading-aware chunks ready for embeddings and vector databases (Pinecone, Qdrant, Weaviate, pgvector, LangChain, LlamaIndex).

Pricing

from $2.00 / 1,000 pages processed

Rating

0.0

(0)

Developer

Khushbu Shukla

Khushbu Shukla

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

2 hours ago

Last modified

Categories

Features

Limited permissions

Share

Turn any website (including JavaScript apps) or PDF (including scanned documents) into clean, ready-to-embed chunks for your AI chatbot, RAG pipeline or vector database. No HTML noise, no cookie banners, no navigation menus. You get the real content, split along its headings, with the metadata your retriever needs.

What does it do?

  1. Crawls a website (using its links and sitemap.xml) or downloads PDF files you link directly.
    • JavaScript sites (React, Vue, Angular, Next.js apps): pages that come back empty or blocked are automatically re-opened in a real Chrome browser. Simple pages stay fast and cheap.
    • Scanned PDFs: pages without a text layer are read with OCR in 16 languages.
    • PDF tables are rebuilt as real Markdown tables, both gridded tables and academic tables that only use horizontal rules. Tables too big for one chunk are split by rows, with the header repeated in every piece.
    • PDF headings are found from numbering ("3.2 Attention"), font size and bold type, so every chunk knows its section. Two-column pages are read column by column, and sideways margin stamps are removed.
  2. Extracts only the main content: navigation, footers, sidebars, cookie banners, share buttons and scripts are removed. Headings, lists, tables and code blocks are kept as Markdown.
  3. Chunks the text along headings, so a chunk never mixes two unrelated sections. Paragraphs, tables and code blocks are not cut in half.
  4. Adds context to every chunk (Page title > Section > Subsection), which noticeably improves retrieval quality.
  5. Outputs records you can send straight to Pinecone, Qdrant, Weaviate, pgvector, Chroma, LangChain or LlamaIndex.

Why use it instead of a general web scraper?

General scrapersThis Actor
Removes menus, footers, cookie bannersSometimes✅
Splits by headings, not every N characters❌✅
Never cuts a table or code block in half❌✅
Section path + page title on every chunk❌✅
PDFs with page numbers on each chunk❌✅
PDF tables kept as tables, with headers on every piece❌✅
Screenshot of every PDF table, linked from its chunks❌✅
JavaScript sites, browser only when neededUsually all-or-nothing✅
OCR for scanned PDF pages only❌✅
Skips duplicate and near-empty pages (not charged)❌✅

Use cases

  • Customer support chatbots trained on your help center and docs
  • "Chat with the docs" for any library, API or product
  • Internal knowledge bases built from policy PDFs and manuals
  • AI agents that need fresh, structured web knowledge
  • Fine-tuning and evaluation datasets from clean web text

Input

The only required field is Start URLs: websites and/or direct links to PDF files.

FieldDefaultWhat it does
Start URLsWebsites to crawl or PDF links
Max pages100Total pages/PDFs to process
Max crawl depth3How far to follow links (0 = only start URLs)
Outputchunkschunks for vector DBs, documents for one Markdown record per page
Chunk size (tokens)500Target chunk size (≈4 characters per token)
Chunk overlap (tokens)50Shared context between neighbouring chunks
Only crawl / never crawl URLs matchingGlob filters, e.g. https://site.com/docs/**
Stay inside the start URL's sectionoffStart at /docs/guide to crawl only /docs/guide/...
Use sitemap.xmlonFaster, more complete discovery
JavaScript renderingAutoAuto = browser only when needed, Always, or Never
OCR for scanned PDFsAutoAuto = only pages without text, Always, or Off
OCR languagesEnglish16 languages, pick several for mixed documents
Max OCR pages per run500Safety cap on OCR work
Respect robots.txtonPolite crawling

Output

One record per chunk:

{
"id": "9f2c1e7a0b3d4c55-3",
"url": "https://docs.example.com/billing",
"title": "Billing",
"sourceType": "html",
"section": "Billing > Retries > Idempotency",
"chunkIndex": 3,
"chunkCount": 6,
"pageStart": null,
"pageEnd": null,
"text": "Use idempotency keys for safe retries...",
"textForEmbedding": "Billing > Retries > Idempotency\n\nUse idempotency keys for safe retries...",
"tokenEstimate": 412,
"language": "en",
"renderedWithBrowser": false,
"ocrPages": null,
"tableImages": [{ "page": 7, "imageUrl": "https://api.apify.com/v2/key-value-stores/…/records/table-…-p7-1.png" }],
"crawledAt": "2026-12-01T18:00:00+00:00"
}
  • Embed textForEmbedding and store text for display. That's the recommended pattern.
  • For PDFs, pageStart/pageEnd tell you which pages a chunk came from, so your chatbot can cite "page 12".
  • tableImages lists a PNG screenshot of every PDF table in the chunk (page, imageUrl). Show it next to answers, or pass it to a multimodal model when exact layout matters. Turn this off with Save a screenshot of every PDF table.
  • id is stable for the same content, so re-runs can upsert instead of duplicating.

A run summary (pages processed, skipped, errors) is saved in the key-value store under OUTPUT.

Pricing

You pay per page processed: one web page, or one PDF page, is one unit. Two small add-ons apply only when used:

  • JavaScript render: a page that needed a real browser
  • OCR page: a scanned PDF page read with OCR

Pages that are empty, duplicated, blocked or failed are not charged. In Auto mode you never pay for a browser or OCR on pages that don't need them. Set a maximum cost per run in Apify Console and the Actor stops cleanly when it is reached.

Integrations

  • LangChain / LlamaIndex: use the Apify dataset loader and map textForEmbedding to the page content.
  • Vector databases: connect the dataset to the Pinecone, Qdrant or other vector DB integrations in Apify Console, or call the Apify API from your code.
  • Schedules: run it daily or weekly to keep your chatbot's knowledge fresh.

FAQ

Does it render JavaScript-heavy sites? Yes. In Auto mode it first fetches each page over plain HTTP. If the page comes back nearly empty (a typical single-page app) or blocked (403/429), it opens the page in headless Chrome, waits for content, scrolls to load lazy content, and extracts the result. Links that only appear after rendering are followed too.

Can it read scanned PDFs? Yes. Pages without a text layer are rendered at 200 DPI and read with Tesseract OCR. Normal text pages in the same PDF are read directly, so mixed documents are handled correctly and you only pay OCR for the scanned pages. Each chunk's pageStart/pageEnd still points to the right page, and ocrPages on each record tells you how many pages needed OCR.

Does it handle logins or CAPTCHAs? No. It reads publicly accessible pages only.

Is it legal to crawl websites? The Actor respects robots.txt by default. Only crawl content you have the right to use, and check each site's terms.

Found a bug or need a feature? Open an issue on the Issues tab. Feedback shapes the roadmap.