关于 web
用于网页抓取与搜索的技能,在内置网页获取受阻或无法渲染页面时调用付费 API。通过 x_payment 支持单页或批量抓取、多种输出格式及网页搜索。
主要功能
- 01网页搜索并返回摘要
- 02单个或批量 URL 抓取
- 03支持 Markdown、HTML 或文本
- 04按 CSS 选择器提取内容
- 05针对受阻页面逐级切换抓取方式
适用场景
- 01内置搜索失败时查找网页
- 02提取 JavaScript 渲染网站的内容
- 03一次请求抓取多个 URL
- 04选择页面中的特定元素
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ cascade-protocol/ agentbox --skill web安装后在 Claude Code 中输入/web确认已加载。
详细介绍
网页抓取与搜索
付费网页爬取与搜索 API,地址为 https://web.surf.cascade.fyi。通过 Solana 上的 x402 支付,抓取每次收费 $0.005 USDC,搜索每次调用收费 $0.01 USDC。所有请求均使用 x_payment 工具。当内置的 web_fetch 工具失败或被拦截时(反机器人机制、由 JS 渲染的页面、付费墙内容),请使用此工具。
端点
抓取网页
从任意 URL 获取并提取内容。如果被拦截,会自动逐步切换到更强的抓取方式:快速 HTTP -> 无头浏览器 -> 带代理的隐身浏览器。
x_payment({
"url": "https://web.surf.cascade.fyi/v1/crawl",
"method": "POST",
"params": "{\"url\": \"https://example.com\", \"format\": \"markdown\"}"
})
请求体参数:
| 参数 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| url | string | - | 要抓取的单个 URL(未提供 urls 时必填) |
| urls | string[] | - | 要批量抓取的多个 URL(未提供 url 时必填) |
| format | string | markdown | 输出格式:markdown、html 或 text |
| selector | string | - | 用于提取特定元素的 CSS 选择器 |
| proxy | boolean | false | 强制使用代理(在隐身层级自动启用) |
单个 URL 的响应:
{
"status": 200,
"content": ["# Page Title\n\nPage content in markdown..."],
"url": "https://example.com/"
}
批量 URL 的响应:
[
{"status": 200, "content": ["..."], "url": "https://example.com/"},
{"status": 200, "content": ["..."], "url": "https://other.com/"}
]
**级联升级:**爬虫会自动尝试越来越强大的方法:
- get - 快速 HTTP 请求(成本最低,可处理大多数静态网站)
- fetch - 无头 Chromium(用于由 JS 渲染的页面)
- stealthy_fetch - 带代理的隐身浏览器(绕过 Cloudflare 和反机器人机制)
升级触发条件:HTTP 403/429/503、内容为空或内容少于 100 个字符。
搜索网页
使用 Exa 的搜索 API 搜索网页。返回标题、URL 和文本摘要。
x_payment({
"url": "https://web.surf.cascade.fyi/v1/search",
"method": "POST",
"params": "{\"query\": \"x402 protocol crypto payments\", \"num_results\": 10}"
})
请求体参数:
| 参数 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| query | string | required | 搜索查询 |
| num_results | 1-20 | 5 | 返回结果数量 |
响应:
{
"results": [
{
"title": "Page Title",
"url": "https://example.com/page",
"snippet": "Relevant text excerpt from the page..."
}
]
}
使用模式
将页面抓取为 markdown
x_payment({
"url": "https://web.surf.cascade.fyi/v1/crawl",
"method": "POST",
"params": "{\"url\": \"https://docs.solana.com\", \"format\": \"markdown\"}"
})
使用 CSS 选择器提取特定元素
x_payment({
"url": "https://web.surf.cascade.fyi/v1/crawl",
"method": "POST",
"params": "{\"url\": \"https://news.ycombinator.com\", \"format\": \"html\", \"selector\": \".titleline\"}"
})
批量抓取多个 URL
x_payment({
"url": "https://web.surf.cascade.fyi/v1/crawl",
"method": "POST",
"params": "{\"urls\": [\"https://example.com\", \"https://httpbin.org/get\"], \"format\": \"text\"}"
})
先搜索,再抓取排名靠前的结果
先搜索:
x_payment({
"url": "https://web.surf.cascade.fyi/v1/search",
"method": "POST",
"params": "{\"query\": \"ERC-8004 agent identity standard\", \"num_results\": 5}"
})
然后抓取最相关的结果:
x_payment({
"url": "https://web.surf.cascade.fyi/v1/crawl",
"method": "POST",
"params": "{\"url\": \"https://eips.ethereum.org/EIPS/eip-8004\", \"format\": \"markdown\"}"
})
费用
- 抓取:每次调用 $0.005 USDC(单个或批量)
- 搜索:每次调用 $0.01 USDC
所有支付均在 Solana 主网上进行。每个请求均为单独调用。批量抓取时,一笔支付即可覆盖批次中的所有 URL。
错误
| HTTP | 含义 |
|---|---|
| 400 | 参数无效(请检查请求体格式) |
| 402 | 需要付款(由 x_payment 自动处理) |
| 429 | 并发请求过多(请稍后重试) |
| 502 | 上游抓取/搜索错误 |
评论
支持 Markdown