# Webpage, Pricing & Policy Diff Monitor — Change Tracker (`weiyi-ai/webpage-diff-monitor`) Actor

Monitor competitor pricing, terms, regulatory updates & API changelogs automatically. Strips dynamic noise, persists snapshots across scheduled runs, computes structured line/price diffs, and pushes JSON alerts to webhooks.

- **URL**: https://apify.com/weiyi-ai/webpage-diff-monitor.md
- **Developed by:** [Weiyi Wang](https://apify.com/weiyi-ai) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 webpage change check completeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Webpage, Pricing & Policy Diff Monitor — Structured Change Tracker

Automatically monitor **competitor pricing pages, Terms of Service, regulatory bulletins, and API changelogs** on a schedule — with **zero LLM API costs and persistent snapshot memory**.

***

### Key Features

- **Zero-Setup Persistent Memory**: Automatically stores cleaned baseline snapshots in a named Apify Key-Value Store (`snapshotStoreName`). Schedule it daily or hourly and immediately get structured diffs against the previous version.
- **Noise-Stripped Diffs**: Strips `<script>`, `<style>`, navigation bars, footers, cookie banners, and dynamic timestamp footers before running `difflib`, preventing false-positive alerts.
- **Built-In Price Change Extraction**: Automatically detects added and removed currency values (`$`, `€`, `£`, `USD`, `EUR`, etc.) and flags price shifts as `major` severity.
- **Webhook Ready**: Automatically POSTs structured JSON change summaries (including `unifiedDiff`, `pricesAdded`, and `pricesRemoved`) to Slack, Discord, n8n, Make, or Zapier whenever changes occur.
- **Low-Memory 512 MB Compute**: Pure HTTP + BeautifulSoup + `difflib` architecture costs a fraction of browser-based monitors.

***

### Quick Input Example

```json
{
  "urls": [
    { "url": "https://www.python-httpx.org/compatibility/" }
  ],
  "onlyOutputChanges": false,
  "snapshotStoreName": "webpage-diff-snapshots"
}
```

# Actor input Schema

## `urls` (type: `array`):

URLs to track for changes (e.g. pricing pages, terms of service, regulatory bulletins, changelogs).

## `cssSelector` (type: `string`):

Restrict diff tracking to a specific element (e.g. 'main', '#pricing', '.pricing-table'). Leave blank for automatic main-content extraction.

## `snapshotStoreName` (type: `string`):

Named Apify Key-Value Store used to persist baseline snapshots automatically across scheduled runs (letters, digits, hyphens).

## `previousSnapshots` (type: `object`):

Optional map of { url: normalizedMarkdownText } to diff against instead of the persisted snapshot store.

## `onlyOutputChanges` (type: `boolean`):

If true, unchanged pages are still updated in the snapshot store but omitted from the output dataset (baseline first-seen pages are still emitted).

## `webhookUrl` (type: `string`):

Optional HTTP POST endpoint triggered automatically whenever meaningful changes are detected.

## `maxConcurrency` (type: `integer`):

Simultaneous HTTP requests.

## `requestTimeoutSecs` (type: `integer`):

Timeout per page check.

## `useApifyProxy` (type: `boolean`):

Optional proxy routing if target pages rate-limit datacenter IPs.

## Actor input object example

```json
{
  "urls": [
    {
      "url": "https://www.python-httpx.org/compatibility/"
    }
  ],
  "cssSelector": "",
  "snapshotStoreName": "webpage-diff-snapshots",
  "previousSnapshots": {},
  "onlyOutputChanges": false,
  "webhookUrl": "",
  "maxConcurrency": 6,
  "requestTimeoutSecs": 20,
  "useApifyProxy": false
}
```

# Actor output Schema

## `diffResults` (type: `string`):

Per-URL change status, severity, added/removed lines, and unified diff.

## `summary` (type: `string`):

Aggregate counts of checked, changed, baseline, and failed URLs.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "urls": [
        {
            "url": "https://www.python-httpx.org/compatibility/"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("weiyi-ai/webpage-diff-monitor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "urls": [{ "url": "https://www.python-httpx.org/compatibility/" }] }

# Run the Actor and wait for it to finish
run = client.actor("weiyi-ai/webpage-diff-monitor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "urls": [
    {
      "url": "https://www.python-httpx.org/compatibility/"
    }
  ]
}' |
apify call weiyi-ai/webpage-diff-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,weiyi-ai/webpage-diff-monitor"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/m15eP5IqzJnZ501mP/builds/pigBVQ3dIwPgiSIoI/openapi.json
