RAG Documentation Scraper — LLM-Ready Chunker avatar

RAG Documentation Scraper — LLM-Ready Chunker

Pricing

from $3.50 / 1,000 results

Go to Apify Store
RAG Documentation Scraper — LLM-Ready Chunker

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

LERNOWA AI LABS PRIVATE LIMITED

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

a month ago

Last modified

Categories

Features

Limited permissions

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 scraperRAG Documentation Scraper
Returns raw HTMLReturns clean markdown, zero boilerplate
No concept of "sections"Splits on h1–h4 heading boundaries
No metadataEvery chunk: source_url, section, token_count, content_hash
Re-crawls everythingOptional DynamoDB delta tracking — skip unchanged pages
Breaks on .txt / llms.txtAuto-detects plain text, chunks by paragraph
Duplicates from mirrored pagesSHA-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-chunks output format for direct vector DB upserts
  • Build a LangChain RAG chatbot over any API reference — the langchain output produces schema-correct { page_content, metadata } Document objects without custom loaders
  • Feed LlamaIndex a fresh documentation index on a weekly schedule — llamaindex output emits TextNode objects; 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 useDeltaTracking to 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)

  1. Click Try for free on the Actor page
  2. Paste your docs root URL into Start URLs (e.g. https://docs.example.com/introduction)
  3. Set Max Pages Per Run to 20 for a test, 200 for a full site
  4. Set Max Crawl Depth to 2 for most documentation sites
  5. Choose Output Format — markdown for general use, langchain / llamaindex / json-chunks for specific frameworks
  6. 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
}
FieldTypeDefaultDescription
startUrlsarray—Root URL(s) to crawl (required)
urlPatternsarray[]Glob path patterns — empty = entire domain
maxDepthinteger1Link levels to follow (0 = start pages only)
maxRequestsPerCrawlinteger5Hard page cap (max 200)
chunkStrategyselectheading_boundaryheading_boundary / fixed_tokens / paragraph / page
chunkSizeinteger512Target tokens per chunk (64–8192)
chunkOverlapTokensinteger50Overlap for fixed_tokens strategy
outputFormatselectmarkdownmarkdown / json-chunks / langchain / llamaindex / haystack / text / raw_jsonl
excludeSelectorsarray[]Extra CSS selectors to strip from DOM
versionFilterstring""Only crawl URLs containing this path segment
deduplicateContentbooleantrueSkip chunks with already-seen SHA-256 hash
pdfHandlingselectskipskip / extract_text / aws_textract
useDeltaTrackingbooleanfalseDynamoDB hash tracking — skip unchanged pages on re-runs
notifyWebhookUrlstring""POST dataset ID + item count on completion

Output Formats — JSON Examples

{
"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

  1. In the Apify Console, open your saved run and click Schedule
  2. Set frequency to Weekly (e.g. Mondays 02:00 UTC)
  3. Enable useDeltaTracking: true — only changed pages are re-embedded
  4. Add notifyWebhookUrl to trigger your downstream pipeline when the run finishes

Webhook-triggered ingestion on doc deploys

# .github/workflows/refresh-knowledge-base.yml
name: Refresh RAG Knowledge Base
on:
push:
branches: [main]
paths: ['docs/**']
jobs:
trigger-apify:
runs-on: ubuntu-latest
steps:
- name: Trigger RAG Documentation Scraper
run: |
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 resource
server.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',
}],
}));

Cross-link these actors to position within the RAG/AI topic cluster on Apify Store:

ActorWhy it's related
Website Content CrawlerBroader generic crawler; RAG Docs Scraper is the AI-optimised specialisation
Apify MCP ServerExpose scraped datasets as MCP resources for Claude, Cursor, Windsurf
Pinecone IntegrationDirect pipeline: scrape → chunk → upsert to Pinecone index in one workflow
LangChain Document LoaderConsume our langchain output format directly in a LangChain retriever
OpenAI Document EmbedderNext 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.