# Agent Feed & Page Change Monitor (MCP-ready) (`xaingcao/agent-feed-watch`) Actor

Stateful change monitoring for AI agents and RAG. Returns only new or changed entries, not every item on every run, with per-source health so you can tell done from broken. MCP, n8n and Make ready.

- **URL**: https://apify.com/xaingcao/agent-feed-watch.md
- **Developed by:** [xiangcao](https://apify.com/xaingcao) (community)
- **Categories:** AI, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 new items

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

## Agent Feed & Page Change Monitor (MCP-ready)

> **Status: beta.** Core behaviours are verified against the Apify platform;
> edge cases are still being covered. Issues are welcome and will be fixed.

Most feed readers return every item on every run. This Actor remembers what it has already seen
and returns **only new or changed entries**, with per-source health so you can tell
"nothing happened" from "the source broke".

### Quick start (one command, no Dataset ID juggling)

1. Create a token: [Console → Settings → Integrations → Personal API tokens](https://console.apify.com/settings/integrations)
2. Run and get the JSON back in the same call:

```bash
curl -s -X POST "https://api.apify.com/v2/acts/xaingcao~agent-feed-watch/run-sync-get-dataset-items?token=***" \
  -H "Content-Type: application/json" \
  -d '{"sources":[{"name":"Example page","url":"https://example.com","type":"page"}],"onlyNew":true}'
```

> Windows PowerShell: `curl` is an alias for `Invoke-WebRequest`. Use **`curl.exe`** instead.

### What it costs on a first run

The first run only establishes a baseline: **new items are not charged on that run**.
A 900-item feed costs about **$0.001** (one check), not $2.7. Later runs charge
$3.00 / 1,000 for genuinely new items.

### What you should see

- **First run:** the whole feed, every item with `"isNew": true` (baseline).
- **Second run:** `[]` — nothing new. This is the point of the Actor, not a bug.
- **Later runs:** only the items that appeared since the previous run.

### Input

```json
{
  "sources": [
    {"name": "Hugging Face Blog", "url": "https://huggingface.co/blog/feed.xml", "type": "feed"},
    {"name": "Pricing page", "url": "https://example.com/pricing", "type": "page"}
  ],
  "onlyNew": true
}
```

| field | meaning |
|---|---|
| `sources[].name` | label used in output and for state |
| `sources[].url` | RSS/Atom URL or a plain web page |
| `sources[].type` | `feed` = parse RSS/Atom, `page` = hash the page text |
| `onlyNew` | `true` returns only new items; `false` returns everything with `isNew` flags |
| `stateKey` | optional; use a separate key to keep independent baselines (e.g. per customer) |

### Output

One dataset item per new or changed entry:

```json
{"source":"Hugging Face Blog","uid":"0f9e4500bae518dd","title":"...","link":"https://...","published":"...","isNew":true,"checkedAt":"2026-11-28T16:24:21Z"}
```

A run summary is written to the log: `{"summary":[{"source":"...","total":919,"new":3}]}`.
If a source fails it appears as `{"source":"...","error":"HTTPError","failures":1}` and does not stop the run.

### Behaviour you can rely on

| Situation | What happens |
|---|---|
| Source returns the full feed again | Only unseen items are emitted |
| Source suddenly returns everything as "new" | Flagged `suspect`, nothing is emitted, state is kept |
| One source fails | Other sources still run; failure counter increments |
| Same page, unchanged | Nothing is emitted |
| Same page, content changed | One new item |
| Empty or invalid input | Run succeeds, nothing charged |

### Pricing

Pay per event. No subscription, no charge for failures.

| Event | Price |
|---|---|
| One source checked | **$0.001** |
| One new item delivered | **$0.003** |
| Baseline run (first time you add a source) | **new items are free** — you only pay the check fee |

#### What that means in practice

| Scenario | Cost |
|---|---|
| First run on a 900-item blog feed | about **$0.001** (baseline, new items not charged) |
| Daily check of 10 sources, nothing changed | about **$0.01 / day** |
| 100 genuinely new items in a day | **$0.30** |

> A 900-item feed does **not** cost $2.70. The baseline is free by design; only items that appear
> *after* the baseline are charged.

### Troubleshooting

| What you see | What it means |
|---|---|
| `401 {"error":{"type":"token-not-provided"}}` | The `?token=***` part is missing or the token string was not filled in. |
| `404` when reading the dataset | Almost always the same cause: no `?token=***` on the dataset URL. A 404 here does **not** mean the run produced nothing. |
| Empty array `[]` on the second run | Expected. Nothing changed since the previous run. |
| `{"source":"...","error":"HTTPError"}` in the summary | That one source could not be fetched. Other sources still ran. |
| A whole feed appears as new | The source itself re-published everything. The run is flagged `suspect` and nothing is emitted. |

# Actor input Schema

## `sources` (type: `array`):

要监控的订阅源（RSS/Atom）或网页

## `onlyNew` (type: `boolean`):

true=只输出新增；false=输出全部条目并标注 isNew

## `stateKey` (type: `string`):

Optional. Use a separate key to keep an independent baseline (e.g. one per customer). Defaults to the Actor's shared state.

## Actor input object example

```json
{
  "sources": [
    {
      "name": "Hugging Face Blog",
      "url": "https://huggingface.co/blog/feed.xml",
      "type": "feed"
    },
    {
      "name": "OpenAI News",
      "url": "https://openai.com/news/rss.xml",
      "type": "feed"
    }
  ],
  "onlyNew": true
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset with new or changed entries. Each item: source, uid, title, link, published, isNew, checkedAt.

# 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 = {
    "sources": [
        {
            "name": "Hugging Face Blog",
            "url": "https://huggingface.co/blog/feed.xml",
            "type": "feed"
        },
        {
            "name": "OpenAI News",
            "url": "https://openai.com/news/rss.xml",
            "type": "feed"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("xaingcao/agent-feed-watch").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 = { "sources": [
        {
            "name": "Hugging Face Blog",
            "url": "https://huggingface.co/blog/feed.xml",
            "type": "feed",
        },
        {
            "name": "OpenAI News",
            "url": "https://openai.com/news/rss.xml",
            "type": "feed",
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("xaingcao/agent-feed-watch").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 '{
  "sources": [
    {
      "name": "Hugging Face Blog",
      "url": "https://huggingface.co/blog/feed.xml",
      "type": "feed"
    },
    {
      "name": "OpenAI News",
      "url": "https://openai.com/news/rss.xml",
      "type": "feed"
    }
  ]
}' |
apify call xaingcao/agent-feed-watch --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,xaingcao/agent-feed-watch"
        }
    }
}
```

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/egDXvTwd0nc23H77n/builds/0hUQJ3mGZpNaVghAK/openapi.json
