MarkUDown

Scrape API — MarkUDown 网页抓取 API 文档

POST/api/scrape

Scrape

将任意网页转换为干净的 Markdown。采用三层提取策略:快速 HTTP 抓取 → 隐身浏览器 (Patchright) → 人类行为模拟 (Abrasio),失败时自动升级。

参数类型必填默认值描述
urlarray<string>必填—要抓取的 URL,以单元素数组传入(只使用第一个;多个 URL 请用 Batch Scrape)。
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://blog.example.com/post"],
  "main_content": true,
  "include_link": true,
  "timeout": 30
}

响应

{
  "url": "https://blog.example.com/post",
  "markdown": "# Post Title\n\nContent...",
  "links": [
    "https://blog.example.com/other",
    "https://example.org/"
  ],
  "metadata": {
    "title": "Post Title",
    "description": "...",
    "source": "cheerio",
    "statusCode": 200
  }
}