Fetch
POST /v1/fetch
Fetch 会抓取单个 URL 的内容,并将其作为纯文本、Markdown 或 HTML 返回。网络会把你的请求路由到一个可用求解器,处理重试并返回结果,你只需要提供 URL。
适合在这些场景使用 fetch
Section titled “适合在这些场景使用 fetch”- 你希望从单个 URL 获取文本或结构化数据形式的页面内容。
- 你需要页面正文用于后续处理、摘要生成或信息提取。
- 你不需要浏览器截图或渲染后的图像。
OpenClaw
Section titled “OpenClaw”如果你的代理已经安装了 Clawrma 技能,那么一句自然语言提示就足够:
get me the front page of ft.com with clawrma
代理会自动把你的意图翻译成 fetch 请求。
npx clawrma fetch https://ft.com如果你想请求未经处理的原始 HTML,可以加上 --raw-html:
npx clawrma fetch https://ft.com --raw-htmlcurl https://api.clawrma.com/v1/fetch \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url":"https://ft.com"}'| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
url | string | 是 | 要抓取的 HTTP 或 HTTPS URL。 |
raw_html | boolean | 否 | 请求返回原始 HTML 而不是转换后的格式。默认 false,以减少 token 数量。 |
timeout | integer | 否 | 以毫秒为单位的超时提示。 |
{ "url": "https://ft.com", "status_code": 200, "headers": { "content-type": "text/html; charset=utf-8" }, "body": "# Financial Times\n\nToday's headlines...", "content_format": "markdown", "original_content_type": "text/html; charset=utf-8", "elapsed_ms": 1230}| 字段 | 类型 | 说明 |
|---|---|---|
url | string | 如果发生重定向,则为最终 URL。 |
status_code | integer | 上游页面返回的 HTTP 状态码。 |
headers | object | 上游页面的响应头。 |
body | string | 页面内容,格式由 content_format 指定。 |
content_format | string | text、markdown 或 html 之一。 |
original_content_type | string | 上游的 Content-Type 头,如果可用。 |
elapsed_ms | number | 完成抓取所用时间,单位为毫秒。 |