RAG Documentation Scraper — LLM-Ready Chunker
Pricing
from $3.50 / 1,000 results
RAG Documentation Scraper — LLM-Ready Chunker
Crawl any documentation site and output LLM-ready chunks in LangChain, LlamaIndex, Haystack, or JSONL format. Features heading-boundary chunking, SHA-256 dedup, DynamoDB delta tracking, and AWS Textract for scanned PDFs.
Pricing
from $3.50 / 1,000 results
Rating
0.0
(0)
Developer
LERNOWA AI LABS PRIVATE LIMITED
Maintained by CommunityActor stats
0
Bookmarked
1
Total users
0
Monthly active users
a month ago
Last modified
Categories
Features
Share
RAG Documentation Scraper
Your docs site is a wall of noisy HTML. Your vector database needs clean, token-counted, semantically structured text. This Actor bridges that gap in one click.
Built for AI engineers, RAG pipeline architects, and dev-tool teams who need deterministic, reproducible documentation ingestion — not another generic web scraper with an AI label.
Free tier: Apify's free plan covers ~50 pages/month. Paid plans from $49/month unlock full crawl depth and scheduling.
What makes this different from a generic scraper?
| Generic scraper | RAG Documentation Scraper |
|---|---|
| Returns raw HTML | Returns clean markdown, zero boilerplate |
| No concept of "sections" | Splits on h1–h4 heading boundaries |
| No metadata | Every chunk: source_url, section, token_count, content_hash |
| Re-crawls everything | Optional DynamoDB delta tracking — skip unchanged pages |
Breaks on .txt / llms.txt | Auto-detects plain text, chunks by paragraph |
| Duplicates from mirrored pages | SHA-256 dedup across the whole run |
Core Use Cases
- Ingest Docusaurus / ReadTheDocs / MkDocs sites into Pinecone, Chroma, Weaviate, or pgvector with zero preprocessing — use the
json-chunksoutput format for direct vector DB upserts - Build a LangChain RAG chatbot over any API reference — the
langchainoutput produces schema-correct{ page_content, metadata }Documentobjects without custom loaders - Feed LlamaIndex a fresh documentation index on a weekly schedule —
llamaindexoutput emitsTextNodeobjects; combine with Apify's scheduler for automated knowledge-base refresh - Clean markdown extraction for AI agent memory — strip navigation noise, deduplicate mirrored sections, and store results in your MCP server's resource list with structured source attribution
- Incremental doc monitoring — enable
useDeltaTrackingto only re-embed changed pages on doc updates, cutting Pinecone upsert costs by up to 80% on stable documentation sites
Supported site types
Tested and working on: Docusaurus, ReadTheDocs / Sphinx, GitBook, MkDocs Material, Mintlify, VitePress, Nextra, plain HTML/Jekyll static sites, GitHub Wikis, and llms.txt index files.
Not supported: login-gated docs, heavy Cloudflare CAPTCHA sites, JS SPAs with >30s render delay (enable Apify Proxy for IP-blocked sites).
How to use — first run in 60 seconds
In the Apify Console (no code)
- Click Try for free on the Actor page
- Paste your docs root URL into Start URLs (e.g.
https://docs.example.com/introduction) - Set Max Pages Per Run to
20for a test,200for a full site - Set Max Crawl Depth to
2for most documentation sites - Choose Output Format —
markdownfor general use,langchain/llamaindex/json-chunksfor specific frameworks - Click Save & Run
Via API / TypeScript
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });const run = await client.actor('9kOkEMe0j1XJm9OME').call({startUrls: [{ url: 'https://docs.pinecone.io/guides/get-started/overview' }],urlPatterns: ['/guides/**', '/reference/**'],maxDepth: 3,maxRequestsPerCrawl: 200,chunkStrategy: 'heading_boundary',chunkSize: 512,outputFormat: 'json-chunks',deduplicateContent: true,});const { items } = await client.dataset(run.defaultDatasetId).listItems();// items[0] = { text: "## Section\n\nContent...", metadata: { source, section, token_count, ... } }
Input Schema
{"startUrls": [{ "url": "https://your-docs-site.com/introduction" }],"urlPatterns": ["/docs/**", "/api/**"],"maxDepth": 3,"maxRequestsPerCrawl": 200,"chunkStrategy": "heading_boundary","chunkSize": 512,"chunkOverlapTokens": 50,"outputFormat": "markdown","excludeSelectors": [".announcement-bar", "#feedback-widget"],"versionFilter": "/v2/","deduplicateContent": true,"pdfHandling": "skip","useDeltaTracking": false,"dynamodbTableName": "rag-docs-scraper-delta","notifyWebhookUrl": "https://your-service.com/webhook","useProxy": false,"maxConcurrency": 5,"navigationTimeoutSecs": 30}
| Field | Type | Default | Description |
|---|---|---|---|
startUrls | array | — | Root URL(s) to crawl (required) |
urlPatterns | array | [] | Glob path patterns — empty = entire domain |
maxDepth | integer | 1 | Link levels to follow (0 = start pages only) |
maxRequestsPerCrawl | integer | 5 | Hard page cap (max 200) |
chunkStrategy | select | heading_boundary | heading_boundary / fixed_tokens / paragraph / page |
chunkSize | integer | 512 | Target tokens per chunk (64–8192) |
chunkOverlapTokens | integer | 50 | Overlap for fixed_tokens strategy |
outputFormat | select | markdown | markdown / json-chunks / langchain / llamaindex / haystack / text / raw_jsonl |
excludeSelectors | array | [] | Extra CSS selectors to strip from DOM |
versionFilter | string | "" | Only crawl URLs containing this path segment |
deduplicateContent | boolean | true | Skip chunks with already-seen SHA-256 hash |
pdfHandling | select | skip | skip / extract_text / aws_textract |
useDeltaTracking | boolean | false | DynamoDB hash tracking — skip unchanged pages on re-runs |
notifyWebhookUrl | string | "" | POST dataset ID + item count on completion |
Output Formats — JSON Examples
markdown (recommended for generic RAG)
{"markdown": "## Retrieval-Augmented Generation\n\nRAG is a technique for augmenting LLM knowledge with additional, often private or recent, data. LLMs can reason about wide-ranging topics, but their knowledge is limited to the public data they were trained on.","source": "https://python.langchain.com/docs/tutorials/rag/","title": "Build a RAG App — LangChain","section": "Retrieval-Augmented Generation","chunk_index": 0,"chunk_total": 12,"token_count": 48,"content_hash": "a3f2d1e8b9c4a701","scraped_at": "2026-10-24T18:00:00.000Z"}
json-chunks (Pinecone / Chroma / pgvector ready)
{"text": "## Create a PaymentIntent\n\nA PaymentIntent guides you through the process of collecting a payment from your customer. Stripe recommends that you create exactly one PaymentIntent for each order or customer session in your system.","metadata": {"source": "https://stripe.com/docs/api/payment_intents/create","title": "Create a PaymentIntent — Stripe API","section": "Payments > PaymentIntents > Create a PaymentIntent","chunk_index": 0,"chunk_total": 5,"token_count": 52,"last_modified": null,"content_hash": "7e4b2a1d9f830c56","scraped_at": "2026-10-24T18:00:00.000Z"}}
langchain (schema-correct LangChain Document)
{"page_content": "## Built-in Functions\n\nThe Python interpreter has a number of functions and types built into it that are always available. They are listed here in alphabetical order.","metadata": {"source": "https://docs.python.org/3/library/functions.html","title": "Built-in Functions — Python 3.12 documentation","description": "Python built-in functions reference.","chunk_index": 0,"chunk_total": 42,"heading_path": "Built-in Functions","last_modified": null,"token_count": 38,"content_hash": "1d8e3c9b4f720a52","scraped_at": "2026-10-24T18:00:00.000Z"}}
llamaindex (TextNode schema)
{"id_": "8b1f4e2d7c930a45","text": "## Core Architecture\n\nMCP follows a client-server architecture where a host application can connect to multiple servers.","metadata": {"file_path": "https://modelcontextprotocol.io/docs/concepts/architecture","file_name": "Core Architecture — Model Context Protocol","heading_path": "Introduction > Core Architecture","chunk_index": 1,"chunk_total": 12,"token_count": 28,"last_modified": null},"relationships": {},"start_char_idx": null,"end_char_idx": null,"text_template": "{metadata_str}\n\n{content}","metadata_template": "{key}: {value}","metadata_seperator": "\n"}
Recurring Usage & Automation Hooks
Schedule weekly doc refreshes (recommended)
- In the Apify Console, open your saved run and click Schedule
- Set frequency to Weekly (e.g. Mondays 02:00 UTC)
- Enable
useDeltaTracking: true— only changed pages are re-embedded - Add
notifyWebhookUrlto trigger your downstream pipeline when the run finishes
Webhook-triggered ingestion on doc deploys
# .github/workflows/refresh-knowledge-base.ymlname: Refresh RAG Knowledge Baseon:push:branches: [main]paths: ['docs/**']jobs:trigger-apify:runs-on: ubuntu-lateststeps:- name: Trigger RAG Documentation Scraperrun: |curl -X POST \"https://api.apify.com/v2/acts/9kOkEMe0j1XJm9OME/runs?token=${{ secrets.APIFY_TOKEN }}" \-H "Content-Type: application/json" \-d '{"startUrls": [{"url": "https://your-docs.example.com"}],"chunkSize": 512,"outputFormat": "json-chunks","useDeltaTracking": true}'
MCP integration — expose your scraped knowledge base as a resource
// Register the Apify dataset as an MCP resourceserver.setRequestHandler(ListResourcesRequestSchema, async () => ({resources: [{uri: `apify://dataset/${process.env.APIFY_DATASET_ID}`,name: 'Documentation Knowledge Base',description: 'RAG chunks from docs sites scraped by RAG Documentation Scraper',mimeType: 'application/json',}],}));
Topic Cluster — Related Actors
Cross-link these actors to position within the RAG/AI topic cluster on Apify Store:
| Actor | Why it's related |
|---|---|
| Website Content Crawler | Broader generic crawler; RAG Docs Scraper is the AI-optimised specialisation |
| Apify MCP Server | Expose scraped datasets as MCP resources for Claude, Cursor, Windsurf |
| Pinecone Integration | Direct pipeline: scrape → chunk → upsert to Pinecone index in one workflow |
| LangChain Document Loader | Consume our langchain output format directly in a LangChain retriever |
| OpenAI Document Embedder | Next step: embed the json-chunks output using text-embedding-3-small |
FAQ
Q: Does this work on JavaScript-rendered documentation sites? Yes — the Actor uses Playwright (Chromium) to fully render the page before extracting content, so React/Vue/Svelte-powered doc sites like Docusaurus, Nextra, and VitePress are supported out of the box.
Q: How do I prevent duplicate headers in my LangChain vector store?
Use outputFormat: "langchain" and chunkStrategy: "heading_boundary". The heading
is embedded once at the top of each page_content string as proper markdown
(## Section Name) — it is never appended as a separate paragraph, eliminating the
classic "## Introduction\n\nIntroduction\n\nText..." stutter pattern.
Q: Can I scrape only one version of versioned documentation?
Yes — set versionFilter to the version path segment (e.g. /v2/ or /stable/).
Only URLs containing that string will be crawled or enqueued, regardless of what other
links appear on the pages.
Q: How much does a full documentation crawl cost?
A typical 200-page documentation site costs approximately 0.4–1.2 Apify Compute Units
(~$0.02–$0.06 on the Starter plan). Enable useDeltaTracking: true on subsequent runs
to reduce costs by up to 80% — only changed pages consume compute.
Q: Does this scraper handle llms.txt files?
Yes — the Actor auto-detects .txt URLs and text/plain content types, bypasses the
HTML DOM pipeline entirely, and chunks the raw text on paragraph boundaries (\n\n)
while respecting your token limit. Section headings (##, #####) are preserved as
context prefixes on every continuation chunk.