# 执行网络搜索并返回按排名排列的结果。

**API:** Data API

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

**Tags:** Firecrawl

搜索网络并返回按排名排列的结果。`query` 为必填；`limit` 设置数量。返回 `success`、`creditsUsed`、请求 `id`，以及包含 `url`、`title`、`description` 和 `position` 的 `data.web[]`——**仅标题和摘要，不含页面文本**。以下情况请改用其他工具：希望同一次调用拿到页面文本——`searchWeb` 会返回文本，且耗时只有三分之一；已知 URL——`post_firecrawl_scrape`；希望按语义而非关键词判断相关性——`post_exa_search`。

### 计费参考

- 计量方式：按结果数量计量。
- 参考请求估算：0.002142 美元。
- 单位成本基准：0.001071 美元。
- 资源单位：`firecrawl_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
{
  "additionalProperties": false,
  "properties": {
    "enterprise": {
      "default": false,
      "enum": [
        false
      ],
      "type": "boolean"
    },
    "limit": {
      "default": 10,
      "maximum": 100,
      "minimum": 1,
      "type": "integer"
    },
    "query": {
      "maxLength": 2000,
      "minLength": 1,
      "type": "string"
    },
    "sources": {
      "default": [
        "web"
      ],
      "enum": [
        [
          "web"
        ]
      ],
      "items": {
        "type": "string"
      },
      "maxItems": 1,
      "minItems": 1,
      "type": "array"
    }
  },
  "required": [
    "query"
  ],
  "type": "object"
}
```

Example:

```json
{
  "enterprise": false,
  "limit": 10,
  "query": "nike",
  "sources": [
    "web"
  ]
}
```

## Responses

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

Headers:
- `X-Request-Id` (string) — 联系 Felo 支持时需提供的请求标识符。

**application/json**

Schema: object

```json
{
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "search 成功时为 true。"
    },
    "data": {
      "type": "object",
      "properties": {
        "web": {
          "type": "array",
          "description": "排序后的网页搜索结果。",
          "items": {
            "type": "object",
            "properties": {
              "title": {
                "type": "string",
                "description": "结果标题。"
              },
              "url": {
                "type": "string",
                "description": "结果 URL。"
              },
              "description": {
                "type": "string",
                "description": "结果摘要。"
              }
            }
          }
        }
      }
    },
    "creditsUsed": {
      "type": "integer",
      "description": "消耗的 Firecrawl 额度（每 10 条结果约 2 个）。"
    }
  }
}
```

### 400 — 无法处理该请求。请检查请求参数。

### 401 — 需要有效的 Felo API 密钥。

### 402 — 由于未满足计费要求，请求无法继续。

### 403 — 该账户无权执行此操作。

### 429 — 已达到请求或支出限额。

### 502 — 服务无法完成该请求。

### 503 — API 或计费服务暂时不可用。

### 504 — 服务在处理请求时超时。

### default — 错误响应；上游透传响应可能采用提供方格式

**application/json**

Schema:

```json
{}
```
