POST https://api.acedata.cloud/webextrator/extract
在 /webextrator/render 的基礎上做內容抽取。除了 render 介面的全部參數,額外支援:
| 欄位 | 類型 | 必填 | 預設 | 說明 |
|---|---|---|---|---|
expected_type | string | ❌ | markdown | 期望抽取產物:markdown / article / text / links / structured |
enable_llm | boolean | ❌ | false | 啟用 LLM 後處理(適合 article / structured) |
instruction | string | ❌ | - | LLM 抽取指令,例如「抽取商品標題、價格、規格」 |
同步回應
{
"success": true,
"task_id": "550e8400-...",
"trace_id": "550e8400-...",
"started_at": "2026-05-02T10:30:00.123Z",
"finished_at": "2026-05-02T10:30:08.789Z",
"elapsed": 8.666,
"data": {
"kind": "extract",
"expected_type": "article",
"url": "https://example.com/post/1",
"title": "示例文章",
"author": "張三",
"published_at": "2026-05-01",
"content": "# 示例文章\n\n正文 ...",
"summary": "本文介紹 ..."
}
}
/webextrator/render 完全一致。
範例:抽取文章正文(啟用 LLM)
curl -X POST https://api.acedata.cloud/webextrator/extract \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/news/1",
"expected_type": "article",
"enable_llm": true
}'
範例:非同步 + 自訂結構化抽取
curl -X POST https://api.acedata.cloud/webextrator/extract \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://shop.example.com/item/123",
"expected_type": "structured",
"enable_llm": true,
"instruction": "抽取商品標題、價格、庫存、3 張主圖 URL",
"callback_url": "https://your-domain.com/wbx-callback"
}'

