Feeding raw scraped HTML into LLMs wastes up to 90% of your token budget on navbars, cookie banners, ads, and inline scripts—while polluting your vector store.
Instead of running slow headless browsers or paying for an extra LLM pass just to clean DOM trees, you can convert any URL or raw HTML into clean Markdown and overlapping RAG chunks in one deterministic API call.
Quick Python Example
Grab a free API key (5,000 requests/month free tier) from RapidAPI and run:
import requests
url = "https://html-to-clean-markdown-llm-chunker.p.rapidapi.com/api/convert"
headers = {
"Content-Type": "application/json",
"X-RapidAPI-Key": "YOUR_RAPIDAPI_KEY",
"X-RapidAPI-Host": "html-to-clean-markdown-llm-chunker.p.rapidapi.com"
}
payload = {
"url": "https://en.wikipedia.org/wiki/Retrieval-augmented_generation",
"chunk_size": 500,
"chunk_overlap": 50
}
res = requests.post(url, json=payload, headers=headers).json()
print("Token Savings:", res["metadata"]["token_savings_percent"], "%")
print("First Chunk:\n", res["chunks"][0])
Key Features
-
Dual Input: Pass a live
urlOR rawhtml(up to 2 MB, ideal if you already scrape behind bot walls with Playwright/Puppeteer). - 4-Tier Extraction: Deterministically strips boilerplate across articles, docs, and messy pages in milliseconds.
- RAG-Ready Output: Returns clean Markdown, overlapping chunks, and exact token-saving metrics.
Test it live in the browser playground on RapidAPI — feedback is welcome!
Top comments (0)