# 使用 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
{}
```
