Website & Docs to Clean Markdown & RAG Chunker for AI avatar

Website & Docs to Clean Markdown & RAG Chunker for AI

Pricing

from $1.20 / 1,000 converted page & rag chunks

Go to Apify Store
Website & Docs to Clean Markdown & RAG Chunker for AI

Website & Docs to Clean Markdown & RAG Chunker for AI

Convert any Website, Documentation, or Blog into clean LLM-ready Markdown and semantic RAG chunks with token counts, metadata, tables & code preservation for AI Agents, MCP, LangChain & n8n.

Pricing

from $1.20 / 1,000 converted page & rag chunks

Rating

0.0

(0)

Developer

José misael Quintero López

José misael Quintero López

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

a day ago

Last modified

Features

Limited permissions

Share

Turn any website, documentation site, or blog into clean, LLM-ready Markdown and semantic RAG chunks in one run. Each chunk keeps its heading context and token count, so it drops straight into your embedding pipeline, vector database, or AI agent.

Built for AI agents, MCP servers, LangChain, LlamaIndex, CrewAI, n8n, Make, Pinecone, and Supabase pgvector workflows.


What does this Actor do?

Raw HTML is noisy: navigation bars, cookie banners, scripts, and styling eat up tokens and confuse language models. This Actor fetches each URL, strips the noise, and returns:

  • Clean Markdown that preserves headings, lists, links, fenced code blocks, and HTML tables.
  • Semantic RAG chunks split on Markdown structure, each tagged with its nearest heading (headingContext), character count, and estimated token count.
  • Page metadata: title, description, author, published date, language, canonical URL, Open Graph image and site name, and JSON-LD types.
  • Links: internal and external links found on each page.
  • Token savings report: how many tokens you save by sending Markdown instead of raw HTML, stored as a run summary in the key-value store.
  • Optional subpage discovery: automatically follow internal links on your start pages, limited per domain and optionally by path prefix such as /docs or /blog.

Who is it for?

Use caseWhat you get
AI agents & MCP toolsCompact, readable page content that fits context windows
RAG pipelinesChunks with heading context and token counts, ready to embed
Documentation searchEntire docs sections converted and chunked for semantic search
Knowledge bases & chatbotsBlogs and help centers turned into clean, citable source text
No-code automationResults in a dataset you can pull into n8n, Make, or Zapier
Fine-tuning & evaluation datasetsConsistent Markdown plus metadata for every page

Key features

  • HTML to Markdown API alternative: run it from the Apify Console, the API, or a scheduled task.
  • Boilerplate removal: scripts, styles, and navigation chrome are removed before conversion.
  • Table preservation: HTML <table> elements become Markdown pipe tables (optional).
  • Code block preservation: <pre><code> blocks become fenced code blocks with language tags (optional).
  • Configurable RAG chunking: set chunk size (100–4,000 tokens) and overlap (0–500 tokens).
  • Subpage crawling: discover internal pages automatically, capped per domain (1–50 pages).
  • Path prefix filter: crawl only the sections you care about.
  • Concurrency and timeouts: tune parallel requests (1–20) and per-request timeout (5–60 seconds).
  • Structured output: dataset views for overview, RAG chunks, and metadata & links.

Quick start

  1. Open the Actor in the Apify Store and click Try for free.
  2. Enter one or more URLs in URLs to convert. The default example converts the Apify platform docs and the Apify about page.
  3. Optionally enable Auto-discover & crawl internal subpages and set Max pages per domain.
  4. Adjust RAG chunk size and RAG chunk overlap to match your embedding model and context window.
  5. Click Start. When the run finishes, open the Dataset tab for results or the Key-value store for the SUMMARY report.

Input

