# Watch & Diff Snapshot

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

Fetches, normalizes, hashes, and returns the content of any URL so an agent can detect changes between calls using the returned content hash.

## Facts

- Endpoint: GET https://watch-diff.agent-utils.workers.dev/v1/snapshot
- Price: $0.005/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-snapshot-1eb48951
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_DYKouZ3dnYS7IkcW0Nqdr

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-snapshot-1eb48951
```

Example prompt: Check whether https://example.com/pricing has changed since the last time you looked — fetch it in text mode and give me the content hash and the actual text so I can compare.

## When to prefer this

Use this endpoint when an AI agent needs to periodically check a specific URL for content changes without maintaining its own fetch and hashing infrastructure. It is ideal for recurring scheduled tasks where state (previous hash) is maintained per paying wallet for 90 days. Prefer this over generic HTTP fetch tools when you need normalized, mode-aware content (text/html/json) and a stable content hash for diffing. The CSS selector feature makes it superior for monitoring specific regions of a page rather than the whole document.

## Known failure modes

- Target URL returns a non-2xx status (e.g. 404 or 500) — status field reflects this but content may be empty or an error page
- URL exceeds the 2 MB body limit — response may be truncated or rejected
- CSS selector matches no elements — content field will be empty
- Payment not attached or insufficient — x402 payment required error returned
- Target site blocks the fetcher (bot detection, Cloudflare challenge) — fetch may fail or return challenge page content instead of real content
- URL is not reachable or DNS fails — fetch error returned

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

A JSON object containing the fetched page content (up to maxChars characters), the SHA-based content hash of the normalized body, HTTP status code, final URL after redirects, ETag and Last-Modified headers if present, fetch timestamp, response time in milliseconds, content type, byte and character counts, and a truncated flag. The content hash is the primary signal for change detection across calls.

## 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"
      },
      "maxChars": {
       "type": "integer",
       "default": 20000,
       "maximum": 100000,
       "minimum": 200,
       "description": "Cap on returned content length"
      },
      "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"
      },
      "etag": {
       "type": [
        "string",
        "null"
       ]
      },
      "mode": {
       "enum": [
        "text",
        "html",
        "json"
       ],
       "type": "string",
       "default": "text",
       "description": "text = readable text (default); html = normalized markup; json = canonicalized JSON body"
      },
      "bytes": {
       "type": "integer"
      },
      "chars": {
       "type": "integer"
      },
      "status": {
       "type": "integer"
      },
      "content": {
       "type": "string"
      },
      "finalUrl": {
       "type": "string"
      },
      "fetchedAt": {
       "type": "string"
      },
      "truncated": {
       "type": "boolean"
      },
      "responseMs": {
       "type": "integer"
      },
      "contentHash": {
       "type": "string"
      },
      "contentType": {
       "type": "string"
      },
      "lastModified": {
       "type": [
        "string",
      
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "url": "https://example.com/",
  "etag": null,
  "mode": "text",
  "bytes": 1256,
  "chars": 180,
  "status": 200,
  "content": "Example Domain\nThis domain is for use in illustrative examples in documents.",
  "finalUrl": "https://example.com/",
  "fetchedAt": "2026-09-06T21:10:00.000Z",
  "truncated": false,
  "responseMs": 120,
  "contentHash": "7f3b…",
  "contentType": "text/html; charset=UTF-8",
  "lastModified": null
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/watch-diff-snapshot-1eb48951/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)
