Map
Map 用于快速获取站点内的 URL 列表。
- 在抓取前先列出站点 URL,以便选择性抓取
- 快速了解网站内容结构
- 快速统计站点可访问页面数量
详情请参阅 Map API 参考。
使用 XCrawl 抓取指定域名下的所有 URL
/map 接口
使用方式
curl -s -X POST 'https://run.xcrawl.com/v1/map' \
-H 'Authorization: Bearer $XCRAWL_API_KEY'\
-H 'Content-Type: application/json' \
-d '{
"url": "https://docs.xcrawl.com/doc/",
"limit": 5
}'响应示例
{
"map_id": "01KKE88ET3XC7HMPE4CNQNCGSW",
"endpoint": "map",
"version": "dca0d4b3bff035e4",
"status": "completed",
"url": "https://docs.xcrawl.com/doc/",
"data": {
"links": [
"https://docs.xcrawl.com/",
"https://docs.xcrawl.com/doc/",
"https://docs.xcrawl.com/zh/",
"https://docs.xcrawl.com/doc/introduction/",
"https://docs.xcrawl.com/zh/doc/"
],
"total_links": 5,
"credits_used": 1
},
"started_at": "2026-03-11T10:49:39Z",
"ended_at": "2026-03-11T10:49:40Z",
"total_credits_used": 1
}使用过滤参数过滤结果
你可以使用 filter 参数来只返回匹配特定正则表达式的 URL。例如,下面的请求只返回 /case/ 路径下的 URL:
curl -s -X POST 'https://run.xcrawl.com/v1/map' \
-H 'Authorization: Bearer $XCRAWL_API_KEY'\
-H 'Content-Type: application/json' \
-d '{
"url": "https://xcrawl.com",
"filter": "/case/.*"
}'