> ## Documentation Index
> Fetch the complete documentation index at: https://germeytechnology-docs-remove-4o-image-nav.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# WebExtrator 任務查詢 API

> WebExtrator Web Render & Extract 集成指南 - Ace Data Cloud

`POST https://api.acedata.cloud/webextrator/tasks` （**免費**）

查詢歷史 `render` / `extract` 任務（保留 7 天）。

## 單條查詢

```json theme={null}
{
  "action": "retrieve",
  "id": "550e8400-e29b-41d4-a716-446655440000"
}
```

或者透過 `trace_id`：

```json theme={null}
{
  "action": "retrieve",
  "trace_id": "550e8400-e29b-41d4-a716-446655440001"
}
```

返回單個任務物件（包含 `request` / `response` / `started_at` / `finished_at` 等欄位）。

## 批量查詢

```json theme={null}
{
  "action": "retrieve_batch",
  "ids": ["...", "..."],
  "limit": 12,
  "offset": 0
}
```

或者用 `trace_ids`，或兩者都不傳以分頁拉取自己的任務歷史。

返回：

```json theme={null}
{
  "items": [ { /* task */ }, ... ],
  "count": 2
}
```

## 欄位定義

| 欄位                                       | 說明                                  |
| ---------------------------------------- | ----------------------------------- |
| `id` / `task_id`                         | 任務唯一 ID                             |
| `trace_id`                               | 調用鏈 ID（與 PlatformGateway / CLS 對齊）  |
| `type`                                   | `render` 或 `extract`                |
| `request`                                | 原始請求體                               |
| `response`                               | 渲染 / 抽取結果（同 sync response 的 `data`） |
| `started_at` / `finished_at` / `elapsed` | 時間戳與耗時（秒）                           |

> 該介面免費、不計入用量。
