Diff
by readfetch.com in Other
Stateless change detection on readable page text (same HTTP-first extraction as readfetch_text): fetch the URL, compare to a hash or prior body you store client-side, return changed/unchanged plus optional line diff. First call with no prior fields returns a baseline hash (see hint). `previous_hash` alone detects change without a line diff; add `previous_content` when you need added/removed/diff. A no-change answer is still billable when text was delivered. Prefer readfetch_t
https://readfetch.com/v1/diff- Price
- $0.003
- per call in USDC
- Uptime
- 99.0%
- last 30 days
- Response time
- 196 ms
- 305 ms slowest 5%
- Last check
- Passed
- 5 h ago, next any minute now
Reliability
Status and outage history · Atom feed · Watch with other listings
How to call it
POST https://readfetch.com/v1/diff
Each call costs $0.003 in USDC on Base, paid with the request over x402.
Run a free test callOne unpaid request, the way an agent sends it. You see the payment challenge it gets back. Nothing is charged.
Example request
From the listing.
POST https://readfetch.com/v1/diff
content-type: application/json
{
"format": "text",
"timeout_s": 30,
"url": "https://example.com"
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
format | string | No | Extraction flavour for this fetch and for the hash (default text). Must match how you built `previous_content` if you send it. One of: text, markdown. Default: "text". |
previous_content | string or null | No | 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. |
previous_hash | string or null | No | `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. |
timeout_s | number | No | Total budget for the whole call in seconds, both fetches included. 60 s is the ceiling on this route. Default: 30. |
url | string (uri) | Yes | Public http(s) page to re-fetch and compare; must match the extraction used when you saved the hash (same `format`). |
Example response
The provider's example. We can't check it without paying.
{
"added": [
"New line"
],
"billed": true,
"changed": true,
"diff": "@@ -1 +1 @@\n-Old line\n+New line",
"hash": "sha256:...",
"hint": null,
"removed": [
"Old line"
],
"status": "changed",
"status_code": 200,
"url": "https://example.com/pricing"
}Call it from code
The curl command shows the payment challenge. The JavaScript and Python versions pay and call, and never pay more than $0.003.
curl: see the payment challenge
# bash or zsh: see the payment challenge. Nothing is charged.
curl -sS -g -i -X POST 'https://readfetch.com/v1/diff' \
-H 'content-type: application/json' \
--data-raw '{"format":"text","timeout_s":30,"url":"https://example.com"}'
# x402 v2 sends the challenge base64-encoded in the PAYMENT-REQUIRED header (v1 sends it in the body).
# To read the header:
curl -sS -g -o /dev/null -D - -X POST 'https://readfetch.com/v1/diff' \
-H 'content-type: application/json' \
--data-raw '{"format":"text","timeout_s":30,"url":"https://example.com"}' \
| grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 --decodeJavaScript: pay and call
// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
// Pays at most $0.003 per call.
const client = new x402Client().setSpendControls({ maxAmountPerPayment: "$0.003" });
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const pay = wrapFetchWithPayment(fetch, client);
// Not sure it's safe to pay? ToolVet checks it first for $0.005. Pay for that from a separate
// client: this one is capped at $0.003 per payment. GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Freadfetch.com%2Fv1%2Fdiff&method=POST
const res = await pay("https://readfetch.com/v1/diff", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"format": "text",
"timeout_s": 30,
"url": "https://example.com"
}),
});
console.log(res.status, await res.text());Python: pay and call
# pip install "x402[requests,evm]"
import os
from eth_account import Account
from x402 import x402ClientSync
from x402.http.clients import x402_requests
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client
# Pays at most $0.003 per call.
client = x402ClientSync().set_spend_controls({"max_amount_per_payment": "$0.003"})
register_exact_evm_client(client, EthAccountSigner(Account.from_key(os.environ["EVM_PRIVATE_KEY"])))
with x402_requests(client) as session:
res = session.post(
"https://readfetch.com/v1/diff",
json={
"format": "text",
"timeout_s": 30,
"url": "https://example.com",
},
)
print(res.status_code, res.text)Security scan
No findings
We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.
Recent checks
| When | Result | HTTP | Time | Price |
|---|---|---|---|---|
| 5 h ago | Passed | 402 | 480 ms | $0.003 |
| 15 h ago | Passed | 402 | 212 ms | $0.003 |
| 26 h ago | Passed | 402 | 287 ms | $0.003 |
| 36 h ago | Passed | 402 | 212 ms | $0.003 |
| 47 h ago | Passed | 402 | 81 ms | $0.003 |
Show 10 older checks
| 2 days ago | Passed | 402 | 65 ms | $0.003 |
| 3 days ago | Passed | 402 | 71 ms | $0.003 |
| 3 days ago | Passed | 402 | 70 ms | $0.003 |
| 5 days ago | Timed out | - | - | - |
| 7 days ago | Passed | 402 | 136 ms | $0.003 |
| 7 days ago | Passed | 402 | 162 ms | $0.003 |
| 7 days ago | Passed | 402 | 167 ms | $0.003 |
| 8 days ago | Passed | 402 | 190 ms | $0.003 |
| 8 days ago | Passed | 402 | 147 ms | $0.003 |
| 9 days ago | Passed | 402 | 371 ms | $0.003 |