firecrawl-agent

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

firecrawl agent

firecrawl agent

AI-powered autonomous extraction. The agent navigates sites and extracts structured data (takes 2-5 minutes).
由AI驱动的自主数据提取工具。该Agent可遍历网站并提取结构化数据(耗时2-5分钟)。

When to use

使用场景

  • You need structured data from complex multi-page sites
  • Manual scraping would require navigating many pages
  • You want the AI to figure out where the data lives
  • 你需要从复杂的多页面网站中获取结构化数据
  • 手动抓取需要遍历大量页面
  • 希望AI自动定位数据所在位置

Quick start

快速开始

bash
undefined
bash
undefined

Extract structured data

提取结构化数据

firecrawl agent "extract all pricing tiers" --wait -o .firecrawl/pricing.json
firecrawl agent "extract all pricing tiers" --wait -o .firecrawl/pricing.json

With a JSON schema for structured output

使用JSON schema生成结构化输出

firecrawl agent "extract products" --schema '{"type":"object","properties":{"name":{"type":"string"},"price":{"type":"number"}}}' --wait -o .firecrawl/products.json
firecrawl agent "extract products" --schema '{"type":"object","properties":{"name":{"type":"string"},"price":{"type":"number"}}}' --wait -o .firecrawl/products.json

Focus on specific pages

聚焦特定页面

firecrawl agent "get feature list" --urls "<url>" --wait -o .firecrawl/features.json
undefined
firecrawl agent "get feature list" --urls "<url>" --wait -o .firecrawl/features.json
undefined

Options

可选参数

OptionDescription
--urls <urls>
Starting URLs for the agent
--model <model>
Model to use: spark-1-mini or spark-1-pro
--schema <json>
JSON schema for structured output
--schema-file <path>
Path to JSON schema file
--max-credits <n>
Credit limit for this agent run
--wait
Wait for agent to complete
--pretty
Pretty print JSON output
-o, --output <path>
Output file path
参数选项说明
--urls <urls>
Agent的起始URL列表
--model <model>
使用的模型:spark-1-mini 或 spark-1-pro
--schema <json>
用于结构化输出的JSON schema
--schema-file <path>
JSON schema文件的路径
--max-credits <n>
本次Agent运行的信用额度上限
--wait
等待Agent完成任务
--pretty
格式化输出JSON结果
-o, --output <path>
输出文件路径

Tips

使用技巧

  • Always use
    --wait
    to get results inline. Without it, returns a job ID.
  • Use
    --schema
    for predictable, structured output — otherwise the agent returns freeform data.
  • Agent runs consume more credits than simple scrapes. Use
    --max-credits
    to cap spending.
  • For simple single-page extraction, prefer
    scrape
    — it's faster and cheaper.
  • 始终使用
    --wait
    参数来实时获取结果。不使用该参数时,会返回任务ID。
  • 使用
    --schema
    参数可获得可预测的结构化输出——否则Agent会返回自由格式的数据。
  • Agent运行消耗的信用额度比简单抓取更多。使用
    --max-credits
    参数来控制成本。
  • 对于简单的单页面提取,建议使用
    scrape
    功能——它更快且成本更低。

See also

相关链接

  • firecrawl-scrape — simpler single-page extraction
  • firecrawl-browser — manual browser automation (more control)
  • firecrawl-crawl — bulk extraction without AI
  • firecrawl-scrape —— 更简单的单页面提取工具
  • firecrawl-browser —— 手动浏览器自动化(控制度更高)
  • firecrawl-crawl —— 无AI参与的批量提取工具