# 以圖為基礎的網站遍歷工具，使用 Tavily Crawl。

**API:** Data API

**Endpoint:** `POST /v1/beta/tavily/crawl`

**Tags:** Web Content

從根 `url` 遍歷網站，傳回所發現頁面的內容。以自然語言 `instructions` 加上正規表示式路徑與網域篩選器引導，並以 `max_depth`、`max_breadth` 與 `limit` 設限。傳回 `base_url` 與 `results[]`，其中包含 `url` 與 `raw_content`。適合對單一網站做廣泛涵蓋——文件、型錄、競品部落格。它會同步回應，`post_firecrawl_crawl` 則不會：後者以背景作業執行，適合無法等待的大型爬取。

### 計費參考

- 計量方式：依回應單位計量。
- 參考請求估算：0.024 美元。
- 單位成本基準：0.008 美元。
- 資源單位：`tavily_credit`。
- 參考客戶乘數：1.0。不得再次套用於已結算的客戶金額。
- 成本基礎不構成最終客戶價格，即使為零亦同。

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

## Base URL

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

## Authentication

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

## Request body

Required: **yes**

### application/json

Schema:

```json
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "開始爬取的根 URL。",
      "example": "docs.tavily.com"
    },
    "instructions": {
      "type": "string",
      "description": "給爬蟲的自然語言指示。"
    },
    "chunks_per_source": {
      "type": "integer",
      "default": 3,
      "description": "每個來源傳回的相關區塊最大數。",
      "minimum": 1,
      "maximum": 5
    },
    "max_depth": {
      "type": "integer",
      "default": 1,
      "description": "爬取的最大深度。",
      "minimum": 1,
      "maximum": 5
    },
    "max_breadth": {
      "type": "integer",
      "default": 20,
      "description": "樹的每一層最多跟隨的連結數。",
      "minimum": 1,
      "maximum": 500
    },
    "limit": {
      "type": "integer",
      "default": 50,
      "description": "爬蟲停止前會處理的連結總數。",
      "minimum": 1
    },
    "select_paths": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "用於僅選取具有特定路徑模式之 URL 的正規表達式模式。"
    },
    "select_domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "用於將爬取限定到特定網域或子網域的正規表達式模式。"
    },
    "exclude_paths": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "用於排除具有特定路徑模式之 URL 的正規表達式模式。"
    },
    "exclude_domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "用於在爬取時排除特定網域或子網域的正規表達式模式。"
    },
    "allow_external": {
      "type": "boolean",
      "default": true,
      "description": "在最終結果清單中包含外部網域連結。"
    },
    "include_images": {
      "type": "boolean",
      "default": false,
      "description": "在爬取結果中包含圖片。"
    },
    "extract_depth": {
      "type": "string",
      "enum": [
        "basic",
        "advanced"
      ],
      "default": "basic",
      "description": "擷取過程的深度。"
    },
    "format": {
      "type": "string",
      "enum": [
        "markdown",
        "text"
      ],
      "default": "markdown",
      "description": "擷取的網頁內容格式。"
    },
    "include_favicon": {
      "type": "boolean",
      "default": false,
      "description": "為每筆結果包含 favicon URL。"
    },
    "timeout": {
      "type": "number",
      "format": "float",
      "default": 150,
      "description": "爬取操作的最長等待時間（秒）。",
      "minimum": 10,
      "maximum": 150
    },
    "include_usage": {
      "type": "boolean",
      "default": false,
      "description": "在回應中包含額度用量資訊。"
    }
  },
  "required": [
    "url"
  ]
}
```

## Responses

### 200 — 已成功傳回爬取結果。

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

**application/json**

Schema: object

```json
{
  "type": "object",
  "properties": {
    "base_url": {
      "type": "string",
      "description": "被爬取的基準 URL。"
    },
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "已爬取頁面的 URL。"
          },
          "raw_content": {
            "type": "string",
            "description": "從頁面擷取的原始內容。"
          },
          "favicon": {
            "type": "string",
            "description": "已爬取頁面的 Favicon URL。"
          }
        }
      }
    },
    "response_time": {
      "type": "number",
      "format": "float",
      "description": "完成該請求所用的時間（秒）。"
    },
    "usage": {
      "type": "object",
      "properties": {
        "credits": {
          "type": "integer",
          "description": "此請求的額度用量詳情。"
        }
      }
    },
    "request_id": {
      "type": "string",
      "description": "唯一的請求識別碼。"
    }
  }
}
```

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

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

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

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

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

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

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

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

### default — 錯誤回應；上游透傳回應可能採用供應商格式

**application/json**

Schema:

```json
{}
```
