webextrator
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWebExtrator Web Render & Extract
WebExtrator 网页渲染与提取
Render and extract web content through AceDataCloud's WebExtrator API — real headless Chromium plus a three-tier extraction pipeline (schema.org JSON-LD mapper → LLM typed extractor → Readability/markdown fallback).
Setup: See authentication for token setup.
通过AceDataCloud的WebExtrator API渲染并提取网页内容——基于真实无头Chromium,搭配三层提取流水线(schema.org JSON-LD映射器 → LLM类型提取器 → Readability/markdown降级方案)。
配置: 请查看身份认证了解令牌配置方法。
Quick Start
快速开始
bash
curl -X POST https://api.acedata.cloud/webextrator/extract \
-H "Authorization: Bearer $ACEDATACLOUD_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "expected_type": "general"}'Returns synchronously in seconds — no task polling needed.
bash
curl -X POST https://api.acedata.cloud/webextrator/extract \
-H "Authorization: Bearer $ACEDATACLOUD_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "expected_type": "general"}'同步返回结果,耗时仅数秒——无需轮询任务状态。
Endpoints
接口列表
| Path | Purpose |
|---|---|
| Headless Chromium render → raw HTML + clean text + title |
| Render + structured extraction (schema.org + LLM types) + markdown |
| Look up historical render/extract task envelopes (7-day retention, free) |
| 路径 | 用途 |
|---|---|
| 无头Chromium渲染 → 原始HTML + 纯净文本 + 标题 |
| 渲染 + 结构化提取(schema.org + LLM类型) + Markdown |
| 查询历史渲染/提取任务记录(免费保留7天) |
Workflows
工作流程
1. Extract typed content
1. 提取类型化内容
json
POST /webextrator/extract
{
"url": "https://example.com",
"expected_type": "general"
}Real response (trimmed):
json
{
"success": true,
"task_id": "604b1cfb-6c5a-42c9-b900-a281e1b9c3c5",
"trace_id": "f2a7c0b0-c17c-4bc9-b6e7-9c59746dd366",
"elapsed": 0.003,
"data": {
"kind": "extract",
"url": "https://example.com",
"finalUrl": "https://example.com/",
"contentType": "general",
"title": "Example Domain",
"description": "This domain is for use in documentation examples without needing permission. Avoid use in operations.",
"language": "en",
"images": [],
"links": [],
"markdown": "...",
"text": "...",
"structured": { "schemaOrg": {}, "openGraph": {}, "jsonLd": [] }
}
}json
POST /webextrator/extract
{
"url": "https://example.com",
"expected_type": "general"
}真实响应(已精简):
json
{
"success": true,
"task_id": "604b1cfb-6c5a-42c9-b900-a281e1b9c3c5",
"trace_id": "f2a7c0b0-c17c-4bc9-b6e7-9c59746dd366",
"elapsed": 0.003,
"data": {
"kind": "extract",
"url": "https://example.com",
"finalUrl": "https://example.com/",
"contentType": "general",
"title": "Example Domain",
"description": "This domain is for use in documentation examples without needing permission. Avoid use in operations.",
"language": "en",
"images": [],
"links": [],
"markdown": "...",
"text": "...",
"structured": { "schemaOrg": {}, "openGraph": {}, "jsonLd": [] }
}
}2. Render raw HTML
2. 渲染原始HTML
json
POST /webextrator/render
{
"url": "https://example.com",
"wait_until": "networkidle",
"block_resources": ["image", "media", "font"]
}Returns , , , , .
data.htmldata.textdata.titledata.statusdata.finalUrljson
POST /webextrator/render
{
"url": "https://example.com",
"wait_until": "networkidle",
"block_resources": ["image", "media", "font"]
}返回、、、、。
data.htmldata.textdata.titledata.statusdata.finalUrl3. Look up a task
3. 查询任务记录
json
POST /webextrator/tasks
{
"action": "retrieve",
"id": "604b1cfb-6c5a-42c9-b900-a281e1b9c3c5"
}json
POST /webextrator/tasks
{
"action": "retrieve",
"id": "604b1cfb-6c5a-42c9-b900-a281e1b9c3c5"
}Parameters
参数说明
Render & Extract (shared)
渲染与提取(通用参数)
| Parameter | Required | Description |
|---|---|---|
| Yes | Page URL to render ( |
| No | |
| No | Navigation timeout in seconds (default 30) |
| No | Extra wait in seconds after |
| No | CSS selector to wait for before ready |
| No | Drop |
| No | Extra request headers for the target site |
| No | Cookies to install before navigation |
| No | |
| No | Posted the final envelope when |
| No | Skip the Redis result cache for this request |
| No | Override cache TTL; |
| 参数 | 是否必填 | 描述 |
|---|---|---|
| 是 | 要渲染的页面URL(需以 |
| 否 | |
| 否 | 导航超时时间(单位:秒,默认30) |
| 否 | |
| 否 | 等待指定CSS选择器加载完成后再返回结果 |
| 否 | 屏蔽指定资源类型: |
| 否 | 向目标站点发送请求时添加的额外请求头 |
| 否 | 导航前植入的Cookie |
| 否 | |
| 否 | 当 |
| 否 | 跳过Redis结果缓存,强制重新处理请求 |
| 否 | 覆盖缓存过期时间;设为 |
Extract-only
仅提取专用参数
| Parameter | Required | Description |
|---|---|---|
| No | |
| No | Allow LLM extractor when schema.org found nothing (default false) |
| 参数 | 是否必填 | 描述 |
|---|---|---|
| 否 | |
| 否 | 当未检测到schema.org数据时,允许启用LLM提取器(默认值为false) |
Tasks
任务查询参数
| Parameter | Required | Description |
|---|---|---|
| Yes | |
| one of | For |
| one of | For |
| 参数 | 是否必填 | 描述 |
|---|---|---|
| 是 | |
| 二选一 | 用于 |
| 二选一 | 用于 |
Gotchas
注意事项
- Parameters use snake_case (,
wait_until), not camelCaseblock_resources - Cache hits are still billed; identical URLs return in ~0.003s
- only allows
expected_type/product/article— typed kinds (recipe/video/job) are detected automatically from schema.orggeneral - has no effect when the page ships schema.org JSON-LD — the deterministic mapper wins for free
enable_llm - Tasks API is free and retains records for 7 days only
- means "do not cache" — use
cache_ttl_seconds: 0to skip readbypass_cache
MCP:| Hosted:pip install mcp-webextrator| See all MCP servershttps://webextrator.mcp.acedata.cloud/mcp
- 参数采用蛇形命名法(、
wait_until),而非驼峰命名法block_resources - 命中缓存的请求仍会计费;相同URL的请求返回耗时约0.003秒
- 仅支持
expected_type/product/article——其他类型(食谱/视频/职位)会通过schema.org自动检测general - 当页面包含schema.org JSON-LD数据时,参数无效——此时会优先使用确定性映射器,无需额外成本
enable_llm - 任务查询API免费使用,记录仅保留7天
- 表示“不缓存”——若需跳过读取缓存,请使用
cache_ttl_seconds: 0参数bypass_cache
MCP:| 托管地址:pip install mcp-webextrator| 查看所有MCP服务器https://webextrator.mcp.acedata.cloud/mcp