> ## Documentation Index
> Fetch the complete documentation index at: https://help.decodo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 参数

> /crawl 的请求参数：数量限制、路径过滤、站点地图、域名范围、输出格式、地理位置和 Webhook 推送。

## POST 端点

`https://data.decodo.com/v1/crawl`

## 输入参数

<table>
  <colgroup>
    <col width="163" />

    <col width="100" />

    <col width="90" />

    <col width="395" />
  </colgroup>

  <thead>
    <tr>
      <th>参数</th>
      <th>类型</th>
      <th>必填</th>
      <th>说明</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>`url`</td>
      <td>字符串</td>
      <td>✅</td>
      <td>开始爬取的起始 URL。</td>
    </tr>

    <tr>
      <td>`limit`</td>
      <td>整数</td>

      <td />

      <td>要抓取的最大页面数。取值范围为 `1` 至 `10000`。</td>
    </tr>

    <tr>
      <td>`max_depth`</td>
      <td>整数</td>

      <td />

      <td>从起始 URL 出发的最大链接跳转次数。处于该深度的页面会被抓取，但不会继续跟踪其中的链接。</td>
    </tr>

    <tr>
      <td>`sitemap`</td>
      <td>字符串</td>

      <td />

      <td>可选值：`include`、`only`、`skip`。 <ul><li>`include` - 同时从站点地图和页面链接中收集 URL。</li><li>`only` - 仅爬取站点地图中列出的 URL。</li><li>`skip` - 忽略站点地图，仅跟踪页面链接。</li></ul> 站点地图索引会继续跟踪到其子站点地图。使用 `only` 时，只有当站点地图中列出了起始 URL 时，该 URL 本身才会被爬取。默认值为 `include`。</td>
    </tr>

    <tr>
      <td>`select_paths`</td>
      <td>字符串或数组</td>

      <td />

      <td>一个正则表达式或正则表达式列表。仅爬取路径至少匹配其中一个模式的 URL。即使起始 URL 不匹配，也会被爬取。路径匹配时不带末尾斜杠，因此要匹配路径结尾，请使用 `/?$` 而不是 `/$`。示例：`["^/blog"]`</td>
    </tr>

    <tr>
      <td>`exclude_paths`</td>
      <td>字符串或数组</td>

      <td />

      <td>一个正则表达式或正则表达式列表。路径匹配任一模式的 URL 将被跳过。示例：`["^/case-studies"]`</td>
    </tr>

    <tr>
      <td>`domain_filter`</td>
      <td>字符串</td>

      <td />

      <td>爬虫可跟踪链接前往的域名范围。可选值：`domain`、`subdomain`、`all`。 <ul><li>`domain` - 仅限起始 URL 的主机。</li><li>`subdomain` - 该主机及其子域名。例如从 `github.com` 开始时，会跟踪指向 `docs.github.com` 的链接。</li><li>`all` - 指向任意域名的链接。</li></ul> 默认值为 `domain`。</td>
    </tr>

    <tr>
      <td>`output`</td>
      <td>字符串</td>

      <td />

      <td>每个页面内容的格式。可选值：`markdown`、`html`。默认值为 `markdown`。</td>
    </tr>

    <tr>
      <td>`max_duration`</td>
      <td>整数</td>

      <td />

      <td>最长爬取时间（秒）。达到该时间后，爬取将停止并返回状态 `truncated`，已采集的页面仍可获取。</td>
    </tr>

    <tr>
      <td>`follow_redirects`</td>
      <td>布尔值</td>

      <td />

      <td>设为 `true` 时跟随重定向；设为 `false` 时，发生重定向的页面将失败。默认值为 `true`。</td>
    </tr>

    <tr>
      <td>`JS_retry`</td>
      <td>布尔值</td>

      <td />

      <td>设为 `true` 时，需要 JavaScript 的页面会使用 JavaScript 渲染重试一次。重试页面的计费方式请参阅[计费](/docs/cn/web-data-api-billing)。</td>
    </tr>

    <tr>
      <td>`geo`</td>
      <td>字符串</td>

      <td />

      <td>发起页面请求所在的国家/地区。支持任意大小写的完整国家名称（`Germany`、`germany`）或大写的 2 位国家代码（`DE`）。小写代码或无法识别的国家会被忽略且不会报错，页面将从随机位置抓取。</td>
    </tr>

    <tr>
      <td>`locale`</td>
      <td>字符串</td>

      <td />

      <td>通过 `Accept-Language` 请求头发送给网站的语言和地区。示例：`en-US`、`de-DE`</td>
    </tr>

    <tr>
      <td>`callback_url`</td>
      <td>字符串</td>

      <td />

      <td>一个 `http(s)` URL，爬取完成时会向其发送 `POST` 请求。请参阅[状态、结果与取消](/docs/cn/web-data-api-crawl-status-results-cancellation)中的 Webhook 部分。</td>
    </tr>

    <tr>
      <td>`passthrough`</td>
      <td>字符串</td>

      <td />

      <td>您希望在 Webhook 载荷中原样返回的任意文本，例如用于确认 Webhook 确实来自 Decodo。</td>
    </tr>
  </tbody>
</table>

## 输出

发起爬取后会返回 `202 Accepted`，其中包含 `crawl_id` 以及查看状态和结果的链接。您可以使用这些链接[查看状态、获取结果或取消爬取](/docs/cn/web-data-api-crawl-status-results-cancellation)。

<CodeGroup>
  ```json 响应示例 theme={null}
  {
    "target": "crawl",
    "url": "https://decodo.com/",
    "created_at": "2026-10-08 07:14:45",
    "crawl_id": "3b9ed512-74a8-4470-a76b-2494a12a70ed",
    "status": "pending",
    "crawl_status": "https://data.decodo.com/v1/crawl/3b9ed512-74a8-4470-a76b-2494a12a70ed/status",
    "results_tasks": "https://data.decodo.com/v1/crawl/3b9ed512-74a8-4470-a76b-2494a12a70ed",
    "results_content": "https://data.decodo.com/v1/crawl/3b9ed512-74a8-4470-a76b-2494a12a70ed?type=content"
  }
  ```
</CodeGroup>

如果参数无效，请求将返回 `400` 和错误信息，例如 `{"error": "limit must be between 1 and 10000"}`。

***

<Columns cols={2}>
  <Card title="支持" href="https://direct.lc.chat/12092754" cta="让我们聊聊！">
    需要帮助或只是想打个招呼？我们的支持团队全天候为您服务。 \
    您也可以随时通过电子邮件 [support@decodo.com](mailto:support@decodo.com) 联系我们。
  </Card>

  <Card title="反馈" href="mailto:feedback@decodo.com" cta="分享反馈">
    找不到您要找的内容？请求一篇文章！ \
    有反馈意见？分享您对我们如何改进的想法。
  </Card>
</Columns>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.