> ## Documentation Index
> Fetch the complete documentation index at: https://docs.firecrawl.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# FIRE-1 代理（测试版）

> FIRE-1 是一款 AI 代理，支持对网页进行智能导航与交互

FIRE-1 是一款 AI 代理，通过智能的网页导航与交互增强了 Firecrawl 的抓取能力。它可处理分页、控制浏览器 actions，并在复杂的网站结构中导航，从而实现超越传统抓取方式的全面数据提取。

<div id="what-fire-1-can-do">
  ### FIRE-1 能做什么：
</div>

* 自动浏览并处理分页内容。
* 与按钮、链接、输入框和动态元素交互。
* 跨多个页面执行高级抽取任务。

<div id="enabling-fire-1-agent">
  ## 启用 FIRE-1（代理）
</div>

要启用 FIRE-1（代理），你需要在对 `scrape` 或 `extract` 端点的 API 请求负载中包含 `agent` 对象。

`agent` 对象包含以下属性：

* `model`（string，可选）：指定要使用的 AI 模型。如果未提供，默认为 `FIRE-1`。当前仅提供 `FIRE-1` 模型。
* `prompt`（string，对 `scrape` 端点必填）：为 AI 代理提供指令，描述要查找的内容以及如何在网站上导航（例如如何处理分页、需要点击的按钮等）。在 `/extract` 中将使用 `prompt` 参数中提供的内容。

<div id="using-fire-1-with-the-scrape-endpoint">
  ### 将 FIRE-1 与 /scrape 端点配合使用
</div>

你可以在 `/v1/scrape` 端点中使用 FIRE-1（代理），在抓取最终内容前先进行智能导航。

**示例（cURL）：**

```bash theme={null}
curl -X POST https://api.firecrawl.dev/v1/scrape \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer YOUR_API_KEY' \
    -d '{
      "url": "https://example.com/products?page=1",
      "formats": ["markdown"],
      "agent": {
        "model": "FIRE-1",
        "prompt": "点击“下一页”按钮在商品列表中依次浏览，直到该按钮变为不可用为止。抓取每个访问页面的内容。"
      }
    }'
```

在此示例中，已指示 FIRE-1（代理）在进行最终抓取前对产品列表进行分页。

<div id="using-fire-1-with-the-extract-endpoint">
  ### 使用 FIRE-1 与 /extract 端点
</div>

同样，你也可以通过 `/v1/extract` 端点使用 FIRE-1（代理），处理需要跨多个页面导航或与页面元素交互的复杂提取任务。

**示例 (cURL) ：**

```bash theme={null}
curl -X POST https://api.firecrawl.dev/v1/extract \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer YOUR_API_KEY' \
    -d '{
      "urls": ["https://example-forum.com/topic/123"],
      "prompt": "Extract all user comments from this forum thread.",
      "schema": {
        "type": "object",
        "properties": {
          "comments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "author": {"type": "string"},
                "comment_text": {"type": "string"}
              },
              "required": ["author", "comment_text"]
            }
          }
        },
        "required": ["comments"]
      },
      "agent": {
        "model": "FIRE-1"
      }
    }'
```

在这里，代理会先与 "Load More Comments" 按钮交互，确保页面上的所有评论都已加载，然后再根据提供的 schema 和 prompt 开始提取流程。
**注意：** FIRE-1（代理）功能强大，但根据导航指令的复杂程度以及交互页面的数量，可能会消耗更多额度。

<div id="meet-fire-1-intelligent-navigation-and-interaction">
  ### 了解 FIRE-1：智能导航与交互
</div>

<img src="https://mintlify.s3.us-west-1.amazonaws.com/firecrawl/launch-week/lw3-d2-3.webp" alt="FIRE-1 代理可视化" />

FIRE-1 为 Firecrawl 带来了全新的智能能力，可在复杂的网站结构中导航、处理分页、与动态内容交互等，从而提升你的抓取任务效果。这个强大的 AI 代理能够实现超越传统抓取方式的更全面数据提取。

<div id="what-fire-1-can-do">
  ### FIRE-1 能做什么：
</div>

* 自动穿梭并处理分页内容。
* 与按钮、链接和动态元素进行交互。
* 跨多个页面执行复杂的提取任务。

<div id="how-to-enable-fire-1">
  ## 如何启用 FIRE-1
</div>

启用 FIRE-1 十分简单。只需在你的 /scrape 或 /extract API 请求中包含一个 `agent` 对象即可：

```json theme={null}
"agent": {
  "model": "FIRE-1",
  "prompt": "在此填写详细的导航指令。"
}
```

*注意：* 发起 scrape 请求时必须提供 `prompt` 字段，用于精确指示 FIRE-1 如何与网页交互。

<div id="example-usage-with-scrape-endpoint">
  ## 使用 /scrape 端点 的示例
</div>

下面通过一个简短示例，展示如何使用 FIRE-1 和 /scrape 端点 对产品列表进行分页：

```bash theme={null}
curl -X POST https://api.firecrawl.dev/v1/scrape \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{
    "url": "https://example.com/products?page=1",
    "formats": ["markdown"],
    "agent": {
      "model": "FIRE-1",
      "prompt": "Navigate through the product listings by clicking the \'Next Page\' button until disabled. Scrape each page."
    }
  }'
```

在这种情况下，FIRE-1 会智能处理分页，并收集所有产品。

<div id="considerations">
  ## 注意事项
</div>

* 使用 FIRE-1 可能会因任务复杂度和交互深度不同而消耗更多额度。
* 请确保你的 prompt 能清晰地引导 FIRE-1，以优化结果和效率。

<div id="start-using-fire-1-today">
  ## 立即开始使用 FIRE-1
</div>

立刻体验网页抓取的未来：

* **试用 FIRE-1：** 将智能导航集成到你的抓取与提取工作流中。
* **查阅文档：** 在我们的[完整文档](https://docs.firecrawl.dev/agents/fire-1)中了解更多。
* **需要帮助？** 加入我们的[Discord 社区](https://discord.gg/S7Enyh9Abh)或发送邮件至[help@firecrawl.com](mailto:help@firecrawl.com)。
  **准备好利用 AI 赋能的抓取了吗？** [注册 Firecrawl](https://firecrawl.dev/signup)，立即开始使用 FIRE-1。
