> ## 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.

# 简介

> Firecrawl API 参考（v2）

<Note>
  \*\*对于 AI 代理：\*\*使用 [llms.txt](/zh/llms.txt) 查看所有文档的完整索引。
</Note>

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="Parse" icon="markdown" href="/zh/api-reference/endpoint/parse" color="FF713C">
    上传文件并将其解析为 markdown 或其他格式。
  </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">
    由 AI 驱动的自主网页数据采集。
  </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 密钥。

如果你是没有 API 密钥的代理，请先查看[获取凭据](/zh/ai-onboarding#get-credentials)。如果你的平台支持 WorkOS ID-JAG，请使用 [`auth.md`](https://www.firecrawl.dev/auth.md) 中的注册说明。

<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 'firecrawl';

  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` 代码表示服务器错误。

请参见[错误](/zh/api-reference/errors)了解完整参考，其中包括每种失败模式返回的 `error` 字符串、重试指导以及可直接复制粘贴的 backoff 代码片段。

<div id="429-responses">
  ## 429 响应
</div>

当你超出当前套餐的请求速率或并发限制时，API 会返回 `429` 状态码。请参见 [Rate Limits](/zh/rate-limits) 了解各套餐的限制，并请参见 [Errors](/zh/api-reference/errors) 获取重试指南。
