# Universal AI Page Monitor (`vkuprin/universal-ai-page-monitor`) Actor

Monitor any URL for changes — Amazon products, LinkedIn profiles, job boards, pricing pages, Hacker News, GitHub. AI generates CSS selectors + regex filters in plain English. Works in any language. No API key needed. MCP-ready for Claude, Cursor, Codex, Gemini, Cline.

- **URL**: https://apify.com/vkuprin/universal-ai-page-monitor.md
- **Developed by:** [Vitaly Kuprin](https://apify.com/vkuprin) (community)
- **Categories:** Automation, AI, Developer tools
- **Stats:** 2 total users, 0 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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/platform/actors/running/actors-in-store#pay-per-event

## 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

## Universal AI Page Monitor

**Monitor Amazon products, LinkedIn profiles, job boards, pricing pages, Hacker News, GitHub releases, Shopify stores, or any URL for changes.** Plain-English intent in → CSS selectors + regex filters out. Ready to plug into any change-detection system or call as a tool from any MCP client.

- ✅ **No OpenAI/Anthropic API key needed.** AI cost is included in the per-call event price.
- ✅ **Works on any URL in any language** (English, Russian, Spanish, Chinese, Arabic, etc.).
- ✅ **MCP-ready** for Claude Desktop, Cursor, Codex, Gemini Code Assist, Cline, Continue, and every MCP-compatible client.
- ✅ **Typical run cost: ~$0.13** (init + page fetch + 1 AI call + result). 100 pages/month ≈ $13.

### What it does

Given a URL, the Actor:

1. **Fetches the page** (Playwright by default; HTTP for static pages).
2. **Extracts main content** with [Defuddle](https://github.com/kepano/defuddle) — picks the right `contentSelector` for monitoring.
3. **Detects schema.org page type** (Product, Article, JobPosting, …) from JSON-LD.
4. **Strips ads & cookie banners** via EasyList + Fanboy's Cookie List (pre-baked at build time).
5. **Generates noise filters** (regex `ignore_text` + CSS `subtractive_selectors`) for ephemeral content like timestamps and counters.
6. **Generates trigger patterns** when you provide a plain-English `intent` — e.g. "notify when sold out" → regex that fires only on real change.

**Multilingual by design** — the prompts include explicit examples in Russian, Spanish, Chinese, and Arabic. When the page is in a non-English language, the engine emits `ignore_text` regex patterns in that language verbatim (e.g. `/найдено\s+[\d\s]+\s*вакансии/i` for a Russian SERP).

### Inputs

| Field         | Type                   |         Required          | Description                                                                   |
| ------------- | ---------------------- | :-----------------------: | ----------------------------------------------------------------------------- |
| `url`         | string                 |            yes            | Any HTTP(S) URL                                                               |
| `intent`      | string                 |            no             | Plain-English description of the change you want detected                     |
| `fetchMode`   | `http` \| `playwright` | no (default `playwright`) | `http` is cheap and fast for static pages; `playwright` renders JS-heavy SPAs |
| `screenshot`  | bool                   |   no (default `false`)    | Save full-page PNG to KV store (Playwright mode only)                         |
| `useEasyList` | bool                   |    no (default `true`)    | Apply EasyList + Fanboy's Cookie List                                         |
| `userAgent`   | string                 |            no             | Override the User-Agent for the page fetch                                    |

**No API keys to paste.** AI cost is included in the `ai-call` event price below.

### Output

One row per analyzed URL, written to the run's default dataset:

```jsonc
{
  "url": "https://news.ycombinator.com",
  "fetchedAt": "2026-05-09T13:30:00.000Z",
  "fetchMode": "playwright",
  "pageType": "website",
  "contentSelector": "#hnmain",
  "includeFilters": ["#hnmain"],
  "subtractiveSelectors": [".pagetop", "td.title:has(.titleline)"],
  "triggerText": ["/(?:show hn|ask hn):/i"],
  "ignoreText": ["/\\d+\\s*points?/i", "/posted\\s+\\d+/i"],
  "explanation": "Configured content selector and noise filters for a list page.",
  "warning": null,
  "screenshotKey": null,
  "aiTokens": { "input": 920, "output": 180 },
}
````

The output schema matches `SmartFilterResult` exactly — feed it directly into any change-detection backend that accepts CSS include/subtract filters, regex `ignore_text`, and regex `trigger_text`.

### Pricing

Pay-per-event. Charges are configured in the Apify Console:

- `init` — once per run
- `page-fetched` — once per successfully fetched page
- `ai-call` — once per LLM call (only when `intent` is set; AI cost is included)
- `screenshot` — once if `screenshot: true`
- `result-pushed` — once per dataset row

A typical run with `intent` set, Playwright fetch, no screenshot: 1× init + 1× page-fetched + 1× ai-call + 1× result-pushed. **No external accounts or API keys required** — the AI cost is rolled into the `ai-call` event price.

### MCP usage (works with every MCP client)

Apify exposes Store Actors as MCP tools natively via the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp). The same configuration works in **every MCP-compatible client**:

- **Claude Desktop** — `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) / `%APPDATA%\Claude\claude_desktop_config.json` (Windows)
- **Cursor** — `~/.cursor/mcp.json`
- **OpenAI Codex** (the desktop client and the API's tools surface)
- **Google Gemini Code Assist** (when MCP is enabled)
- **Cline** (VS Code extension) — `cline_mcp_settings.json`
- **Continue.dev** — `~/.continue/config.json`
- **OpenClaw** and other community MCP clients
- **Custom MCP clients** built with the official MCP SDK (Python, TypeScript, Go)

Add this block to your client's MCP config:

```jsonc
{
  "mcpServers": {
    "apify": {
      "command": "npx",
      "args": ["-y", "@apify/actors-mcp-server"],
      "env": { "APIFY_TOKEN": "<your-apify-token>" }
    }
  }
}
```

Then ask your agent something like:

> *"Monitor https://news.ycombinator.com and tell me which CSS selectors and regex patterns I should use to detect when a new top story appears."*

The agent calls this Actor with `url` + `intent`, gets the returned filters, and uses them to wire up monitoring elsewhere — no manual API key handling, no platform-specific glue code.

### Examples

```jsonc
// Track price drops on a product page (AI-driven trigger patterns)
{
  "url": "https://www.amazon.com/dp/B08N5WRWNW",
  "intent": "Notify me when the price drops below $200",
  "fetchMode": "playwright"
}

// Article changelog monitoring (no AI — noise filters only, lower cost)
{
  "url": "https://nextjs.org/docs/app/api-reference/components",
  "fetchMode": "http",
  "useEasyList": false
}

// Job board monitoring with screenshot
{
  "url": "https://news.ycombinator.com/jobs",
  "intent": "Track new senior backend engineering jobs in Berlin",
  "screenshot": true
}
```

### Limits

- Single URL per run. For multi-URL workflows, run the Actor once per URL or use Apify's Task scheduler / Schedule integration.
- Defuddle returns title/markdown separately — `contentSelector` may be `null` for unstructured pages where Defuddle falls back to Turndown.
- LLM call uses `gpt-4.1-mini` under the hood (cheap, fast, deterministic-leaning). **AI cost is included in the `ai-call` event price** — no API key for you to manage. The `aiTokens` field in the output is for transparency only.

### Source & methodology

Engine: `@site-spy/smart-config-core` — the same module used in production by the Site Spy change-detection service. **Tested on 1,066 real production pages with 99.4% configure-success** — works on sites that break generic scrapers (A/B-tested layouts, hashed CSS classes, JS-heavy SPAs, non-English content).

Source is bundled into the Actor image at publish time. Hybrid architecture: deterministic extractors (Defuddle, JSON-LD, EasyList, regex pattern library) do most of the work; the LLM (`gpt-4.1-mini`) is only invoked for noise + trigger generation when the user provides intent.

# Actor input Schema

## `url` (type: `string`):

Any HTTP(S) URL. The Actor fetches this page and analyzes it to produce filter recommendations and extracted content.

## `intent` (type: `string`):

Plain-English description of the change you want to detect. Examples: 'Notify me when the price drops below $50', 'Track new job postings', 'Tell me when SOLD OUT appears'. Leave empty to skip the LLM call and produce noise-only filters at a lower per-run cost.

## `fetchMode` (type: `string`):

'http' is cheap and fast for static pages. 'playwright' renders JavaScript-heavy SPAs and pages that block plain HTTP fetchers.

## `screenshot` (type: `boolean`):

Save a full-page PNG to the key-value store. Only available with 'playwright' fetch mode. Adds a screenshot event to billing.

## `useEasyList` (type: `boolean`):

Apply EasyList + Fanboy's Cookie List to suggest selectors for ads, cookie banners, and tracking widgets to remove from monitoring.

## `userAgent` (type: `string`):

Override the default User-Agent string for the page fetch. Leave empty to use the Apify default.

## Actor input object example

```json
{
  "url": "https://news.ycombinator.com",
  "intent": "Track new top stories",
  "fetchMode": "playwright",
  "screenshot": false,
  "useEasyList": true
}
```

# 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 = {
    "url": "https://news.ycombinator.com",
    "intent": "Track new top stories"
};

// Run the Actor and wait for it to finish
const run = await client.actor("vkuprin/universal-ai-page-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 = {
    "url": "https://news.ycombinator.com",
    "intent": "Track new top stories",
}

# Run the Actor and wait for it to finish
run = client.actor("vkuprin/universal-ai-page-monitor").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 '{
  "url": "https://news.ycombinator.com",
  "intent": "Track new top stories"
}' |
apify call vkuprin/universal-ai-page-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=vkuprin/universal-ai-page-monitor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Universal AI Page Monitor",
        "description": "Monitor any URL for changes — Amazon products, LinkedIn profiles, job boards, pricing pages, Hacker News, GitHub. AI generates CSS selectors + regex filters in plain English. Works in any language. No API key needed. MCP-ready for Claude, Cursor, Codex, Gemini, Cline.",
        "version": "0.1",
        "x-build-id": "gln7b0kx7esa2hCYd"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/vkuprin~universal-ai-page-monitor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-vkuprin-universal-ai-page-monitor",
                "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/vkuprin~universal-ai-page-monitor/runs": {
            "post": {
                "operationId": "runs-sync-vkuprin-universal-ai-page-monitor",
                "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/vkuprin~universal-ai-page-monitor/run-sync": {
            "post": {
                "operationId": "run-sync-vkuprin-universal-ai-page-monitor",
                "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": [
                    "url"
                ],
                "properties": {
                    "url": {
                        "title": "URL to monitor",
                        "pattern": "^https?://",
                        "type": "string",
                        "description": "Any HTTP(S) URL. The Actor fetches this page and analyzes it to produce filter recommendations and extracted content."
                    },
                    "intent": {
                        "title": "What to monitor (plain English)",
                        "type": "string",
                        "description": "Plain-English description of the change you want to detect. Examples: 'Notify me when the price drops below $50', 'Track new job postings', 'Tell me when SOLD OUT appears'. Leave empty to skip the LLM call and produce noise-only filters at a lower per-run cost."
                    },
                    "fetchMode": {
                        "title": "Fetch mode",
                        "enum": [
                            "http",
                            "playwright"
                        ],
                        "type": "string",
                        "description": "'http' is cheap and fast for static pages. 'playwright' renders JavaScript-heavy SPAs and pages that block plain HTTP fetchers.",
                        "default": "playwright"
                    },
                    "screenshot": {
                        "title": "Capture screenshot",
                        "type": "boolean",
                        "description": "Save a full-page PNG to the key-value store. Only available with 'playwright' fetch mode. Adds a screenshot event to billing.",
                        "default": false
                    },
                    "useEasyList": {
                        "title": "Filter ads & cookie banners",
                        "type": "boolean",
                        "description": "Apply EasyList + Fanboy's Cookie List to suggest selectors for ads, cookie banners, and tracking widgets to remove from monitoring.",
                        "default": true
                    },
                    "userAgent": {
                        "title": "Custom User-Agent (optional)",
                        "type": "string",
                        "description": "Override the default User-Agent string for the page fetch. Leave empty to use the Apify default."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
