{"uid":"cap_q8_1n7hBUmDpUKrYjpbwD","slug":"fresh402-smart-diff-d88c11f7","name":"Fresh402 Smart Diff","description":"Fresh402 2.0.0: durable payment results, private recovery, public web extraction, structural comparison and backward-compatible freshness. On-demand requests; no browser rendering or LLM inference.","url":"https://fresh402.kirilllabs.workers.dev/v2/smart-diff?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"watch_id":{"type":"string","pattern":"^w_[a-f0-9]{32}$","description":"Required existing watch ID: 'w_' plus 32 lowercase hexadecimal characters, returned by free fresh402_register or POST /v1/register (a URL-based Check can also create it). Reuses the saved public URL and content rules; do not pass url or new rules here. Replace illustrative IDs with a real returned ID before paying."},"compare_to":{"enum":["previous","baseline"],"type":"string","default":"previous","description":"Optional comparison mode: 'previous' (default) uses the latest Smart Diff snapshot, falling back to the current registered watch state on the first call. 'baseline' uses the fixed Smart Diff baseline, initially seeded from the earliest retained compatible watch snapshot. previous_hash overrides either mode. 'hash' is a result label, not an accepted input value."},"previous_hash":{"type":"string","pattern":"^[a-fA-F0-9]{64}$","description":"Optional explicit reference hash: 64 hexadecimal characters, case-insensitive, from this same watch's retained Smart Diff snapshot, fixed baseline or retained registration/Check snapshot. Overrides compare_to. Unknown or pruned hashes return 404; recent snapshot history is limited to 20 per store, with the fixed Smart Diff baseline retained separately. Omit for the selected mode."},"json_array_keys":{"type":"array","items":{"type":"object","required":["path","key"],"properties":{"key":{"type":"string","pattern":"^(?:\\/(?:[^~]|~[01])*)?$","maxLength":256,"minLength":1,"description":"Nonempty exact RFC6901 pointer within each object item, up to256 characters/64 segments; e.g.'/id' or '/product/sku'. Every key must exist and be a unique nonempty string<=256 characters or safe integer; number1 differs from string'1'."},"path":{"type":"string","pattern":"^(?:\\/(?:[^~]|~[01])*)?$","maxLength":256,"description":"Exact RFC6901 pointer to an array on both compared JSON documents, up to256 characters/64 segments. Empty string selects a root array. Example:'/items'; no wildcards or automatic ID guessing."}},"description":"Explicit JSON array identity rule. Both paths must resolve; missing/duplicate/invalid identities fail422 without index fallback. Source snapshot ordering/hash is retained.","additionalProperties":false},"maxItems":4,"minItems":1,"description":"Optional1-4 explicit nonoverlapping JSON array identity rules, JSON only. Omit for existing index comparison. Matches unique typed scalar keys, reports moves separately from content changes; pure reorder is changed:false while source hashes remain order-sensitive. At most2000 combined array items/20000 comparison work units, no fallback for ambiguity. Rules affect this comparison only, not the watch/hash; persist identical input for payment recovery. Example:[{path:'/items',key:'/id'}]."}}},"responseSchema":{"type":"json","example":{"url":"https://example.com/","hash":"1111111111111111111111111111111111111111111111111111111111111111","counts":{"added":0,"removed":0,"modified":1},"changed":true,"changes":{"added":[],"removed":[],"modified":[{"path":"/price","after":20,"before":10}]},"watch_id":"w_0123456789abcdef0123456789abcdef","algorithm":"deterministic-v1","final_url":"https://example.com/","compare_to":"previous","content_kind":"json","significance":{"level":"medium","score":45,"reasons":["content_changed","numeric_or_price_change"],"rules_version":1},"previous_hash":"0000000000000000000000000000000000000000000000000000000000000000","changes_truncated":false,"comparison_source":"smart_snapshot","comparison_quality":"structural","semantic_model_used":false}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.015","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.015/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.015","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.015","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_aJ0O4MFvXxZZ9Mgq_VJem","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.015","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Performs a structural comparison of a watched URL's current content against a previous or baseline snapshot, returning a detailed diff with change significance scoring.","exampleAgentPrompt":"Check watch ID w_0123456789abcdef0123456789abcdef and show me what structurally changed compared to the previous snapshot — especially any price or numeric field changes.","exampleUseCases":[{"title":"Price change alert on product page","prompt":"For my watch ID w_0123456789abcdef0123456789abcdef, compare the current state to the previous snapshot and tell me if any prices or numeric values changed, and how significant the change is."},{"title":"Baseline regression check for API endpoint","prompt":"I want to diff watch w_abcdef0123456789abcdef0123456789 against its baseline snapshot to see if any JSON fields were added, removed, or modified since I set up the baseline."},{"title":"News page content drift monitoring","prompt":"Run a smart diff on watch w_fedcba9876543210fedcba9876543210 comparing to the previous version and give me a breakdown of what content sections were added or removed and the significance score."}],"resultDescription":"Returns a JSON object containing the current and previous content hashes, counts of added/removed/modified fields, a detailed changes object listing each modified path with before/after values, a significance assessment (level, score, and reasons), the content kind (e.g. JSON or HTML), the comparison quality, and whether any changes were truncated.","failureModes":["Invalid or malformed watch_id (not matching ^w_[a-f0-9]{32}$ pattern) returns a validation error","watch_id not found or not yet registered returns a 404-style error","previous_hash provided does not match any stored snapshot, leading to comparison failure","Payment not completed or x402 payment header missing results in 402 Payment Required","Target URL is unreachable at diff time, causing a fetch error","compare_to set to 'baseline' but no baseline was ever stored for the watch"],"whenToPreferThis":"Use this endpoint when you need a structured, field-level diff of a watched URL's content changes — especially when you care about significance scoring, which fields changed, and before/after values. Prefer it over simple hash-check endpoints when you want actionable change details rather than just a boolean freshness flag. Best suited for monitoring JSON APIs, pricing pages, or structured HTML where path-level comparison adds value.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-12-03T18:44:04.056Z","isFirstParty":false,"canonicalSlug":"fresh402-smart-diff-d88c11f7"}