> ## Documentation Index
> Fetch the complete documentation index at: https://student-213fb9fc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 简介

> Firecrawl API 参考（v2）

Firecrawl API 为你提供以编程方式访问 Web 数据的能力。所有端点共享同一个基础 URL、认证机制和响应格式，详见本页。

<div id="features">
  ## 功能
</div>

<CardGroup cols={3}>
  <Card title="Scrape" icon="markdown" href="/zh/api-reference/endpoint/scrape" color="FF713C">
    以 markdown 或 json 格式从任意网页提取内容。
  </Card>

  <Card title="Crawl" icon="spider" href="/zh/api-reference/endpoint/crawl-post" color="FF713C">
    爬取整个网站，提取其内容和元数据。
  </Card>

  <Card title="Map" icon="map" href="/zh/api-reference/endpoint/map" color="FF713C">
    快速、可靠地获取任意网站的完整 URL 列表。
  </Card>

  <Card title="Search" icon="magnifying-glass" href="/zh/api-reference/endpoint/search" color="FF713C">
    搜索全网，并以任意格式获取完整页面内容。
  </Card>
</CardGroup>

<div id="agentic-features">
  ## Agent 功能
</div>

<CardGroup cols={3}>
  <Card title="Agent" icon="robot" href="/zh/api-reference/endpoint/agent" color="FF713C">
    自动导航网页并提取结构化数据。
  </Card>

  <Card title="Browser" icon="browser" href="/zh/api-reference/endpoint/browser-create" color="FF713C">
    创建并控制浏览器会话，以执行交互式 Web 任务。
  </Card>
</CardGroup>

<div id="base-url">
  ## 基础 URL
</div>

所有请求都使用以下基础 URL：

```bash theme={null}
https://api.firecrawl.dev
```

<div id="authentication">
  ## 身份验证
</div>

每个请求必须在 `Authorization` 请求头中包含 API 密钥：

```bash theme={null}
Authorization: Bearer fc-YOUR-API-KEY
```

在所有 API 调用中都要包含这个请求头。你可以在 [Firecrawl 控制台](https://www.firecrawl.dev/app/api-keys) 中找到你的 API 密钥。

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.firecrawl.dev/v2/scrape" \
    -H "Authorization: Bearer fc-YOUR-API-KEY" \
    -H "Content-Type: application/json" \
    -d '{"url": "https://example.com"}'
  ```

  ```python Python theme={null}
  from firecrawl import Firecrawl

  firecrawl = Firecrawl(api_key="fc-YOUR-API-KEY")

  result = firecrawl.scrape("https://example.com")
  ```

  ```js Node theme={null}
  import Firecrawl from '@mendable/firecrawl-js';

  const firecrawl = new Firecrawl({ apiKey: "fc-YOUR-API-KEY" });

  const result = await firecrawl.scrape('https://example.com');
  ```
</CodeGroup>

<div id="response-codes">
  ## 响应代码
</div>

Firecrawl 使用标准的 HTTP 状态码来指示请求的结果。`2xx` 范围内的代码表示成功，`4xx` 代码表示客户端错误，`5xx` 代码表示服务器错误。

| Status | Description              |
| ------ | ------------------------ |
| `200`  | 请求成功。                    |
| `400`  | 请求参数无效。                  |
| `401`  | 缺少 API key 或 API key 无效。 |
| `402`  | 需要付费。                    |
| `404`  | 未找到请求的资源。                |
| `429`  | 超出速率限制。                  |
| `5xx`  | Firecrawl 端的服务器错误。       |

当发生 `5xx` 错误时，响应体中会包含一个特定的错误码，帮助你诊断问题。

<div id="rate-limit">
  ## 速率限制
</div>

Firecrawl API 会对所有端点实施速率限制，以确保服务稳定。速率限制是基于特定时间窗口内的请求数量设定的。

当你超过速率限制时，API 会返回 `429` 状态码。请在短暂延迟后再重试该请求。
