# ReadFetch Stateless Change Detection (Diff)

> ReadFetch Stateless Change Detection (Diff) is a paid API for AI agents from readfetch.com, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-31).

Detects whether a web page has changed since a previous fetch by comparing a stored hash, and returns a bounded text diff if it has.

## Facts

- Endpoint: POST https://readfetch.com/v1/diff?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/readfetch-stateless-change-detection-diff-4be2d468
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_4Q2IaLoHWIK6vI-qzhpZO

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 readfetch-stateless-change-detection-diff-4be2d468 -d '<json body>'
```

Example prompt: Check if https://example.com/pricing has changed since my last visit — I have the hash sha256:abc123def456 from before — and if it has, show me what text was added or removed as a plain text diff.

## When to prefer this

Choose this endpoint when you need stateless change detection — you hold the hash from a previous call and want to know if a page changed without the service maintaining session state for you. Ideal for polling workflows where you store the hash on your side and periodically check for updates. Prefer over full-scrape endpoints when bandwidth and cost matter, since an unchanged response is cheap and a changed response gives you only the delta. Use the residential egress option for sites that block datacenter IPs.

## Known failure modes

- URL unreachable or returns non-200 status — endpoint may return an error or empty diff
- Timeout exceeded (max 120s) if the target page is slow to respond
- Residential egress unavailable or blocked by target — may fall back or error
- Hash mismatch due to dynamic page content (ads, timestamps) causing false positives
- Invalid sha256 hash format in previous_hash field causes validation error
- Page content too large for bounded diff — diff may be truncated

## How this service works

Stateless change detection: send the hash you hold, get changed/unchanged and a bounded diff. A no-change answer is billable.

## Output

Returns a changed/unchanged status flag, a new sha256 hash of the current page content, and (if changed) a bounded diff showing added and removed text segments. If previous_content was provided, the diff includes line-level additions and deletions. An unchanged response is still billable.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "url": {
   "type": "string",
   "format": "uri",
   "description": "Public http(s) page to re-fetch and compare; must match the extraction used when you saved the hash (same `format`)."
  },
  "format": {
   "enum": [
    "text",
    "markdown"
   ],
   "type": "string",
   "default": "text",
   "description": "Extraction flavour for this fetch and for the hash (default text). Must match how you built `previous_content` if you send it."
  },
  "timeout_s": {
   "type": "number",
   "default": 30,
   "maximum": 60,
   "minimum": 1,
   "description": "Total budget for the whole call in seconds, both fetches included. 60 s is the ceiling on this route."
  },
  "previous_hash": {
   "anyOf": [
    {
     "type": "string"
    },
    {
     "type": "null"
    }
   ],
   "description": "`sha256:…` or bare hex from readfetch_diff, readfetch_probe `content_sha256`, or a prior text read. Omit on the first poll to establish a baseline hash in the response."
  },
  "previous_content": {
   "anyOf": [
    {
     "type": "string"
    },
    {
     "type": "null"
    }
   ],
   "description": "Full prior extracted text (what you stored from readfetch_text/readfetch_diff). Required for `added`/`removed`/`diff` output; hash-only compares do not emit a line diff."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/readfetch-stateless-change-detection-diff-4be2d468/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from readfetch.com](https://www.zero.xyz/host/readfetch.com/llms.txt)
