POST
/batch/extract
批次擷取多個頁面

使用 AI 同時從多個 URL 擷取結構化資料。

使用場景:

  • 從多個頁面抓取產品目錄
  • 從搜尋結果頁面擷取資料
  • 批次處理列表或目錄頁面
  • 大規模收集競品情報

工作原理:

  1. 提交最多 50 個 URL 和單個 Schema
  2. 立即取得任務 ID 回應
  3. 所有 URL 使用相同 Schema 擷取
  4. 輪詢狀態或接收 Webhook 通知
  5. 一次取得所有結構化結果

功能特性:

  • 相同 Schema 應用於所有 URL
  • 並行處理提升速度
  • 每個 URL 獨立錯誤處理
  • 支援 Webhook 通知

授權

YOUR_API_KEY
授權Bearer <token>

在 Thunderbit Dashboard 取得 API key。標頭格式:Authorization: Bearer YOUR_API_KEY

位置: header

請求體

application/json

TypeScript Definitions

Use the request body type in TypeScript.

urls*string[]必填

要擷取資料的 URL 列表,最多 50 個

範例:
[
  "https://example.com/product/1",
  "https://example.com/product/2",
  "https://example.com/product/3"
]
schema*object必填

JSON Schema 格式的資料結構定義

範例:
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "price": {
      "type": "number"
    },
    "rating": {
      "type": "number"
    }
  }
}
timeoutnumber預設值:60000

每個請求的逾時時間(毫秒),預設 30000

webhookobject

Webhook 回呼配置,任務完成時通知。查看 Webhooks 指南 瞭解回呼負載、請求標頭和 HMAC-SHA256 簽章驗證。

展開子屬性
urlstring

Webhook callback URL, must be HTTPS

secretstring

HMAC-SHA256 secret for signature verification. When set, each webhook request includes an X-Webhook-Signature header

範例:whsec_your_secret_key
headersobject

Custom headers (reserved for future use, not yet implemented by the server).

範例:
{
  "X-Custom-Auth": "your-token"
}
renderModestring預設值:"none"

JavaScript rendering mode applied to every URL: none (default, fastest), basic, or full.

取值範圍"none" | "basic" | "full"

回應

application/json

Success response

successboolean
範例:
true
dataobject
展開子屬性
idstring
範例:batch_ext_xyz789
statusstring
取值範圍"PENDING" | "PROCESSING" | "COMPLETED" | "FAILED" | "CANCELLED" | "UNKNOWN"
範例:PROCESSING
totalinteger
範例:
3
completedinteger
範例:
0
creditsUsedinteger
範例:
0
createdAtstring

Timestamp when the job was created

completedAtstring

Timestamp when the job completed (null if still processing)