# 使用 Tavily Map 生成完整的站点地图。

**API:** Data API

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

**Tags:** Web Content

从根 `url` 列出站点的 URL，不抓取任何页面内容。通过自然语言 `instructions` 和正则 `select_paths` / `exclude_paths` / `select_domains` 过滤器引导。返回 `base_url` 和 `results`——**一个扁平的 URL 字符串数组，而非对象**——并带有 `response_time` 和 `request_id`。用它先摸清站点规模，再决定是否爬取，然后用 `extractWebContent` 只获取真正重要的部分。如果你要的是内容而非站点结构，`post_tavily_crawl` 可一次调用同时完成两者。

### 计费参考

- 计量方式：按响应单位计量。
- 参考请求估算：0.064 美元。
- 单位成本基准：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": "给爬虫的自然语言指令。"
    },
    "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": "在最终结果列表中包含外部域名链接。"
    },
    "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": "string",
        "description": "映射过程中发现的 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
{}
```
