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

# ページ監視

> 既知のURLを監視し、ページに意味のある変更があった際に通知を受け取る

ページ監視では、すでに把握しているURLを監視します。各チェックでターゲット内のすべてのURLをスクレイピングし、前回保持されたスナップショットとの差分を取り、そのページが `same`、`changed`、`new`、`removed`、または `error` のいずれかであることを報告します。料金ページ、変更履歴、ドキュメントページ、求人情報、ステータスページなど、小さな変更でも重要な既知のURLに適しています。

このページでは `scrape` ターゲットを扱います。スケジューリング、ゴールと判定、変更追跡、通知、価格設定はすべてのモニタータイプで共通です。[Monitoring overview](/ja/features/monitoring) を参照してください。

<div id="create-a-page-monitor">
  ## ページモニターを作成する
</div>

1 つ以上の URL を明示的に指定する `scrape` ターゲットを持つモニターを作成します。

<CodeGroup>
  ```python Python theme={null}
  from firecrawl import Firecrawl

  firecrawl = Firecrawl(
    # MonitorのエンドポイントにはAPI keyが必要です:
    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)
  ```

  ```js Node theme={null}
  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);
  ```

  ```bash cURL theme={null}
  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"]
        }
      ]
    }'
  ```
</CodeGroup>

Firecrawl CLI からモニターを作成することもできます。

```bash CLI theme={null}
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">
  ## `scrape` ターゲット
</div>

`scrape` ターゲットには、`type` と、少なくとも 1 つの URL を含む `urls` 配列が必要です。スクレイピングのオプションは、内部のスクレイピングジョブにそのまま渡されます。`モニター` によって実行されるスクレイピングでは、`maxAge` のデフォルト値が `0` のため、明示的に別の `maxAge` を設定しない限り、チェックごとに新しいスクレイピングが実行されます。

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

<div id="detecting-field-level-changes">
  ## フィールドレベルの変更を検出する
</div>

デフォルトでは、ページモニターはページのMarkdownの差分を比較します。価格、見出し、在庫フラグ、リスト内の項目など、**特定のフィールド**が変更されたときだけ通知するには、ターゲットの`scrapeOptions`に`changeTracking`フォーマットを追加します。JSONモードとMixedモードについては、[変更追跡](/ja/features/monitoring#change-tracking)を参照してください。

<div id="shared-configuration">
  ## 共通構成
</div>

* [スケジュール](/ja/features/monitoring#schedules): cron または自然言語で指定する実行間隔。最短 5 分です。
* [ゴールと判定](/ja/features/monitoring#goals-and-judging): 意味のある変更があった場合にのみアラートします。
* [通知](/ja/features/monitoring#notifications): webhook とメールで配信します。
* [チェック結果](/ja/features/monitoring#check-results): 各チェックと、そのページごとの差分を確認できます。
* [料金](/ja/features/monitoring#pricing): チェックごとに URL あたり 1 クレジット、加えて任意の判定分がかかります。