FieldTypeDefaultDescription
urlsarray of stringsApify docs and about pageRequired. Pages to convert.
crawlSubpagesbooleanfalseDiscover and convert internal links found on the start pages.
maxPagesPerDomaininteger (1–50)3Maximum pages processed per domain when crawling subpages.
pathPrefixFilterstring""Only follow subpages whose path starts with this prefix, e.g. /docs.
includeRagChunksbooleantrueGenerate semantic RAG chunks with heading context and token counts.
chunkSizeTokensinteger (100–4000)500Target size of each RAG chunk in estimated tokens.
chunkOverlapTokensinteger (0–500)50Tokens shared between consecutive chunks.
preserveTablesbooleantrueConvert HTML tables to Markdown tables.
preserveCodeBlocksbooleantrueKeep fenced code blocks with language tags.
includeLinksSummarybooleantrueInclude the list of internal and external links per page.
concurrencyinteger (1–20)5Number of pages processed in parallel.
requestTimeoutSecsinteger (5–60)15Timeout for each page request, in seconds.

Example input

{
"urls": [
"https://docs.apify.com/platform/actors"
],
"crawlSubpages": true,
"maxPagesPerDomain": 20,
"pathPrefixFilter": "/platform",
"includeRagChunks": true,
"chunkSizeTokens": 500,
"chunkOverlapTokens": 50,
"preserveTables": true,
"preserveCodeBlocks": true,
"includeLinksSummary": true,
"concurrency": 5,
"requestTimeoutSecs": 15
}

Output

Dataset item

Each processed page produces one dataset item:

{
"url": "https://docs.example.com/start",
"finalUrl": "https://docs.example.com/start",
"domain": "docs.example.com",
"status": "success",
"httpStatus": 200,
"metadata": {
"title": "Getting Started",
"description": "Intro to actors",
"author": "Jane Doe",
"publishedDate": "2025-01-02T10:00:00Z",
"language": "en",
"canonicalUrl": "https://docs.example.com/start",
"ogImage": "https://docs.example.com/og.png",
"siteName": "Example Docs",
"jsonLdTypes": ["Article"]
},
"markdown": "# Getting Started\n\nWelcome to ...",
"wordCount": 842,
"charCount": 5310,
"estimatedTokens": 1330,
"rawHtmlTokensEstimate": 9120,
"tokenSavingsPercent": 85.4,
"chunksCount": 3,
"ragChunks": [
{
"chunkIndex": 0,
"headingContext": "Getting Started",
"text": "Welcome to ...",
"charCount": 498,
"estimatedTokens": 125
}
],
"links": [
{ "text": "the guide", "url": "https://docs.example.com/docs/guide", "isInternal": true }
],
"responseTimeMs": 412,
"processedAt": "2026-11-17T12:00:00.000Z"
}

Run summary

The SUMMARY record in the default key-value store contains run totals, including the aggregate token savings compared with raw HTML. Open the Run Summary & Token Savings Report link from the Actor's output tab.

Dataset views

  • Overview: URL, title, word count, estimated tokens, token savings, chunk count, and Markdown.
  • RAG Chunks: URL, title, chunk count, estimated tokens, and the chunks themselves.
  • Metadata & Links: URL, domain, title, description, author, published date, JSON-LD types, and links.

Using the output in AI and RAG pipelines

Python: load chunks into a vector store

from apify_client import ApifyClient
client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("vertika/ai-web-to-markdown-rag").call(run_input={
"urls": ["https://docs.apify.com/platform/actors"],
"chunkSizeTokens": 500,
"chunkOverlapTokens": 50,
})
items = client.dataset(run["defaultDatasetId"]).iterate_items()
documents = []
for item in items:
if item["status"] != "success":
continue
for chunk in item["ragChunks"]:
documents.append({
"text": chunk["text"],
"metadata": {
"url": item["url"],
"title": item["metadata"]["title"],
"heading": chunk["headingContext"],
"tokens": chunk["estimatedTokens"],
},
})
# Embed `documents` and upsert into Pinecone, Supabase pgvector, Qdrant, Chroma, etc.

