summarize_content
抽取式摘要:句子直接取自原文,不做改写。工具会把文本切分成句子,丢弃短于 20 个字符的片段,并按你指定的形式返回开头的若干句。整个过程不调用模型,因此同一页面的摘要始终一致,也不可能凭空捏造内容。
使用场景
信息流预览
用 summary_type: brief 为链接流中的每一条生成一句话导读。
邮件摘要
把一批文章转成可直接粘贴进通讯的要点列表。
阅读前分流
先看开头几句,再决定这个长页面是否值得做完整提取。
搜索结果摘要片段
为已索引页面附上一致、可引用的片段,内容逐字取自原文。
可引用的上下文
由于句子是原样复制而非转述,输出可以直接引用并标注出处。
低成本预摘要
在把页面送入语言模型之前先压缩,减少模型需要付费的 token 数量。
Endpoint
/api/v1/tools/summarize_contentParameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
url | string | Optional | - | 要抓取并摘要的页面。会先剥离 script、style、nav、header 和 footer。`url` 与 `content` 至少提供一个。 Example: https://example.com/blog/crawl-budgets |
content | string | Optional | - | 直接摘要的文本,跳过抓取。仅在省略 `url` 时生效——两者都传时以抓取到的页面为准。 Example: Search engines allocate a finite number of requests... |
max_sentences | number | Optional | 5 | 保留多少句,取值 1 到 20。当 `summary_type` 为 `brief` 时忽略该值,始终只返回一句。 Example: 3 |
summary_type | string | Optional | extractive | `extractive` 把这些句子合并为一个段落字符串。`key_points` 以字符串数组返回,每句一项。`brief` 只返回第一句,类型为字符串。 Example: key_points |
include_metadata | boolean | Optional | false | 以 `metadata` 对象附加页面的标题、描述、作者与发布日期。只有配合 `url` 时才有效——传入 `content` 时没有 meta 可读。 Example: true |
timeout | number | Optional | 10000 | 抓取超时(毫秒),取值 1000 到 30000。仅在使用 `url` 时生效。 Example: 10000 |
respect_robots | boolean | Optional | true | 遵守目标站点的 robots.txt。保持 `true` 时,robots.txt 对 `CrawlForge` 禁止的路径会在抓取之前以 403 拒绝,且不扣除 credits。仅在你与目标站点另有约定时才设为 `false`——此时响应会带上一条 `warnings`,并且该覆盖会记录到你的 API key 上。 Example: true |
请求示例
curl -X POST https://crawlforge.dev/api/v1/tools/summarize_content \
-H "X-API-Key: cf_test_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/blog/crawl-budgets",
"max_sentences": 3,
"summary_type": "extractive",
"include_metadata": true
}'响应示例
{ "success": true, "data": { "summary": "Search engines allocate a finite number of requests to each site, and that allowance is what people mean by crawl budget. Large sites hit the ceiling long before small ones do, usually through duplicate URLs rather than genuine pages. Faceted navigation is the classic offender, generating thousands of near-identical addresses from a single catalogue.", "summary_type": "extractive", "original_length": 613, "summary_length": 352, "compression_ratio": 0.57, "sentences_used": 3, "total_sentences": 5, "metadata": { "title": "Why crawl budgets matter — Acme Blog", "description": "How search engines ration requests, and what to do about it.", "author": "Dana Reyes", "publish_date": "2026-08-14T09:30:00Z" } }, "credits_used": 4, "credits_remaining": 996, "processing_time": 540}data.summary`extractive` 与 `brief` 返回字符串,`key_points` 返回字符串数组。请据此定义客户端类型data.original_length剥离 HTML 后源文本的字符数,而不是页面原始大小data.compression_ratio`summary_length / original_length`,保留两位小数。数值越低,摘要越紧凑data.sentences_used实际返回的句数——页面较短时会小于 `max_sentences`data.total_sentences在源文本中找到的句数,只统计超过 20 个字符的句子。与 `sentences_used` 对比即可看出被舍弃了多少data.metadata仅当 `include_metadata` 为 true 且提供了 `url` 时出现。页面未声明的字段为 undefinedcredits_used每次调用固定 4 credits,与文本长度无关错误处理
未提供 url 或 content(400 Bad Request)
VALIDATION_ERROR。两者至少要提供一个。url 格式错误、max_sentences 超出 1-20、summary_type 取值未知,或 timeout 超出 1000-30000,都返回同一状态码。
页面过大(413 Payload Too Large)
RESPONSE_TOO_LARGE。抓取到的页面超过 25MB 读取上限,被直接拒绝而不是缓冲到内存。
目标站点超时(504 Gateway Timeout)
FETCH_TIMEOUT。页面在发送响应体的过程中停止响应。可以调高 timeout,最大 30000 毫秒。
抓取失败(502 Bad Gateway)
FETCH_FAILED。无法读取响应体——连接被重置,或响应体不是可解码的文本。
摘要失败(500 Internal Server Error)
TOOL_ERROR。失败的调用不计费;只有摘要生成之后才会扣除 credits。
被 robots.txt 拦截(403 Forbidden)
目标站点的 robots.txt 对 CrawlForge 禁止了该路径。若你与目标站点另有约定,可设置 respect_robots: false 予以覆盖——该覆盖会记录到你的 API key 上。该覆盖不适用于列入 CrawlForge 永久排除名单的主机——无论 respect_robots 取何值,这类主机一律被拒绝。只有 url 形式会经过该检查——对你提供的 content 做摘要不会抓取任何内容,因此不会在这里被拒绝。
brief 会返回 No content to summarize,其他类型返回空结果,而不是报错。使用摘要前请先检查 total_sentences。credits 费用
max_sentences,都是同一价格。失败的调用不计费。包含内容:
传入 url 时抓取页面并剥离模板元素
句子切分,并过滤过短片段
段落、要点列表或单行输出
长度与压缩比统计
可选的页面元数据(标题、描述、作者、日期)
计划推荐:
Free 计划: 1,000 个一次性试用 credits = 250 次摘要
Hobby 计划: 5,000 credits = 1,250 次摘要($19/mo)
Professional 计划: 50,000 credits = 12,500 次摘要($99/mo)