firecrawl
多功能网页抓取和数据提取工具,支持同步抓取、搜索、网站地图获取和异步爬取
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
工具调用示例(Firecrawl)
firecrawl 是一个多功能网页抓取和数据提取工具,通过 mode 参数调用不同功能。其 parameters 结构是嵌套的。
✅ 正确的调用结构:
{"mode": "<功能模式>", "parameters": {"<参数名>": "<参数值>"}}
💡 重要提示:
-
scrape、search、map是同步操作,立即返回结果 -
crawl、extract是异步操作,返回job_id用于后续状态检查 - 所有参数都必须在
parameters对象内,不要放在顶层 - URL 必须以
http://或https://开头
功能模式详解
➡️ 示例 1: 抓取单个网页 (scrape)
✅ 正确示例:
{
"mode": "scrape",
"parameters": {
"url": "https://docs.firecrawl.dev/",
"formats": ["markdown"] // 可选:["markdown", "html"],默认 markdown
}
}
➡️ 示例 2: 网页搜索 (search)
✅ 正确示例:
{
"mode": "search",
"parameters": {
"query": "人工智能最新发展",
"limit": 5
}
}
➡️ 示例 3: 获取网站地图 (map)
✅ 正确示例:
{
"mode": "map",
"parameters": {
"url": "https://example.com"
}
}
➡️ 示例 4: 异步爬取网站 (crawl)
✅ 正确示例:
{
"mode": "crawl",
"parameters": {
"url": "https://firecrawl.dev",
"limit": 5
}
}
此调用会返回一个 job_id,用于后续查询。
➡️ 示例 5: 结构化数据提取 (extract)
✅ 正确示例:
{
"mode": "extract",
"parameters": {
"urls": ["https://news.example.com/article"],
"prompt": "提取文章标题、作者和发布时间",
"schema": {
"type": "object",
"properties": {
"title": {"type": "string"},
"author": {"type": "string"},
"publish_time": {"type": "string"}
}
}
}
}
➡️ 示例 6: 检查异步任务状态 (check_status)
✅ 正确示例:
{
"mode": "check_status",
"parameters": {
"job_id": "some-unique-job-identifier"
}
}
❌ 错误示例 (请避免以下常见错误)
-
缺少
mode参数:{"parameters": {"url": "..."}} -
缺少嵌套的
parameters对象:{"mode": "scrape", "url": "..."} -
将参数放在顶层:
{"url": "..."} -
使用无效的 URL 格式:
{"mode": "scrape", "parameters": {"url": "example.com"}}(缺少协议) -
错误的参数类型:
{"mode": "extract", "parameters": {"urls": "https://example.com"}}(urls 应该是数组)
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-28
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!