# 页面监控 (/zh/features/monitoring-page)

<!-- agent-signals: reading_time_min: 2 · est_tokens: 1265 · updated: 2026-07-30 -->
Related: [搜索](/zh/features/search.md), [搜索高亮](/zh/features/search-highlights.md), [研究索引](/zh/features/research.md), [抓取](/zh/features/scrape.md), [更快的抓取](/zh/features/fast-scraping.md), [批量抓取](/zh/features/batch-scrape.md)

页面监控用于监控你已经知道的 URL。每次检查都会抓取目标中的每个 URL，将其与上一次保留的快照进行差异比对，并报告该页面是 `same`、`changed`、`new`、`removed` 还是 `error`。对于定价页面、更新日志、文档页面、招聘信息、状态页面，或任何细微变化也很重要的已知 URL，它都是合适的选择。

本页介绍 `scrape` 目标。调度、目标与判定、变更追踪、通知和定价在所有监控类型中都是共通的。请参见 [监控概览](/zh/features/monitoring)。

<div id="create-a-page-monitor">
  ## 创建页面监控 [#创建页面监控]
</div>

创建一个使用 `scrape` 目标的监控器，并列出一个或多个明确的 URL：

<CodeGroup>
  <CodeBlockTabs defaultValue="Python" groupId="curl+node+python">
    <CodeBlockTabsList>
      <CodeBlockTabsTrigger value="Python">
        Python
      </CodeBlockTabsTrigger>

      <CodeBlockTabsTrigger value="Node">
        Node
      </CodeBlockTabsTrigger>

      <CodeBlockTabsTrigger value="cURL">
        cURL
      </CodeBlockTabsTrigger>
    </CodeBlockTabsList>

    <CodeBlockTab value="Python">
      ```python  
      from firecrawl import Firecrawl

      firecrawl = Firecrawl(
        # 监控端点需要 API 密钥：
        api_key="fc-YOUR-API-KEY",
      )

      monitor = firecrawl.create_monitor(
          name="Hacker News AI monitor",
          schedule={"text": "every 30 minutes", "timezone": "UTC"},
          goal=(
              "Alert when a new Hacker News story related to AI enters the top 10. "
              "Ignore changes to stories that are not about AI. "
              "Do not alert on changes outside the top 10."
          ),
          targets=[
              {
                  "type": "scrape",
                  "urls": ["https://news.ycombinator.com"],
              }
          ],
          notification={
              "email": {
                  "enabled": True,
                  "recipients": ["alerts@example.com"],
                  "includeDiffs": True,
              }
          },
      )

      print(monitor.id)
      ```
    </CodeBlockTab>

    <CodeBlockTab value="Node">
      ```js  
      import Firecrawl from "@mendable/firecrawl-js";

      const firecrawl = new Firecrawl({
        // 监控端点需要 API 密钥：
        apiKey: "fc-YOUR-API-KEY",
      });

      const monitor = await firecrawl.createMonitor({
        name: "Hacker News AI monitor",
        schedule: { text: "every 30 minutes", timezone: "UTC" },
        goal:
          "Alert when a new Hacker News story related to AI enters the top 10. Ignore changes to stories that are not about AI. Do not alert on changes outside the top 10.",
        notification: {
          email: {
            enabled: true,
            recipients: ["alerts@example.com"],
            includeDiffs: true,
          },
        },
        targets: [
          {
            type: "scrape",
            urls: ["https://news.ycombinator.com"],
          },
        ],
      });

      console.log(monitor.id);
      ```
    </CodeBlockTab>

    <CodeBlockTab value="cURL">
      ```bash  
      curl -s -X POST "https://api.firecrawl.dev/v2/monitor" \
        -H "Authorization: Bearer $FIRECRAWL_API_KEY" \
        -H "Content-Type: application/json" \
        -d '{
          "name": "Hacker News AI monitor",
          "schedule": {
            "text": "every 30 minutes",
            "timezone": "UTC"
          },
          "goal": "Alert when a new Hacker News story related to AI enters the top 10. Ignore changes to stories that are not about AI. Do not alert on changes outside the top 10.",
          "notification": {
            "email": {
              "enabled": true,
              "recipients": ["alerts@example.com"],
              "includeDiffs": true
            }
          },
          "targets": [
            {
              "type": "scrape",
              "urls": ["https://news.ycombinator.com"]
            }
          ]
        }'
      ```
    </CodeBlockTab>
  </CodeBlockTabs>
</CodeGroup>

你也可以通过 Firecrawl CLI 创建监控器：

```bash title="CLI"
firecrawl monitor create --name "Hacker News AI" \
  --schedule "every 30 minutes" \
  --goal "Alert when a new Hacker News story related to AI enters the top 10. Ignore changes to stories that are not about AI. Do not alert on changes outside the top 10." \
  --page https://news.ycombinator.com
```

<div id="scrape-target">
  ## 抓取目标 [#抓取目标]
</div>

`scrape` 目标需要 `type`，以及一个至少包含一个 URL 的 `urls` 数组。抓取选项会传递到底层的抓取任务。由监控触发的抓取会默认将 `maxAge` 设为 `0`，因此除非你显式设置了其他 `maxAge`，否则每次检查都会执行一次新的抓取。

```json title="Scrape target"
{
  "type": "scrape",
  "urls": ["https://example.com/pricing"],
  "scrapeOptions": {
    "formats": ["markdown"],
    "maxAge": 0
  }
}
```

<div id="detecting-field-level-changes">
  ## 检测字段级变更 [#检测字段级变更]
</div>

默认情况下，页面监控会比较页面 markdown 的差异。若只想在**特定字段**发生变化时触发告警，例如价格、标题、是否有库存的标记，或列表中的条目，请在目标的 `scrapeOptions` 中添加 `changeTracking` 格式。请参见 [变更追踪](/zh/features/monitoring#change-tracking) 了解 JSON 模式和混合模式。

<div id="shared-configuration">
  ## 通用配置 [#通用配置]
</div>

* [调度](/zh/features/monitoring#schedules): cron 表达式或自然语言频率，最短间隔为 5 分钟。
* [目标与判定](/zh/features/monitoring#goals-and-judging): 仅在出现有意义的变更时发送告警。
* [通知](/zh/features/monitoring#notifications): 通过 webhook 和电子邮件发送。
* [检查结果](/zh/features/monitoring#check-results): 查看每次检查及各页面的差异。
* [定价](/zh/features/monitoring#pricing): 每次检查每个 URL 消耗 1 个额度，另加可选判定。