JavaScript: LangChain-style documents

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: '<APIFY_TOKEN>' });
const run = await client.actor('vertika/ai-web-to-markdown-rag').call({
urls: ['https://docs.apify.com/platform/actors'],
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
const docs = items
.filter((item) => item.status === 'success')
.flatMap((item) =>
item.ragChunks.map((chunk) => ({
pageContent: chunk.text,
metadata: {
source: item.url,
title: item.metadata.title,
heading: chunk.headingContext,
estimatedTokens: chunk.estimatedTokens,
},
})),
);
// Pass `docs` to a LangChain vector store, a LlamaIndex index, or a CrewAI knowledge source.

No-code: n8n, Make, and Zapier

  1. Add the Apify node (n8n) or the Apify module (Make) and choose Run Actor.
  2. Select vertika/ai-web-to-markdown-rag and pass your input JSON.
  3. Add a Get dataset items step, then split ragChunks into one item per chunk.
  4. Send each chunk to an embeddings node and your vector store (Pinecone, Supabase pgvector, or any other).

MCP server and AI agents

Use the Actor as a web-reading tool for an MCP server or agent: call it with one or a few URLs, then give the agent the markdown field, or the most relevant ragChunks, instead of raw HTML. This keeps prompts small and answers grounded in the source page.

Tips for better RAG results

  • Match chunk size to your model. 300–800 tokens works well for most embedding models. Use larger chunks when you need more surrounding context per answer.
  • Use overlap for continuity. A 10% overlap (for example, 50 tokens for 500-token chunks) helps keep definitions and steps that span chunk boundaries.
  • Crawl only what you need. Combine crawlSubpages with pathPrefixFilter and maxPagesPerDomain to index a documentation section without pulling in the whole site.
  • Filter on metadata. Store url, title, and headingContext with each vector so you can cite sources and filter by section.
  • Re-run on a schedule. Use an Apify schedule to keep your knowledge base in sync with documentation updates.

Frequently asked questions

Does it work on JavaScript-heavy sites? The Actor is optimized for server-rendered documentation, blogs, and content pages. Pages that render all content with client-side JavaScript may return less text.

What is a RAG chunk? A RAG chunk is a section of a page sized to fit into an embedding model and an LLM context window. Each chunk is tagged with the heading it belongs to, so retrieval results stay meaningful.

How are tokens estimated? Token counts are estimates based on text length, intended for budgeting and chunk sizing. They are not tied to a specific tokenizer, so expect small differences from your model's exact count.

Can I use it as an HTML to Markdown API? Yes. Call the Actor through the Apify API with urls set to the pages you want and read the results from the dataset. The Markdown is in the markdown field of each item.

Does it respect robots.txt or rate limits? Use concurrency and requestTimeoutSecs to keep request rates reasonable. Always make sure your use complies with the target site's terms and applicable law.

Looking for more ways to grow your business with AI?

Need a custom AI or RAG automation?

Need something tailored to your stack, such as a custom crawler, a RAG pipeline into your own vector database, an MCP server for your product docs, or an n8n/Make workflow for your team? Open an issue in the ../../issues of this Actor describing your use case, and we will get back to you about a custom solution.

Free tool: GEO Score

Curious how AI-ready your own site is? Try GEO Score, a free 2-minute checker that scores any domain for AI-search readiness: GPTBot / ClaudeBot / PerplexityBot access, llms.txt, Schema.org, and technical basics. You get a 0–100 score, your three biggest gaps, and copy-paste fixes. No signup, and nothing is uploaded to a server.

Want the full audit done for you? Copy your report, open an issue in the Issues tab of the B2B Auditor Actor with the title Free GEO Audit Request, and paste up to 5 domains. We will send back a free manual GEO audit.

Support

Found a bug or have a feature request? Open an issue in the Issues tab of this Actor. Please include the input you used (with any private URLs removed) and the run ID when possible.

Keywords

Website to Markdown for AI Agents · RAG Chunker · Documentation Scraper for LLMs · HTML to Clean Markdown API · MCP Server Tool · LangChain loader · LlamaIndex loader · CrewAI knowledge source · n8n RAG workflow · Make RAG workflow · Pinecone loader · Supabase pgvector loader · Markdown for LLM context · web scraper for embeddings