# 執行神經網路語意搜尋。

**API:** Data API

**Endpoint:** `POST /v1/beta/exa/search`

**Tags:** Exa

依語意而非關鍵字搜尋網路。`query` 為必填；可透過 `category`、`includeDomains`、`excludeDomains`、`startPublishedDate`、`endPublishedDate` 縮小範圍，並設定 `numResults`。傳回 `requestId`、`resolvedSearchType`、`searchTime`、`costDollars` 以及包含 `id`、`title` 與 `url` 的 `results[]`。**`id` 就是 URL**，也是 `post_exa_contents` 接受的值。⚠️ 除非主動要求，否則結果**不含頁面文字**：傳入 `contents`，或隨後呼叫 `post_exa_contents`。當查詢是一段描述而非關鍵字時，優先使用它而非 `searchWeb`；若希望同一次呼叫就取得文字，請選 Tavily；若需要書面回答而非清單，請用 `post_exa_answer`。

### 計費參考

- 計量方式：依回報的回應成本計量。
- 參考請求估算：0.017 美元。
- 參考客戶倍率：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": {
    "query": {
      "type": "string",
      "description": "自然語言搜尋查詢。",
      "example": "latest evaluation frameworks for AI agents"
    },
    "type": {
      "type": "string",
      "enum": [
        "auto",
        "fast",
        "instant",
        "deep-lite",
        "deep",
        "deep-reasoning"
      ],
      "default": "auto",
      "description": "搜尋模式。auto 讓 Exa 自行選擇；deep 系列模式以更高延遲換取更高品質的檢索。"
    },
    "numResults": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100,
      "default": 10,
      "description": "要傳回的結果筆數。"
    },
    "category": {
      "type": "string",
      "enum": [
        "company",
        "research paper",
        "news",
        "personal site",
        "financial report",
        "people"
      ],
      "description": "關於優先考慮何種頁面的選填提示。"
    },
    "includeDomains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "僅傳回這些網域的結果。"
    },
    "excludeDomains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "排除這些網域的結果。"
    },
    "startPublishedDate": {
      "type": "string",
      "format": "date-time",
      "description": "僅傳回在此 ISO 8601 日期或之後發布的結果。"
    },
    "endPublishedDate": {
      "type": "string",
      "format": "date-time",
      "description": "僅傳回在此 ISO 8601 日期或之前發布的結果。"
    },
    "contents": {
      "type": "object",
      "description": "隨每筆結果一併傳回的內容選項。",
      "properties": {
        "text": {
          "type": "boolean",
          "description": "傳回完整頁面文字。"
        },
        "highlights": {
          "type": "boolean",
          "description": "傳回醒目的相關片段。"
        },
        "summary": {
          "type": "boolean",
          "description": "傳回頁面由 AI 產生的摘要。"
        }
      }
    },
    "outputSchema": {
      "type": "object",
      "description": "用於從結果合成結構化輸出的 JSON Schema。"
    },
    "systemPrompt": {
      "type": "string",
      "description": "指導如何產生結構化輸出的指令。"
    },
    "stream": {
      "default": false,
      "enum": [
        false
      ],
      "type": "boolean"
    }
  },
  "required": [
    "query"
  ]
}
```

## Responses

### 200 — 搜尋成功完成。

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

**application/json**

Schema: object

```json
{
  "type": "object",
  "properties": {
    "requestId": {
      "type": "string",
      "description": "Exa 請求識別碼。"
    },
    "results": {
      "type": "array",
      "description": "排序後的搜尋結果。",
      "items": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "publishedDate": {
            "type": "string"
          },
          "author": {
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        }
      }
    },
    "output": {
      "description": "結構化輸出，僅在提供 outputSchema 時存在。"
    },
    "costDollars": {
      "description": "資源使用的供應商成本明細。僅供參考；不是 Felo 客戶扣費或 Felo 帳單憑證。"
    }
  }
}
```

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

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

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

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

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

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

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

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

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

**application/json**

Schema:

```json
{}
```
