# 基于图的网站遍历工具，使用 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
{}
```
