firecrawl-agent

作者: firecrawl

AI驱动的自主提取,可从复杂多页网站中提取结构化数据。智能导航网站以定位并提取数据,返回JSON格式结果,支持可选的模式验证。支持自定义JSON模式以实现可预测的结构化输出,未提供模式时则进行自由格式提取。提供两种模型层级(spark-1-mini和spark-1-pro),设有信用额度,并可选择等待内联结果。最适合多页提取任务;对于更简单的抓取,请使用...

npx skills add https://github.com/firecrawl/cli --skill firecrawl-agent

firecrawl agent

AI-powered autonomous extraction. The agent navigates sites and extracts structured data (takes 2-5 minutes).

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

Quick start

# Extract structured data
firecrawl agent "extract all pricing tiers" --wait -o .firecrawl/pricing.json

# With a JSON schema for structured output
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

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
--waitWait for agent to complete
--prettyPretty print JSON output
-o, --output <path>Output file 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.

See also