Firecrawl:大规模搜索、爬取与交互式网页 API
英文标题:🔥 firecrawl/firecrawl
Firecrawl 是一个开源 Web 上下文 API,能够可靠覆盖 96% 的网页并提取清洗后的 Markdown、结构化 JSON 等内容,为 AI 智能体和应用提供 LLM 就绪数据。其核心端点包括搜索、爬取、交互和智能体自主数据收集,支持在无代理头疼问题的情况下运行,P95 延迟仅 3.4 秒。开发者可通过简单的 API 调用或 SDK 将实时网页数据接入 Claude Code、MCP 客户端等工具。该工具可通过托管服务或自托管使用,极大降低了构建数据驱动 AI 应用的复杂性。
8.7 KB
193.5 KB
111.1 KB
中文
大规模搜索、爬取并交互网页的 API。🔥 这是一款 Web 上下文 API,用于查找来源、提取内容并将其转换为干净的 Markdown 或结构化数据,供你的智能体直接使用。开源并可作为托管服务 获取。
喂,说你呢,来给我们点个星星吧 :)
- 业界领先的可靠性:覆盖 96% 的网页,包括重度 JavaScript 页面——无需为代理头疼,只需干净数据(查看基准测试)
- 极快速度:数百万页面的 P95 延迟为 3.4 秒,为实时智能体和动态应用而构建
- LLM 就绪输出:干净的 Markdown、结构化 JSON、截图等——消耗更少 token,构建更好的 AI 应用
- 我们处理棘手部分:轮换代理、编排、速率限制、JS 阻塞内容等——零配置
- 智能体就绪:通过一条命令将 Firecrawl 连接到任何 AI 智能体或 MCP 客户端
- 媒体解析:解析并提取网页托管的 PDF、DOCX 等内容
- 操作:在提取内容前可进行点击、滚动、写入、等待和按键
- 开源:透明协作开发——加入我们的社区
核心端点
| 特性 | 描述 |
|---|---|
| 搜索 | 搜索网页并从结果中获取完整页面内容 |
| 爬取 | 将任意 URL 转换为 Markdown、HTML、截图或结构化 JSON |
| 交互 | 爬取页面,然后使用 AI 提示或代码与之交互 |
更多功能
| 特性 | 描述 |
|---|---|
| 智能体 | 自动化数据收集,只需描述你需要什么 |
| 整站爬取 | 单次请求爬取一个网站的所有 URL |
| 地图 | 即时发现网站上的所有 URL |
| 批量爬取 | 异步爬取数千个 URL |
在 firecrawl.dev 注册获取 API 密钥。尝试使用游乐场 进行测试。
搜索网页并从结果中获取完整内容。
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 systems 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. 与页面交互(使用第一步的 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 客户端。
通过一条命令让你的智能体轻松访问实时 Web 数据。
npx -y firecrawl-cli@latest init --all --browser
安装后重启你的智能体。适用于 Claude Code、Antigravity、OpenCode 等。
几秒内将任意兼容 MCP 的客户端连接到网络。
{
"mcpServers": {
"firecrawl-mcp": {
"command": "npx",
"args": ["-y", "firecrawl-mcp"],
"env": {
"FIRECRAWL_API_KEY": "fc-YOUR_API_KEY"
}
}
}
}
你是 AI 智能体吗?获取此技能以注册用户、获取 API 密钥并开始使用 Firecrawl。
curl -s https://firecrawl.dev/agent-onboarding/SKILL.md
查看技能 + CLI 文档 了解所有可用命令。关于 MCP,请参阅 firecrawl-mcp-server。
从网络获取数据的最简单方式。 描述你需要什么,我们的 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 模型的更多信息。
爬取整个网站并获取所有页面的内容。
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"
}
curl -X GET 'https://api.firecrawl.dev/v2/crawl/123-456-789' \
-H 'Authorization: Bearer fc-YOUR_API_KEY'
{
"status": "completed",
"total": 50,
"completed": 50,
"creditsUsed": 50,
"data": [
{
"markdown": "# Page Title\n\nContent...",
"metadata": {"title": "Page Title", "sourceURL": "https://..."}
}
]
}
注意: SDK 会自动处理轮询以提供更好的开发体验。
即时发现网站上的所有 URL。
curl -X POST 'https://api.firecrawl.dev/v2/map' \
-H 'Authorization: Bearer fc-YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"url": "https://firecrawl.dev"}'
响应:
{
"success": true,
"links": [
{"url": "https://firecrawl.dev", "title": "Firecrawl", "description": "Turn websites into LLM-ready data"},
{"url": "https://firecrawl.dev/pricing", "title": "Pricing", "description": "Firecrawl pricing plans"},
{"url": "https://firecrawl.dev/blog", "title": "Blog", "description": "Firecrawl blog"}
]
}
在网站内查找特定 URL:
from firecrawl import Firecrawl
app = Firecrawl(api_key="fc-YOUR_API_KEY")
result = app.map("https://firecrawl.dev", search="pricing")
# 返回按与 "pricing" 的相关性排序的 URL
一次性爬取多个 URL:
from firecrawl import Firecrawl
app = Firecrawl(api_key="fc-YOUR_API_KEY")
job = app.batch_scrape([
"https://firecrawl.dev",
"https://docs.firecrawl.dev",
"https://firecrawl.dev/pricing"
], formats=["markdown"])
for doc in job.data:
print(doc.metadata.source_url)
我们的 SDK 提供了一种便捷的方式来使用所有 Firecrawl 功能,并自动处理异步操作的轮询。
安装 SDK:
from firecrawl import Firecrawl
app = Firecrawl(api_key="fc-YOUR_API_KEY")
# 爬取单个 URL
doc = app.scrape("https://firecrawl.dev", formats=["markdown"])
print(doc.markdown)
# 使用智能体进行自主数据收集
result = app.agent(prompt="Find the founders of Stripe")
print(result.data)
# 爬取网站(自动等待完成)
docs = app.crawl("https://docs.firecrawl.dev", limit=50)
for doc in docs.data:
print(doc.metadata.source_url, doc.markdown[:100])
# 搜索网页
results = app.search("best AI data tools 2024", limit=10)
print(results)
安装 SDK:
import { Firecrawl } from 'firecrawl';
const app = new Firecrawl({ apiKey: 'fc-YOUR_API_KEY' });
// 爬取单个 URL
const doc = await app.scrape('https://firecrawl.dev', { formats: ['markdown'] });
console.log(doc.markdown);
// 使用智能体进行自主数据收集
const result = await app.agent({ prompt: 'Find the founders of Stripe' });
console.log(result.data);
// 爬取网站(自动等待完成)
const docs = await app.crawl('https://docs.firecrawl.dev', { limit: 50 });
docs.data.forEach(doc => {
console.log(doc.metadata.sourceURL, doc.markdown.substring(0, 100));
});
// 搜索网页
const results = await app.search('best AI data tools 2024', { limit: 10 });
results.data.web.forEach(result => {
console.log(`${result.title}: ${result.url}`);
});
添加依赖([Gradle/Maven](https://docs.firecrawl.dev/sdks/jav
English / 原文
The API to search, scrape, and interact with the web at scale. 🔥 The web context API to find sources, extract content, and turn it into clean Markdown or structured data your agents can ship with. Open source and available as a hosted service.
Pst. Hey, you, join our stargazers :)
- Industry-leading reliability : Covers 96% of the web, including JS-heavy pages — no proxy headaches, just clean data (see benchmarks)
- Blazingly fast : P95 latency of 3.4s across millions of pages, built for real-time agents and dynamic apps
- LLM-ready output : Clean markdown, structured JSON, screenshots, and more — spend fewer tokens, build better AI apps
- We handle the hard stuff : Rotating proxies, orchestration, rate limits, JS-blocked content, and more — zero configuration
- Agent ready : Connect Firecrawl to any AI agent or MCP client with a single command
- Media parsing : Parse and extract content from web-hosted PDFs, DOCX, and more
- Actions : Click, scroll, write, wait, and press before extracting content
- Open source : Developed transparently and collaboratively — join our community
Core Endpoints
| Feature | Description |
|---|---|
| Search | Search the web and get full page content from results |
| Scrape | Convert any URL to markdown, HTML, screenshots, or structured JSON |
| Interact | Scrape a page, then interact with it using AI prompts or code |
More
| Feature | Description |
|---|---|
| Agent | Automated data gathering, just describe what you need |
| Crawl | Scrape all URLs of a website with a single request |
| Map | Discover all URLs on a website instantly |
| Batch Scrape | Scrape thousands of URLs asynchronously |
Sign up at firecrawl.dev to get your API key. Try the playground to test it out.
Search the web and get full content from results.
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
Output:
[
{
"url": "https://firecrawl.dev",
"title": "Firecrawl",
"markdown": "Turn websites into..."
},
{
"url": "https://docs.firecrawl.dev",
"title": "Firecrawl Docs",
"markdown": "# Getting Started..."
}
]
Get LLM-ready data from any website — markdown, JSON, screenshots, and more.
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
Output:
# Firecrawl
Firecrawl helps AI systems 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
Scrape a page, then interact with it using AI prompts or code.
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. Scrape the page
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. Interact with the page (use scrapeId from step 1)
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"
Output:
{
"success": true,
"output": "Keyboard available at $100",
"liveViewUrl": "https://liveview.firecrawl.dev/..."
}
Connect Firecrawl to any AI agent or MCP client in minutes.
Give your agent easy access to real-time web data with one command.
npx -y firecrawl-cli@latest init --all --browser
Restart your agent after installing. Works with Claude Code, Antigravity, OpenCode, and more.
Connect any MCP-compatible client to the web in seconds.
{
"mcpServers": {
"firecrawl-mcp": {
"command": "npx",
"args": ["-y", "firecrawl-mcp"],
"env": {
"FIRECRAWL_API_KEY": "fc-YOUR_API_KEY"
}
}
}
}
Are you an AI agent? Fetch this skill to sign up your user, get an API key, and start building with Firecrawl.
curl -s https://firecrawl.dev/agent-onboarding/SKILL.md
See the Skill + CLI documentation for all available commands. For MCP, see firecrawl-mcp-server.
The easiest way to get data from the web. Describe what you need, and our AI agent searches, navigates, and retrieves it. No URLs required.
Agent is the evolution of our /extract endpoint: faster, more reliable, and doesn't require you to know the URLs upfront.
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"
}'
Response:
{
"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"]
}
}
Agent with Structured Output
Use a schema to get structured data:
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"}
]
}
Agent with URLs (Optional)
Focus the agent on specific pages:
result = app.agent(
urls=["https://docs.firecrawl.dev", "https://firecrawl.dev/pricing"],
prompt="Compare the features and pricing information"
)
Choose between two models based on your needs:
| Model | Cost | Best For |
|---|---|---|
spark-1-mini (default) |
60% cheaper | Most tasks |
spark-1-pro |
Standard | Complex research, critical data gathering |
result = app.agent(
prompt="Compare enterprise features across Firecrawl, Apify, and ScrapingBee",
model="spark-1-pro"
)
When to use Pro:
- Comparing data across multiple websites
- Extracting from sites with complex navigation or auth
- Research tasks where the agent needs to explore multiple paths
- Critical data where accuracy is paramount
Learn more about Spark models in our Agent documentation.
Crawl an entire website and get content from all pages.
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"]
}
}'
Returns a job ID:
{
"success": true,
"id": "123-456-789",
"url": "https://api.firecrawl.dev/v2/crawl/123-456-789"
}
curl -X GET 'https://api.firecrawl.dev/v2/crawl/123-456-789' \
-H 'Authorization: Bearer fc-YOUR_API_KEY'
{
"status": "completed",
"total": 50,
"completed": 50,
"creditsUsed": 50,
"data": [
{
"markdown": "# Page Title\n\nContent...",
"metadata": {"title": "Page Title", "sourceURL": "https://..."}
}
]
}
Note: The SDKs handle polling automatically for a better developer experience.
Discover all URLs on a website instantly.
curl -X POST 'https://api.firecrawl.dev/v2/map' \
-H 'Authorization: Bearer fc-YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"url": "https://firecrawl.dev"}'
Response:
{
"success": true,
"links": [
{"url": "https://firecrawl.dev", "title": "Firecrawl", "description": "Turn websites into LLM-ready data"},
{"url": "https://firecrawl.dev/pricing", "title": "Pricing", "description": "Firecrawl pricing plans"},
{"url": "https://firecrawl.dev/blog", "title": "Blog", "description": "Firecrawl blog"}
]
}
Find specific URLs within a site:
from firecrawl import Firecrawl
app = Firecrawl(api_key="fc-YOUR_API_KEY")
result = app.map("https://firecrawl.dev", search="pricing")
# Returns URLs ordered by relevance to "pricing"
Scrape multiple URLs at once:
from firecrawl import Firecrawl
app = Firecrawl(api_key="fc-YOUR_API_KEY")
job = app.batch_scrape([
"https://firecrawl.dev",
"https://docs.firecrawl.dev",
"https://firecrawl.dev/pricing"
], formats=["markdown"])
for doc in job.data:
print(doc.metadata.source_url)
Our SDKs provide a convenient way to use all Firecrawl features and automatically handle polling for async operations.
Install the SDK:
from firecrawl import Firecrawl
app = Firecrawl(api_key="fc-YOUR_API_KEY")
# Scrape a single URL
doc = app.scrape("https://firecrawl.dev", formats=["markdown"])
print(doc.markdown)
# Use the Agent for autonomous data gathering
result = app.agent(prompt="Find the founders of Stripe")
print(result.data)
# Crawl a website (automatically waits for completion)
docs = app.crawl("https://docs.firecrawl.dev", limit=50)
for doc in docs.data:
print(doc.metadata.source_url, doc.markdown[:100])
# Search the web
results = app.search("best AI data tools 2024", limit=10)
print(results)
Install the SDK:
import { Firecrawl } from 'firecrawl';
const app = new Firecrawl({ apiKey: 'fc-YOUR_API_KEY' });
// Scrape a single URL
const doc = await app.scrape('https://firecrawl.dev', { formats: ['markdown'] });
console.log(doc.markdown);
// Use the Agent for autonomous data gathering
const result = await app.agent({ prompt: 'Find the founders of Stripe' });
console.log(result.data);
// Crawl a website (automatically waits for completion)
const docs = await app.crawl('https://docs.firecrawl.dev', { limit: 50 });
docs.data.forEach(doc => {
console.log(doc.metadata.sourceURL, doc.markdown.substring(0, 100));
});
// Search the web
const results = await app.search('best AI data tools 2024', { limit: 10 });
results.data.web.forEach(result => {
console.log(`${result.title}: ${result.url}`);
});
Add the dependency (Gradle/Maven):
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.firecrawl:firecrawl-java-sdk:2.0'
}
import dev.firecrawl.client.FirecrawlClient;
import dev.firecrawl.model.*;
FirecrawlClient client = new FirecrawlClient(
System.getenv("FIRECRAWL_API_KEY"), null, null
);
// Scrape a single URL
ScrapeParams scrapeParams = new ScrapeParams();
scrapeParams.setFormats(new String[]{"markdown"});
FirecrawlDocument doc = client.scrapeURL("https://firecrawl.dev", scrapeParams);
System.out.println(doc.getMarkdown());
// Use the Agent for autonomous data gathering
AgentParams agentParams = new AgentParams("Find the founders of Stripe");
AgentResponse start = client.createAgent(agentParams);
AgentStatusResponse result = client.getAgentStatus(start.getId());
System.out.println(result.getData());
// Crawl a website (polls until completion)
CrawlParams crawlParams = new CrawlParams();
crawlParams.setLimit(50);
CrawlStatusResponse job = client.crawlURL("https://docs.firecrawl.dev", crawlParams, null, 10);
for (FirecrawlDocument page : job.getData()) {
System.out.println(page.getMetadata().get("sourceURL"));
}
// Search the web
SearchParams searchParams = new SearchParams("best AI data tools 2024");
searchParams.setLimit(10);
SearchResponse results = client.search(searchParams);
for (SearchResult r : results.getResults()) {
System.out.println(r.getTitle() + ": " + r.getUrl());
}
Add the dependency:
def deps do
[
{:firecrawl, "~> 1.0"}
]
end
# Scrape a URL
{:ok, response} = Firecrawl.scrape_and_extract_from_url(
url: "https://firecrawl.dev",
formats: ["markdown"]
)
# Crawl a website
{:ok, response} = Firecrawl.crawl_urls(
url: "https://docs.firecrawl.dev",
limit: 50
)
# Search the web
{:ok, response} = Firecrawl.search_and_scrape(
query: "best AI data tools 2024",
limit: 10
)
# Map URLs
{:ok, response} = Firecrawl.map_urls(url: "https://example.com")
Add the dependency:
[dependencies]
firecrawl = "2"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
use firecrawl::{Client, ScrapeOptions, Format, CrawlOptions};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new("fc-YOUR_API_KEY")?;
// Scrape a URL
let document = client.scrape("https://firecrawl.dev", None).await?;
println!("{:?}", document.markdown);
// Crawl a website
let options = CrawlOptions {
limit: Some(50),
..Default::default()
};
let result = client.crawl("https://docs.firecrawl.dev", options).await?;
println!("Crawled {} pages", result.data.len());
// Search the web
let response = client.search("best web scraping tools 2024", None).await?;
println!("{:?}", response.data);
Ok(())
}
Community SDKs
Agents & AI Tools
Platforms
Missing your favorite tool? Open an issue and let us know!
Firecrawl is open source under the AGPL-3.0 license. The cloud version at firecrawl.dev includes additional features:
To run locally, see the Contributing Guide. To self-host, see Self-Hosting Guide.
We love contributions! Please read our Contributing Guide before submitting a pull request.
This project is primarily licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). The SDKs and some UI components are licensed under the MIT License. See the LICENSE files in specific directories for details.
It is the sole responsibility of end users to respect websites' policies when scraping. Users are advised to adhere to applicable privacy policies and terms of use. By default, Firecrawl respects robots.txt directives. By using Firecrawl, you agree to comply with these conditions.
↑ Back to Top ↑
