# Competitor Change Monitor API (`s3nafps/competitor-change-monitor-api`) Actor

Detect meaningful text changes on public competitor pages between Apify actor runs.

- **URL**: https://apify.com/s3nafps/competitor-change-monitor-api.md
- **Developed by:** [mohamed senator](https://apify.com/s3nafps) (community)
- **Categories:** SEO tools, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Competitor Change Monitor API

Detect meaningful text changes on public competitor pages between Actor runs.

### What this Actor does

Competitor Change Monitor API fetches public pages, extracts main text, stores snapshots in Apify Key-Value Store, compares later runs against the previous snapshot, and saves structured change records to the Apify Dataset.

The first run creates a baseline. Later runs can report added text, removed text, change score, keywords, and likely change types.

### Use cases

- Monitor competitor pricing pages.
- Watch changelogs and docs for product updates.
- Track public legal, policy, blog, and marketing page edits.
- Feed structured change records into Slack, dashboards, or reporting workflows.

### Who this is for

Competitor intelligence teams, founders, marketers, product teams, agencies, and analysts who monitor public website changes.

### Input

- `urls` - Public pages to monitor. Required, 1-100 items.
- `compareMode` - Text comparison mode. Current supported value: `text`.
- `includeScreenshot` - Reserved for a browser-based upgrade. Current version returns `screenshotUrl: null`. Default: `false`.
- `maxPages` - Maximum pages to check in one run. Default: `50`, maximum: `100`.
- `changeSensitivity` - How small a text difference must be before a change is marked. Values: `low`, `medium`, `high`. Default: `medium`.

### Example input

```json
{
  "urls": ["https://www.apify.com/pricing", "https://www.apify.com/changelog"],
  "compareMode": "text",
  "includeScreenshot": false,
  "maxPages": 10,
  "changeSensitivity": "medium"
}
````

### Output

The Actor saves one Dataset item per checked URL.

- `sourceUrl` - Final fetched page URL.
- `pageTitle` - HTML page title.
- `currentHash` - SHA-1 hash of current main text.
- `previousHash` - SHA-1 hash from the previous run, or `null` on the first baseline run.
- `changeDetected` - Whether a change passed the selected sensitivity threshold.
- `changeScore` - Approximate changed-line ratio from 0 to 1.
- `changedSections` - Added text snippets used as a quick summary.
- `addedText` - New text snippets.
- `removedText` - Removed text snippets.
- `importantKeywords` - Detected keywords such as pricing, security, API, deprecated, or launch.
- `detectedChangeTypes` - Heuristic categories such as `pricing_change`, `feature_change`, `docs_change`, or `legal_change`.
- `screenshotUrl` - Always `null` in this version.
- `scrapedAt` - ISO timestamp for the run.
- `previousScrapedAt` - Timestamp from the previous snapshot when available.
- `errorMessage` - Failure reason when a page request fails.

### Example output

```json
{
  "sourceUrl": "https://www.apify.com/pricing",
  "pageTitle": "Pricing",
  "currentHash": "abc123",
  "previousHash": "def456",
  "changeDetected": true,
  "changeScore": 0.2,
  "changedSections": ["New plan launched"],
  "addedText": ["New plan launched"],
  "removedText": ["Old plan removed"],
  "importantKeywords": ["pricing"],
  "detectedChangeTypes": ["pricing_change"],
  "screenshotUrl": null,
  "scrapedAt": "2026-07-04T00:00:00.000Z",
  "previousScrapedAt": "2026-07-03T00:00:00.000Z",
  "errorMessage": null
}
```

### How it works

- Reads the Actor input.
- Deduplicates public URLs.
- Fetches each page and extracts main text.
- Stores the latest snapshot in Apify Key-Value Store.
- Compares against the previous snapshot for that URL.
- Saves change records to the Apify Dataset.

### Limitations

- First runs create a baseline and do not report a change.
- Public pages only.
- No login, private data, cookies, CAPTCHA bypass, or restricted content.
- Text diff is heuristic and may include navigation or layout text if the page structure changes.
- Screenshot diff is not implemented in this version.
- Dynamic pages may need a browser-based upgrade for better extraction.

### Error handling

Invalid or empty `urls` input fails run validation. Failed requests return a Dataset item with `extractionStatus: "failed"`, `errorMessage`, `changeDetected: false`, and null hashes. Snapshot read/write is handled through Apify Key-Value Store during normal Actor runs.

### Troubleshooting

- If no change is reported on the first run, that is expected: the first run creates the baseline.
- If changes look noisy, lower sensitivity by setting `changeSensitivity` to `low` or monitor more stable page URLs.
- If small edits are missed, use `changeSensitivity: "high"`.
- If a page fails, confirm it is publicly accessible and does not require login, cookies, or browser-only rendering.

### API usage

```bash
curl -X POST "https://api.apify.com/v2/acts/USERNAME~competitor-change-monitor-api/runs?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "urls": ["https://www.apify.com/pricing"],
    "compareMode": "text",
    "includeScreenshot": false,
    "maxPages": 10,
    "changeSensitivity": "medium"
  }'
