MarkUDown
Crawl API — MarkUDown 网站爬虫 API 文档
POST
/api/crawlCrawl
从起始 URL 递归跟踪内部链接,为每个发现的页面返回 Markdown。非常适合转换完整的文档网站或博客。
| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
| url | array<string> | 必填 | — | 起始 URL,以单元素数组传入(只使用第一个)。 |
| max_depth | integer | 可选 | 2 | 从起始 URL 开始跟踪链接的最大深度。 |
| limit | integer | 可选 | 5 | 最多爬取的页面数。任务开始时按此数量扣除积分。 |
| blocked_words | array<string> | 可选 | [] | 跳过包含其中任意一个词的 URL,例如 ["archive","legacy"]。 |
| exclude_tags | array<string> | 可选 | ["header","nav","footer"] | 要移除的 CSS 选择器或标签名,例如 ["nav",".ads","footer"]。 |
| include_html | boolean | 可选 | false | 同时返回每个页面的 HTML。 |
| main_content | boolean | 可选 | true | 只提取主要内容(去掉导航、页眉和页脚)。 |
| timeout | integer | 可选 | 60 | 每个页面的超时时间(秒)。 |
| callback_url | string | 可选 | null | 任务完成时接收结果(POST)的 webhook URL。 |
请求
{
"url": ["https://docs.example.com/"],
"max_depth": 2,
"limit": 20,
"blocked_words": ["archive"]
}响应
{
"success": true,
"id": "abc123",
"url": "/api/crawl/abc123"
}
// Poll GET /api/crawl/{id}
{
"success": true,
"id": "abc123",
"status": "completed",
"data": {
"success": true,
"status": "completed",
"total": 2,
"data": [
{
"url": "https://docs.example.com/intro",
"markdown": "# Introduction\n\n...",
"metadata": { "title": "Introduction", "statusCode": 200 }
}
]
}
}