mcpField
F
firecrawl-agent

firecrawl-agent

github.com/firecrawl数据与数据库1396.2k 次安装6 天前更新
代码仓库

关于 firecrawl-agent

firecrawl-agent 是用于自主浏览网站并提取结构化数据的 Firecrawl 技能,适合需要从网页收集记录的用户。它支持按 JSON schema 组织输出,也可返回任务 ID 供后续查询。

主要功能

  1. 01自主浏览网站
  2. 02提取结构化数据
  3. 03按 JSON schema 输出
  4. 04限定指定 URL 提取
  5. 05查询或取消任务

适用场景

  1. 01提取网站的定价层级
  2. 02将产品详情整理为结构化 JSON
  3. 03获取指定页面的功能信息

安装

复制下面的命令,在终端中运行。

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

安装后在 Claude Code 中输入/firecrawl-agent确认已加载。

详细介绍

firecrawl agent

AI 驱动的自主提取。Agent 会浏览网站并提取结构化数据(耗时 2-5 分钟)。

开始自主提取结构化记录或列表之前,先检查 firecrawl search alexandria '<data you need>',看看是否有现成的工作流或数据提供方。使用 firecrawl list <provider> <capability> --pretty 检查匹配的契约;如果契约涵盖了任务,则使用 firecrawl scrape --alexandria <provider>/<capability> --options '<input JSON>' 执行。请使用契约中完全一致的提供方、能力和输入字段。没有合适的工具,或任务需要自主浏览时,再使用 Agent。

快速开始

# Extract structured data
firecrawl agent "extract all pricing tiers" --wait --json -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 --json -o .firecrawl/products.json

# Focus on specific pages
firecrawl agent "get feature list" --urls "<url>" --wait --json -o .firecrawl/features.json

运行 firecrawl agent --help 查看完整选项列表。

完成条件: 输出文件包含可回答请求的有效 JSON,或有意返回了用于后续轮询的作业 ID。

Alexandria 提供方

只有在运行开始时使用 Alexandria 标志,才会使用已连接的 Alexandria 数据提供方:--alexandria、--toolkits <slugs>(最多 5 个)、--max-calls <n>、--require-approval 或 --on-terms-required skip|ask。在该线程中的后续操作会保留这些设置。

firecrawl agent "find the head of sales at <company>" --toolkits apollo,crunchbase --wait --json -o .firecrawl/contacts.json

使用 --require-approval(需要 --mode chat)时,运行可能以 pendingApproval 结束,而不会发起付费调用。请先询问用户,然后在同一线程中使用 firecrawl agent "<follow-up prompt>" --thread <threadId> --mode chat --approve <approvalId>(或 --decline <approvalId>)作答。terms 审批只有在组织管理员于 Firecrawl 控制面板接受提供方条款后才会继续;请向用户提供 https://www.firecrawl.dev/app/settings?tab=data-sources,如果他们想先查看条款,请使用 firecrawl alexandria terms show <provider>。批准并不代表接受条款。

作业 ID

省略 --wait 会返回作业 ID。UUID 位置参数会自动识别为状态检查:

# Check once (equivalent to adding --status)
firecrawl agent "<job-id>"

# Wait on an existing job, polling every 10 seconds for up to 5 minutes
firecrawl agent "<job-id>" --wait --poll-interval 10 --timeout 300

# Cancel an active job
firecrawl agent "<job-id>" --cancel

提示

  • 使用 --wait 获取内联结果;只有在想稍后通过轮询获取作业 ID 时才省略此选项(参见作业 ID)。
  • 使用 --schema 获取可预测的结构化输出;否则 Agent 会返回自由格式的数据。
  • Agent 运行消耗的额度多于简单抓取。使用 --max-credits 限制开销。
  • 对于简单的单页提取,优先使用 scrape,速度更快、成本更低。

另请参阅

Alexandria 会话反馈

若要报告 Alexandria 会话结果或提供方/能力缺口,请使用 firecrawl alexandria feedback --rating good|partial|bad --url <website> --requested-functionality '<what was needed>' --objective '<the underlying goal of the task>' --rationale '<what happened>' --json。请在说明中使用实际观察到的结果。无需作业 ID;请在最近一次 Alexandria 搜索、发现或执行后的 20 分钟内提交,否则会被拒绝。每次提交会退还 1 个额度,每个网站最多 10 个,每个团队每天(UTC)最多 100 个。可选的 --provider-feedback 和 --capability-feedback JSON 数组可用于描述具体缺口;请运行 firecrawl alexandria feedback --help 查看其字段。提供方存在但缺少所需能力时,请使用能力问题 missing_capability;需要申请新能力时,请使用 new_capability_request(并提供 requestedFunctionality)。

评论

支持 Markdown