```

### Integration ideas

- Schedule daily or weekly monitoring runs.
- Send records with `changeDetected: true` to Slack or email.
- Store changes in a competitor intelligence dashboard.
- Pair with Sitemap Intelligence API to discover URLs before monitoring them.

### SEO keywords

competitor monitor, website change API, pricing change monitor, changelog monitor, docs monitor, public page monitoring, Apify monitor, text diff API, competitor intelligence, change detection

### Ethical use

This Actor is designed for public data and user-provided URLs only. Do not use it to access private, login-protected, or restricted content.

# Actor input Schema

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

Public pages to monitor.

## `compareMode` (type: `string`):

Text comparison is supported in this version.

## `includeScreenshot` (type: `boolean`):

Reserved for a browser-based upgrade. Text diff runs now.

## `maxPages` (type: `integer`):

Maximum public pages to check in one run.

## `changeSensitivity` (type: `string`):

How small a text difference must be before the actor marks a change.

## Actor input object example

```json
{
  "urls": [
    "https://www.apify.com/pricing"
  ],
  "compareMode": "text",
  "includeScreenshot": false,
  "maxPages": 50,
  "changeSensitivity": "medium"
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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": [
        "https://www.apify.com/pricing"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("s3nafps/competitor-change-monitor-api").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": ["https://www.apify.com/pricing"] }

# Run the Actor and wait for it to finish
run = client.actor("s3nafps/competitor-change-monitor-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": [
    "https://www.apify.com/pricing"
  ]
}' |
apify call s3nafps/competitor-change-monitor-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=s3nafps/competitor-change-monitor-api",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Competitor Change Monitor API",
        "description": "Detect meaningful text changes on public competitor pages between Apify actor runs.",
        "version": "0.1",
        "x-build-id": "ggp4aZC3ushJrxlxq"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/s3nafps~competitor-change-monitor-api/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-s3nafps-competitor-change-monitor-api",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/s3nafps~competitor-change-monitor-api/runs": {
            "post": {
                "operationId": "runs-sync-s3nafps-competitor-change-monitor-api",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/s3nafps~competitor-change-monitor-api/run-sync": {
            "post": {
                "operationId": "run-sync-s3nafps-competitor-change-monitor-api",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "urls"
                ],
                "properties": {
                    "urls": {
                        "title": "Public URLs",
                        "minItems": 1,
                        "maxItems": 100,
                        "type": "array",
                        "description": "Public pages to monitor.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "compareMode": {
                        "title": "Compare mode",
                        "enum": [
                            "text"
                        ],
                        "type": "string",
                        "description": "Text comparison is supported in this version.",
                        "default": "text"
                    },
                    "includeScreenshot": {
                        "title": "Include screenshot",
                        "type": "boolean",
                        "description": "Reserved for a browser-based upgrade. Text diff runs now.",
                        "default": false
                    },
                    "maxPages": {
                        "title": "Maximum pages",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Maximum public pages to check in one run.",
                        "default": 50
                    },
                    "changeSensitivity": {
                        "title": "Change sensitivity",
                        "enum": [
                            "low",
                            "medium",
                            "high"
                        ],
                        "type": "string",
                        "description": "How small a text difference must be before the actor marks a change.",
                        "default": "medium"
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
