Documentation Index
Fetch the complete documentation index at: https://firecrawl.sec-lab.cn/llms.txt
Use this file to discover all available pages before exploring further.
介绍 /map (Alpha)
从单个URL到整个网站映射的最简单方法。这对以下情况非常有用:
- 当您需要提示最终用户选择要抓取的链接时
- 需要快速了解网站上的链接
- 需要抓取与特定主题相关的网站页面(使用
search参数)
- 只需要抓取网站的特定页面
Alpha版本考虑因素
此端点优先考虑速度,因此可能无法捕获所有网站链接。我们正在改进中。非常欢迎反馈和建议。
/map 端点
用于映射URL并获取网站的URL。这将返回网站上存在的大多数链接。
# 安装firecrawl-py包
pip install firecrawl-py
使用方法
from firecrawl import FirecrawlApp
app = FirecrawlApp(api_key="fc-YOUR_API_KEY")
# Map a website:
map_result = app.map_url('https://firecrawl.dev')
print(map_result)
SDK将直接返回数据对象。cURL将返回与下面完全相同的有效负载。
{
"status": "success",
"links": [
"https://firecrawl.dev",
"https://www.firecrawl.dev/pricing",
"https://www.firecrawl.dev/blog",
"https://www.firecrawl.dev/playground",
"https://www.firecrawl.dev/smart-crawl",
...
]
}
带搜索的映射
带search参数的映射允许您在网站内搜索特定URL。
curl -X POST https://api.firecrawl.dev/v1/map \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{
"url": "https://firecrawl.dev",
"search": "docs"
}'
响应将是一个从最相关到最不相关排序的列表。
{
"status": "success",
"links": [
"https://docs.firecrawl.dev",
"https://docs.firecrawl.dev/sdks/python",
"https://docs.firecrawl.dev/learn/rag-llama3",
]
}