MarkUDown

Batch Scrape API — MarkUDown 批量网页抓取 API 文档

POST/api/batch-scrape

批量抓取

在单个请求中并行抓取多个 URL。比分别调用抓取接口更高效。

参数类型必填默认值描述
urlarray<string>必填—要抓取的 URL 列表。每个 URL 消耗 1 个积分。
main_contentboolean可选true只提取主要内容(去掉导航、页眉和页脚)。
include_linkboolean可选false包含页面中找到的链接。
include_htmlboolean可选false在 Markdown 之外同时返回页面 HTML。
exclude_tagsarray<string>可选["header","nav","footer"]要移除的 CSS 选择器或标签名,例如 ["nav",".ads","footer"]。
timeoutinteger可选60每个页面的超时时间(秒)。

请求

{
  "url": [
    "https://example.com/page1",
    "https://example.com/page2",
    "https://example.com/page3"
  ],
  "main_content": true
}

响应

// POST returns { "success": true, "id": "abc123", "url": "/api/batch-scrape/abc123" }
// Poll GET /api/batch-scrape/{id} — "data" when completed:
{
  "success": true,
  "total": 3,
  "completed": 3,
  "failed": 0,
  "data": [
    {
      "url": "https://example.com/page1",
      "markdown": "# Page 1\n\nContent...",
      "metadata": { "title": "Page 1", "statusCode": 200 }
    }
  ]
}