# Watch & Diff

> Watch & Diff is a paid API for AI agents from watch-diff.agent-utils.workers.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Fetches a URL, normalizes and hashes its content, then diffs it against the last known state to tell you whether it changed

## Facts

- Endpoint: GET https://watch-diff.agent-utils.workers.dev/v1/check
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/watch-diff-9e432119
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_b9dFaJSo1J4nIf7jqlaKa

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability watch-diff-9e432119
```

Example prompt: Check if https://example.com/pricing has changed since the last time you looked — compare just the text inside '.pricing-table' and tell me what lines were added or removed.

## When to prefer this

Choose this endpoint when an AI agent needs to detect whether a specific web page, sub-region (via CSS selector), or JSON API response has changed between periodic runs, without storing state itself. It is purpose-built for recurring agent tasks where the agent's paying wallet address automatically scopes state, eliminating the need for a separate database or API key. Prefer it over generic scrapers when you need a normalized diff (added/removed lines) rather than raw HTML, and over full crawlers when you only care about a single URL.

## Known failure modes

- URL unreachable or returns non-200 — status field reflects HTTP error, changed may be null
- First check always returns changed: null and firstCheck: true with no diff
- CSS selector matches nothing — diff is empty or excerpt is blank
- URL body exceeds 2 MB — request rejected
- Invalid URL format — request rejected at validation
- State not found after 90 days — treated as first check

## How this service works

Did this URL change since my last check? Fetch, normalize, hash and diff any page, region or JSON for AI agents running recurring tasks. State per paying wallet, 90 days. Pay per call over x402, no API key.

## Output

Returns a JSON object indicating whether the page changed (boolean, or null on first check), the current and previous content hashes, a structured diff with added and removed lines, an excerpt of current content, HTTP status, response time in ms, etag, last-modified header, timestamps of the current and previous checks, content type, byte size, and the watcher ID scoping the state.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "url"
     ],
     "properties": {
      "url": {
       "type": "string",
       "format": "uri",
       "description": "Absolute http(s) URL to fetch (max 2 MB body)"
      },
      "mode": {
       "enum": [
        "text",
        "html",
        "json"
       ],
       "type": "string",
       "default": "text",
       "description": "text = readable text (default); html = normalized markup; json = canonicalized JSON body"
      },
      "watcher": {
       "type": "string",
       "description": "Optional watcher id (3-64 chars) to scope state; defaults to the paying wallet address"
      },
      "selector": {
       "type": "string",
       "description": "Optional CSS selector; only text inside matching elements is compared (e.g. '#price', 'main', 'table.results')"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "url": {
       "type": "string"
      },
      "diff": {
       "anyOf": [
        {
         "type": "object",
         "properties": {
          "added": {
           "type": "array",
           "items": {
            "type": "string"
           }
          },
          "removed": {
           "type": "array",
           "items": {
            "type": "string"
           }
          },
          "truncated": {
           "type": "boolean"
          },
          "addedLines": {
           "type": "integer"
          },
          "removedLines": {
           "type": "integer"
          }
         }
        },
        {
         "type": "null"
        }
       ]
      },
      "etag": {
       "type": [
        "string",
        "null"
       ]
      },
      "mode": {
       "enum": [
        "text",
        "html",
        "json"
       ],
       "type": "string",
       "default": "text",
       "description": "text = readable text (default); html = normalized markup; json = canonicalized JSO
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "url": "https://example.com/",
  "diff": null,
  "etag": "\"84238dfc8092e5d9c0dac8ef93371a07:1736799080.121134\"",
  "mode": "text",
  "bytes": 1256,
  "status": 200,
  "changed": false,
  "excerpt": "Example Domain\nThis domain is for use in illustrative examples in documents.",
  "watcher": "evm:0xabc…",
  "finalUrl": "https://example.com/",
  "selector": "body",
  "checkedAt": "2026-09-06T21:10:00.000Z",
  "firstCheck": false,
  "responseMs": 143,
  "contentHash": "7f3b…",
  "contentType": "text/html; charset=UTF-8",
  "lastModified": "Mon, 13 Jan 2025 20:11:20 GMT",
  "previousHash": "7f3b…",
  "previousCheckedAt": "2026-09-05T21:10:00.000Z"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/watch-diff-9e432119/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from watch-diff.agent-utils.workers.dev](https://www.zero.xyz/host/watch-diff.agent-utils.workers.dev/llms.txt)
