StripFeed
Convert any URL to clean Markdown optimized for LLM consumption. Strips ads, navigation, scripts, and noise. Returns token counts so you know exactly how much context you're using.
When to use this skill
Use StripFeed whenever you need to read a web page, article, documentation, or any URL content. It produces much cleaner output than raw HTML fetching and tells you the token cost.
Authentication
All requests require the STRIPFEED_API_KEY environment variable. Pass it as a Bearer token:
CODEBLOCK0
Get a free API key at https://www.stripfeed.dev (200 requests/month, no credit card).
Fetch a single URL
CODEBLOCK1
This returns clean Markdown directly as the response body (Content-Type: text/markdown).
Parameters
| Parameter | Required | Description |
|---|
| INLINECODE1 | Yes | The URL to fetch (must be http or https) |
| INLINECODE2 |
No | Output format:
markdown (default),
json,
text,
html. Pro only except markdown. |
|
selector | No | CSS selector to extract specific content (e.g.
article,
.content,
#main). Pro only. |
|
cache | No | Set to
false to bypass cache and force a fresh fetch |
|
ttl | No | Cache TTL in seconds (default: 3600, max: 86400 for Pro) |
|
max_tokens | No | Truncate output to fit within this token budget |
|
model | No | AI model ID for cost tracking (e.g.
claude-sonnet-4-6,
gpt-4o) |
JSON format (recommended for structured responses)
When you need metadata alongside the content, use format=json:
CODEBLOCK2
JSON response includes:
CODEBLOCK3
Response headers
Every response includes these headers:
- -
X-StripFeed-Tokens - Token count of the stripped content - INLINECODE20 - Token count of the raw HTML (before stripping)
- INLINECODE21 - Percentage of tokens saved
- INLINECODE22 -
HIT or INLINECODE24 - INLINECODE25 - Time to fetch the URL (0 if cached)
- INLINECODE26 - Output format used
Batch fetch (Pro plan)
Fetch up to 10 URLs in a single request:
CODEBLOCK4
URLs can also include selectors:
CODEBLOCK5
Batch response:
CODEBLOCK6
Individual URL errors don't break the batch. Check each result's status field.
Error handling
| Status | Meaning |
|---|
| 401 | Missing or invalid API key |
| 403 |
Feature requires Pro plan |
| 422 | Invalid URL, format, or parameter |
| 429 | Rate limit or monthly quota exceeded |
| 502 | Target URL unreachable or returned error |
| 504 | Target URL timed out (9s limit) |
Tips
- - Default format is
markdown which returns raw text. Use format=json when you need token counts and metadata in the response body. - Responses are cached for 1 hour by default. Use
cache=false for real-time content. - The
max_tokens parameter is useful to fit content within your context window budget. - Use
selector to grab only the main content (e.g. selector=article or selector=.post-content) and skip sidebars/footers. - Free plan: 200 requests/month, markdown format only. Pro plan ($19/mo): 100K requests, all formats, selectors, batch endpoint.
StripFeed
将任意URL转换为针对LLM使用优化的干净Markdown格式。去除广告、导航、脚本和噪声。返回Token计数,让您精确了解所使用的上下文量。
何时使用此技能
当您需要阅读网页、文章、文档或任何URL内容时,请使用StripFeed。它比直接获取原始HTML产生更干净的输出,并告知您Token成本。
身份验证
所有请求都需要STRIPFEEDAPIKEY环境变量。将其作为Bearer令牌传递:
Authorization: Bearer $STRIPFEEDAPIKEY
在https://www.stripfeed.dev获取免费API密钥(每月200次请求,无需信用卡)。
获取单个URL
bash
curl -s https://www.stripfeed.dev/api/v1/fetch?url=URL_HERE \
-H Authorization: Bearer $STRIPFEEDAPIKEY
这将直接以响应体形式返回干净的Markdown(Content-Type: text/markdown)。
参数
| 参数 | 必需 | 描述 |
|---|
| url | 是 | 要获取的URL(必须是http或https) |
| format |
否 | 输出格式:markdown(默认)、json、text、html。除markdown外仅限Pro用户。 |
| selector | 否 | CSS选择器,用于提取特定内容(例如article、.content、#main)。仅限Pro用户。 |
| cache | 否 | 设置为false可绕过缓存并强制重新获取 |
| ttl | 否 | 缓存TTL(秒)(默认:3600,Pro用户最大:86400) |
| max_tokens | 否 | 截断输出以适配此Token预算 |
| model | 否 | 用于成本跟踪的AI模型ID(例如claude-sonnet-4-6、gpt-4o) |
JSON格式(推荐用于结构化响应)
当您需要元数据与内容一起返回时,使用format=json:
bash
curl -s https://www.stripfeed.dev/api/v1/fetch?url=URL_HERE&format=json \
-H Authorization: Bearer $STRIPFEEDAPIKEY
JSON响应包括:
json
{
markdown: # 页面标题\n\n干净内容...,
url: https://example.com,
title: 页面标题,
tokens: 1250,
originalTokens: 15000,
savingsPercent: 91.7,
cached: false,
fetchMs: 430,
format: json,
truncated: false,
selector: null,
model: null
}
响应头
每个响应都包含以下头信息:
- - X-StripFeed-Tokens - 剥离后内容的Token计数
- X-StripFeed-Original-Tokens - 原始HTML的Token计数(剥离前)
- X-StripFeed-Savings-Percent - 节省的Token百分比
- X-StripFeed-Cache - HIT或MISS
- X-StripFeed-Fetch-Ms - 获取URL的时间(如果缓存则为0)
- X-StripFeed-Format - 使用的输出格式
批量获取(Pro计划)
在单个请求中获取最多10个URL:
bash
curl -s -X POST https://www.stripfeed.dev/api/v1/batch \
-H Authorization: Bearer $STRIPFEEDAPIKEY \
-H Content-Type: application/json \
-d {urls: [https://example.com, https://example.org]}
URL也可以包含选择器:
json
{
urls: [
{ url: https://example.com, selector: article },
{ url: https://example.org }
],
model: claude-sonnet-4-6
}
批量响应:
json
{
results: [
{ url: ..., markdown: ..., tokens: 1250, status: 200 },
{ url: ..., error: 获取失败, status: 502 }
],
total: 2,
success: 1,
failed: 1
}
单个URL的错误不会影响整个批量请求。请检查每个结果的status字段。
错误处理
该功能需要Pro计划 |
| 422 | URL、格式或参数无效 |
| 429 | 超出速率限制或月度配额 |
| 502 | 目标URL无法访问或返回错误 |
| 504 | 目标URL超时(9秒限制) |
提示
- - 默认格式为markdown,返回原始文本。当您需要在响应体中获取Token计数和元数据时,使用format=json。
- 响应默认缓存1小时。使用cache=false获取实时内容。
- max_tokens参数有助于将内容适配到您的上下文窗口预算内。
- 使用selector仅抓取主要内容(例如selector=article或selector=.post-content),跳过侧边栏/页脚。
- 免费计划:每月200次请求,仅支持markdown格式。Pro计划($19/月):10万次请求,支持所有格式、选择器和批量端点。