面向大规模网络搜索、抓取与交互的API。🔥 一个网络上下文API,帮你寻找来源、提取内容,并将其转换为干净的Markdown或结构化数据,供你的智能体直接使用。开源,并提供托管服务。
嘿,正在看的朋友,快来加入我们的star阵营吧 :)
为何选择 Firecrawl?
- 业界领先的可靠性:覆盖96%的网络,包括重度使用JavaScript的页面——无需为代理头疼,只需获取干净数据(查看基准测试)
- 极速响应:处理数百万页面的P95延迟仅为3.4秒,专为实时智能体和动态应用打造
- LLM就绪输出:提供干净的Markdown、结构化JSON、截图等内容——消耗更少token,构建更出色的AI应用
- 我们处理棘手难题:轮换代理、流程编排、速率限制、JS拦截内容等等——零配置即可使用
- 智能体就绪:只需一条命令即可将Firecrawl连接到任何AI智能体或MCP客户端
- 媒体解析:解析并提取托管在网页上的PDF、DOCX等文档内容
- 动作执行:在提取内容前执行点击、滚动、输入、等待、按键等操作
- 开源:开发过程透明且协作——加入我们的社区
功能概览
核心端点
更多功能
快速入门
前往 firecrawl.dev 注册获取你的API密钥。试用演练场(playground)来测试功能。
搜索
搜索网络并从结果中获取完整内容。
from firecrawl import Firecrawl
app = Firecrawl(api_key="fc-YOUR_API_KEY")
search_result = app.search("firecrawl", limit=5)
Node.js / cURL / CLI
Node.js
import { Firecrawl } from 'firecrawl';
const app = new Firecrawl({apiKey: "fc-YOUR_API_KEY"});
app.search("firecrawl", { limit: 5 })
cURL
curl -X POST 'https://api.firecrawl.dev/v2/search' \
-H 'Authorization: Bearer fc-YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"query": "firecrawl",
"limit": 5
}'
CLI
firecrawl search "firecrawl" --limit 5
输出:
[
{
"url": "https://firecrawl.dev",
"title": "Firecrawl",
"markdown": "Turn websites into..."
},
{
"url": "https://docs.firecrawl.dev",
"title": "Firecrawl Docs",
"markdown": "# Getting Started..."
}
]
抓取
从任何网站获取LLM就绪数据——Markdown、JSON、截图等。
from firecrawl import Firecrawl
app = Firecrawl(api_key="fc-YOUR_API_KEY")
result = app.scrape('firecrawl.dev')
Node.js / cURL / CLI
Node.js
import { Firecrawl } from 'firecrawl';
const app = new Firecrawl({ apiKey: "fc-YOUR_API_KEY" });
app.scrape('firecrawl.dev')
cURL
curl -X POST 'https://api.firecrawl.dev/v2/scrape' \
-H 'Authorization: Bearer fc-YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"url": "firecrawl.dev"
}'
CLI
firecrawl scrape https://firecrawl.dev
firecrawl https://firecrawl.dev --only-main-content
输出:
# Firecrawl
Firecrawl helps AI agents search, scrape, and interact with the web.
## Features
- Search: Find information across the web
- Scrape: Clean data from any page
- Interact: Click, navigate, and operate pages
- Agent: Autonomous data gathering
交互
抓取页面,然后通过AI提示或代码与之交互。
from firecrawl import Firecrawl
app = Firecrawl(api_key="fc-YOUR_API_KEY")
result = app.scrape("https://amazon.com")
scrape_id = result.metadata.scrape_id
app.interact(scrape_id, prompt="Search for 'mechanical keyboard'")
app.interact(scrape_id, prompt="Click the first result")
Node.js / cURL / CLI
Node.js
import { Firecrawl } from 'firecrawl';
const app = new Firecrawl({apiKey: "fc-YOUR_API_KEY"});
const result = await app.scrape("https://amazon.com");
await app.interact(result.metadata.scrapeId, {
prompt: "Search for 'mechanical keyboard'"
});
await app.interact(result.metadata.scrapeId, {
prompt: "Click the first result"
});
cURL
# 1. 抓取页面
curl -X POST 'https://api.firecrawl.dev/v2/scrape' \
-H 'Authorization: Bearer fc-YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"url": "https://amazon.com"}'
# 2. 与页面交互(使用步骤1中的 scrapeId)
curl -X POST 'https://api.firecrawl.dev/v2/scrape/SCRAPE_ID/interact' \
-H 'Authorization: Bearer fc-YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"prompt": "Search for mechanical keyboard"}'
CLI
firecrawl scrape https://amazon.com
firecrawl interact exec --prompt "Search for 'mechanical keyboard'"
firecrawl interact exec --prompt "Click the first result"
输出:
{
"success": true,
"output": "Keyboard available at $100",
"liveViewUrl": "https://liveview.firecrawl.dev/..."
}
赋能你的智能体
在几分钟内将Firecrawl连接到任何AI智能体或MCP客户端。
技能 (Skill)
通过一条命令让你的智能体轻松访问实时网络数据。
npx -y firecrawl-cli@latest init --all --browser
安装后重启你的智能体。适用于Claude Code、Antigravity、OpenCode等。
MCP
在几秒内将任何兼容MCP的客户端连接到网络。
{
"mcpServers": {
"firecrawl-mcp": {
"command": "npx",
"args": ["-y", "firecrawl-mcp"],
"env": {
"FIRECRAWL_API_KEY": "fc-YOUR_API_KEY"
}
}
}
}
智能体引导 (Agent Onboarding)
如果你是AI智能体?获取此技能来为你的用户注册、获取API密钥,并开始使用Firecrawl进行构建。
curl -s https://firecrawl.dev/agent-onboarding/SKILL.md
查看技能 + CLI 文档了解所有可用命令。关于MCP,请参阅firecrawl-mcp-server。
更多端点
智能体 (Agent)
从网络获取数据的最简单方法。 描述你的需求,我们的AI智能体会执行搜索、导航与检索。无需提供URL。
智能体是我们 /extract 端点的进化版:更快、更可靠,且无需你预先知道URL。
curl -X POST 'https://api.firecrawl.dev/v2/agent' \
-H 'Authorization: Bearer fc-YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"prompt": "Find the pricing plans for Notion"
}'
响应:
{
"success": true,
"data": {
"result": "Notion offers the following pricing plans:\n\n1. Free - $0/month...\n2. Plus - $10/seat/month...\n3. Business - $18/seat/month...",
"sources": ["https://www.notion.so/pricing"]
}
}
带结构化输出的智能体
使用模式(Schema)获取结构化数据:
from firecrawl import Firecrawl
from pydantic import BaseModel, Field
from typing import List, Optional
app = Firecrawl(api_key="fc-YOUR_API_KEY")
class Founder(BaseModel):
name: str = Field(description="Full name of the founder")
role: Optional[str] = Field(None, description="Role or position")
class FoundersSchema(BaseModel):
founders: List[Founder] = Field(description="List of founders")
result = app.agent(
prompt="Find the founders of Firecrawl",
schema=FoundersSchema
)
print(result.data)
{
"founders": [
{"name": "Eric Ciarla", "role": "Co-founder"},
{"name": "Nicolas Camara", "role": "Co-founder"},
{"name": "Caleb Peffer", "role": "Co-founder"}
]
}
带URL的智能体(可选)
让智能体专注于特定页面:
result = app.agent(
urls=["https://docs.firecrawl.dev", "https://firecrawl.dev/pricing"],
prompt="Compare the features and pricing information"
)
模型选择
根据需求在两种模型间选择:
| 模型 |
成本 |
最适合 |
spark-1-mini(默认) |
便宜60% |
大多数任务 |
spark-1-pro |
标准 |
复杂研究、关键数据收集 |
result = app.agent(
prompt="Compare enterprise features across Firecrawl, Apify, and ScrapingBee",
model="spark-1-pro"
)
何时使用 Pro:
在我们的智能体文档中了解更多关于Spark模型的信息。
爬取 (Crawl)
爬取整个网站并获取所有页面的内容。
curl -X POST 'https://api.firecrawl.dev/v2/crawl' \
-H 'Authorization: Bearer fc-YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"url": "https://docs.firecrawl.dev",
"limit": 100,
"scrapeOptions": {
"formats": ["markdown"]
}
}'
返回一个任务ID:
{
"success": true,
"id": "123-456-789",
"url": "https://api.firecrawl.dev/v2/crawl/123-456-789"
}