Playbooks
Playbook: extract Markdown
Turn any page into clean, main-content Markdown for LLMs and search — in cURL, TypeScript and Python.
This playbook extracts the main content of an article as Markdown, with title and canonical URL — the ideal input for RAG pipelines and prompts.
The request
| Parameter | Why |
|---|---|
include_markdown=true |
Return Markdown. |
use_defuddle=true |
Keep only the main content (no nav, sidebars, footers, comments). |
remove_cookie_banners=true |
Avoid consent text leaking into content. |
fields=markdown,metadata.title,metadata.canonical |
Return only what you'll store. |
Code
curl -G "http://localhost:4000/v1/content" \
--data-urlencode "url=https://example.com/blog/post" \
-d include_markdown=true -d use_defuddle=true \
-d remove_cookie_banners=true \
-d fields=markdown,metadata.title,metadata.canonical \
-H "x-api-key: $SNAPLENS_API_KEY"{
"success": true,
"data": {
"metadata": { "title": "How we scaled our search", "canonical": "https://example.com/blog/post" },
"markdown": "# How we scaled our search\n\nLast year our index grew 10×…"
}
}Crawling a whole site
- Call once with
include_sitemap=true&fields=sitemapto get every URL. - Extract each page with
is_async=trueand awebhook_url, or the SDK'sbatch()helper with a concurrency within your rate limit. - Chunk Markdown by headings and embed.
Tips
- Without
use_defuddle, Markdown includes navigation and footers — useful for link analysis, noisy for LLMs. - Add
stealth=truefor sites that block automated browsers (paid plans). block_resources=image,media,fontspeeds up extraction when you only need text.