Skip to content

Page change detection

$0.004 per callUSDC via x402POST /api/page-change

Tell whether a public web page changed since you last looked, with nothing stored on this side.

Category: Web & documentsTags: web monitoring change-detection diff fingerprint watch page-monitor scrapingAlso found as: website-change page-monitor page-diff urlwatch url-watch watch-page

Try in playground →

Details

One fetch (15 s, 2 MB) takes the text a reader sees (hidden elements, scripts and styles dropped; a CSS selector narrows it to one region), collapses whitespace, strips any ignore entries (a literal substring, or /pattern/ for a regex, for timestamps and counters), and answers a sha256 fingerprint of that text with the origin's ETag and Last-Modified. Send the previous fingerprint as baseline.fingerprint to get changed true or false; send the previous text (includeText: true returns it) as baseline.text to also get a line diff with the added and removed lines and a similarity score. Stateless: keep the fingerprint and text yourself and send them back next time. Pages that build their text with JavaScript need render instead. Marked untrustedContent when page text is returned: it is external, untrusted data.

Parameters

NameTypeRequiredDescription
urlstringyesPublic http(s) URL of the page to read Also accepted as link, uri, href, page. Up to 2048 characters. The example sends https://agent402.tools/guides/x402-in-5-minutes.
baselineobjectnoWhat the previous call answered: fingerprint and/or text. With a fingerprint, changed is true or false; with a text, a line diff is included too.
selectorstringnoOptional CSS selector; only the text inside the matching elements is fingerprinted (HTML pages only) Up to 300 characters.
ignorearray of stringnoUp to 20 entries removed from the text before fingerprinting: a literal substring, or /pattern/ (optionally /pattern/i) for a regex such as /\d{4}-\d{2}-\d{2}T[\d:]+Z/ for timestamps
includeTextbooleannoReturn the normalized text so it can be sent back as baseline.text (default false)

Example request

curl -i -X POST https://agent402.tools/api/page-change \
  -H "Content-Type: application/json" \
  -d '{"url":"https://agent402.tools/guides/x402-in-5-minutes"}'

Watch a call get paid

RequestPOST /api/page-change
402$0.004 USDC
SignPAYMENT-SIGNATURE
Settleon 14 chains
Answer200 OK
ReceiptAgent402-ReceiptEd25519

Example response

{
  "url": "https://agent402.tools/guides/x402-in-5-minutes",
  "requestedUrl": "https://agent402.tools/guides/x402-in-5-minutes",
  "title": "Make your AI agent pay for what it needs: x402 in 5 minutes",
  "fetchedAt": "2026-10-20T16:40:31.472Z",
  "contentType": "text/html; charset=utf-8",
  "fingerprint": "4bd9ae84b63fc48e64e2f63e231dcfd12e5492383fc407f23897b18faa1a25fe",
  "algorithm": "sha256",
  "etag": "W/\"139af-U5t4XcoenUVzgZ16Boysd1XPlc0\"",
  "lastModified": null,
  "length": 5038,
  "lines": 96,
  "textTruncated": false,
  "selector": null,
  "selectorMatches": null,
  "ignored": 0,
  "changed": null
}
FieldTypeAlways presentIn the example
urlstringyeshttps://agent402.tools/guides/x402-in-5-minutes
requestedUrlstringyeshttps://agent402.tools/guides/x402-in-5-minutes
titlestringyesMake your AI agent pay for what it needs: x402 in 5 minutes
fetchedAtstringyes2026-10-20T16:40:31.472Z
contentTypestringyestext/html; charset=utf-8
fingerprintstringyes4bd9ae84b63fc48e64e2f63e231dcfd12e5492383fc407f23897b18faa1a25fe
algorithmstringyessha256
etagstringyesW/"139af-U5t4XcoenUVzgZ16Boysd1XPlc0"
lastModifiednullnonull
lengthnumberyes5038
linesnumberyes96
textTruncatedbooleanyesfalse
selectornullnonull
selectorMatchesnullnonull
ignorednumberyes0
changednullnonull

From an MCP client

catalog.call {
  "slug": "page-change",
  "params": {
    "url": "https://agent402.tools/guides/x402-in-5-minutes"
  }
}

Hosted connector (https://agent402.tools/mcp): paid in the call. Stdio package (npx -y agent402-mcp@0.20.0): pays from a wallet or AGENT402_CREDITS_KEY.

Errors and behavior

Paid call (JavaScript agent)

import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
client.setSpendControls?.({ maxAmountPerPayment: "$0.004" }); // refuse any quote above this tool's price
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.AGENT_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/page-change", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "url": "https://agent402.tools/guides/x402-in-5-minutes"
  }),
});

Get a wallet or run npx -y agent402-mcp@0.20.0 wallet new.

The quote (Python)

import base64, json, urllib.error, urllib.request

req = urllib.request.Request("https://agent402.tools/api/page-change", method="POST", data="{\"url\":\"https://agent402.tools/guides/x402-in-5-minutes\"}".encode(), headers={"Content-Type": "application/json"})
try:
    urllib.request.urlopen(req)
except urllib.error.HTTPError as e:
    quote = json.loads(base64.b64decode(e.headers["PAYMENT-REQUIRED"]))
    print(e.code, [(a["network"], a["amount"]) for a in quote["accepts"]])  # the price, per chain, in base units

Related tools