markdown-fetchOptimizes web fetching by using Cloudflare's Markdown for Agents, reducing token consumption by ~80%
Install via ClawdBot CLI:
clawdbot install howtimeschange/markdown-fetchCloudflare 推出 Markdown for Agents 功能:
在需要网页抓取时,使用优化后的 fetch 函数:
const { optimizedFetch } = require('./markdown-fetch');
const result = await optimizedFetch('https://example.com');
// result.markdown - Markdown 内容(如果有)
// result.html - HTML 内容(备用)
// result.tokensSaved - 节省的 tokens(如果有)
async function optimizedFetch(url, options = {}) {
const headers = {
'Accept': 'text/markdown, text/html',
...options.headers
};
const response = await fetch(url, { ...options, headers });
const contentType = response.headers.get('content-type');
const xMarkdownTokens = response.headers.get('x-markdown-tokens');
let result = {
url,
contentType,
tokensSaved: xMarkdownTokens ? parseInt(xMarkdownTokens) : null
};
if (contentType.includes('text/markdown')) {
result.markdown = await response.text();
result.format = 'markdown';
} else {
result.html = await response.text();
result.format = 'html';
}
return result;
}
| Content-Type | 处理方式 |
|--------------|----------|
| text/markdown | 直接使用,跳过 HTML 解析 |
| text/html | 走原有解析逻辑 |
如果响应中有 x-markdown-tokens header,记录到日志:
if (result.tokensSaved) {
console.log(`[Markdown Fetch] Token 节省: ${result.tokensSaved}`);
}
找一个 Cloudflare 托管的网站测试:
curl -H "Accept: text/markdown, text/html" https://cloudflare-example.com
确认收到 content-type: text/markdown 响应。
Generated Mar 1, 2026
Content platforms can use this skill to fetch and summarize web articles in markdown format, reducing token costs by 80% when processing large volumes of data. This enables faster and cheaper generation of AI-driven summaries or translations for news aggregation services.
SEO tools can integrate this skill to fetch webpage content efficiently, allowing for cheaper analysis of HTML structure and keywords. By receiving markdown, they save tokens and speed up processing for bulk site audits or competitive analysis.
Academic researchers can leverage this skill to fetch scholarly articles or web resources in markdown, minimizing token usage for literature reviews. It supports AI agents in extracting key insights or generating citations without high computational costs.
E-commerce platforms can use this skill to fetch product descriptions and reviews from competitor sites in markdown, optimizing token consumption for price comparison or inventory analysis. This reduces costs in AI-driven market intelligence systems.
Support systems can integrate this skill to fetch help articles or documentation in markdown format, enabling AI chatbots to provide accurate answers with lower token overhead. This improves response efficiency and reduces operational expenses.
Offer this skill as part of a subscription-based AI tool suite for developers, charging monthly fees based on usage tiers. Revenue comes from enterprises needing cost-effective web fetching for their AI applications, with premium support and analytics.
Provide a free tier with limited requests and a paid API for high-volume users, monetizing through token savings and advanced features. Revenue is generated from developers and businesses scaling their AI projects with optimized data fetching.
License the skill directly to large organizations for integration into their internal AI systems, offering custom support and integration services. Revenue comes from one-time licenses or annual contracts tailored to specific industry needs.
💬 Integration Tip
Ensure all HTTP requests in your codebase are updated to include the Accept header for markdown, and test with Cloudflare-hosted sites to verify token savings.
Edit PDFs with natural-language instructions using the nano-pdf CLI.
Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.
Convert documents and files to Markdown using markitdown. Use when converting PDF, Word (.docx), PowerPoint (.pptx), Excel (.xlsx, .xls), HTML, CSV, JSON, XML, images (with EXIF/OCR), audio (with transcription), ZIP archives, YouTube URLs, or EPubs to Markdown format for LLM processing or text analysis.
用 MinerU API 解析 PDF/Word/PPT/图片为 Markdown,支持公式、表格、OCR。适用于论文解析、文档提取。
Generate hand-drawn style diagrams, flowcharts, and architecture diagrams as PNG images from Excalidraw JSON
The awesome PPT format generation tool provided by baidu.