# 提交非同步批次擷取任務。

**API:** Data API

**Endpoint:** `POST /v1/beta/firecrawl/batch-scrape`

**Tags:** Firecrawl

提交非同步批次擷取。提供 urls；可選提供文件中說明的擷取選項。Idempotency-Key 為必填。HTTP 202 傳回一個任務；以其 id 呼叫對應的 Felo 輪詢端點，直到狀態為 completed、failed 或 cancelled。任務的價格欄位屬於供應商授權與結算中繼資料，並非 Felo 計費記錄。

### 計費參考

- 計量方式：依結果計量的參考值。
- 參考請求估算：無。
- 客戶單位參考價格：0.005 美元。

僅供參考的中繼資料，並非帳戶報價、保證價格或消費上限。資源額度並非 Felo 額度。最終費用依 Felo 計費記錄為準。

## Base URL

- `https://openapi.felo.ai`

## Authentication

- `FeloBearerAuth` (http bearer, bearer format Felo API Key)
- `FeloApiKey` (apiKey in header `X-API-Key`)

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | yes | string | 去除空白後的 UTF-8 長度必須為 1 到 191 位元組。 |

## Request body

Required: **yes**

### application/json

Schema:

```json
{
  "additionalProperties": false,
  "properties": {
    "excludeTags": {
      "items": {
        "description": "去除空白後非空；不得包含 CR/LF；UTF-8 位元組長度有上限。UTF-8 長度上限：128 位元組。",
        "pattern": "^[^\\r\\n]*\\S[^\\r\\n]*$(?![\\s\\S])",
        "type": "string"
      },
      "maxItems": 50,
      "type": [
        "array",
        "null"
      ]
    },
    "includeTags": {
      "items": {
        "description": "去除空白後非空；不得包含 CR/LF；UTF-8 位元組長度有上限。UTF-8 長度上限：128 位元組。",
        "pattern": "^[^\\r\\n]*\\S[^\\r\\n]*$(?![\\s\\S])",
        "type": "string"
      },
      "maxItems": 50,
      "type": [
        "array",
        "null"
      ]
    },
    "maxAge": {
      "maximum": 31536000000,
      "minimum": 0,
      "type": [
        "integer",
        "null"
      ]
    },
    "maxConcurrency": {
      "maximum": 20,
      "minimum": 1,
      "type": [
        "integer",
        "null"
      ]
    },
    "minAge": {
      "maximum": 31536000000,
      "minimum": 0,
      "type": [
        "integer",
        "null"
      ]
    },
    "onlyMainContent": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "timeout": {
      "maximum": 300000,
      "minimum": 1000,
      "type": [
        "integer",
        "null"
      ]
    },
    "urls": {
      "description": "去除空白與結尾斜線後，URL 也必須唯一。",
      "items": {
        "description": "含主機名的 HTTPS URL，不含認證資訊或片段。去除空白後以 .pdf 結尾的輸入（不分大小寫）不受支援。",
        "pattern": "^\\s*[hH][tT][tT][pP][sS]://",
        "type": "string"
      },
      "maxItems": 1000,
      "minItems": 1,
      "type": "array",
      "uniqueItems": true
    }
  },
  "required": [
    "urls"
  ],
  "type": "object"
}
```

Example:

```json
{
  "urls": [
    "https://example.com"
  ]
}
```

## Responses

### 202 — 成功

Headers:
- `X-Request-Id` (string) — 聯絡 Felo 支援時需提供的請求識別碼。

**application/json**

Schema: object

```json
{
  "properties": {
    "completedAt": {
      "format": "date-time",
      "type": [
        "string",
        "null"
      ]
    },
    "createdAt": {
      "format": "date-time",
      "type": [
        "string",
        "null"
      ]
    },
    "endpoint": {
      "type": [
        "string",
        "null"
      ],
      "description": "供應商操作識別碼；請使用文件中提供的 Felo 任務路徑進行輪詢。"
    },
    "error": {
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": [
        "object",
        "null"
      ]
    },
    "id": {
      "type": [
        "string",
        "null"
      ]
    },
    "object": {
      "const": "integration_async_job",
      "type": "string"
    },
    "output": {},
    "outputExpired": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "pricing": {
      "properties": {
        "authorizedMicrosUSD": {
          "type": [
            "integer",
            "null"
          ]
        },
        "billingMode": {
          "type": [
            "string",
            "null"
          ]
        },
        "currency": {
          "type": [
            "string",
            "null"
          ]
        },
        "finalMicrosUSD": {
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "type": [
        "object",
        "null"
      ],
      "description": "以微美元計的供應商授權與結算中繼資料；不是 Felo 餘額、凍結金額或帳單憑證。"
    },
    "status": {
      "enum": [
        "queued",
        "running",
        "completed",
        "failed",
        "cancelled"
      ],
      "type": "string"
    }
  },
  "required": [
    "completedAt",
    "createdAt",
    "endpoint",
    "error",
    "id",
    "object",
    "output",
    "pricing",
    "status"
  ],
  "type": "object"
}
```

### 400 — 無法處理該要求。請檢查請求參數。

### 401 — 需要有效的 Felo API 金鑰。

### 402 — 由於未符合計費要求，要求無法繼續。

### 403 — 該帳戶無權執行此操作。

### 429 — 已達到要求或支出上限。

### 502 — 服務無法完成該要求。

### 503 — API 或計費服務暫時無法使用。

### 504 — 服務在處理要求時逾時。

### default — 操作失敗。聯絡 Felo 支援時請保留回應的請求 ID。
