{"slug":"api-fresh402-com-v1-check-31b27a","title":"Use Check for a changed/unchanged signal and optional compact text diff","host":"api.fresh402.com","method":"POST","resource":"https://api.fresh402.com/v1/check","category":"other","description":"Use Check for a changed/unchanged signal and optional compact text diff. Exactly one URL or existing watch ID; URL plus rules can create a watch, whereas watch_id reuses saved rules and forbids overrides. Use Smart Diff for structured changes. On-demand only; x402 $0.005 USDC on Base, including cach","price_listed":0.005,"price_asked":0.005,"state":"answering","state_label":"Answering","checks_7d":2,"answered_7d":2,"latency_ms_median":911,"reported_calls_30d":1,"reported_payers_30d":1,"networks":["eip155:8453"],"badge":"unverified","paid_checks_7d":0,"paid_ok_7d":0,"example_input":{"body":{"include_diff":true,"url":"https://example.com/"},"bodyType":"json","method":"POST","type":"http"},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"additionalProperties":false,"properties":{"body":{"$schema":"https://json-schema.org/draft/2020-12/schema","description":"Paid Check input: exactly one of url or watch_id is required. Content rules are allowed only on the url path; watch_id always reuses saved rules. Optional previous_hash overrides the reference hash; max_age_seconds controls cache reuse and include_diff controls text-diff output.","examples":[{"include_diff":true,"max_age_seconds":0,"selector":"main","url":"https://example.com/docs"}],"oneOf":[{"required":["url"]},{"required":["watch_id"]}],"properties":{"html_attributes":{"description":"Optional HTML-only watch rule: up to4 of href,title,alt,aria-label; default[] retains existing text-only normalization. Distinct names are sorted; nonempty rules create a separate version1 watch/baseline. Records bounded meaningful attributes within the saved selector or filtered page, including same-text link destination changes. Cannot be supplied with watch_id, even[]. Unsafe hrefs are hashed, never fetched. Limits:200 elements,2048 characters/value,32768 evidence bytes; excess fails, never clips silently.","items":{"description":"One explicitly observed HTML attribute: href (a/area only),title,alt or aria-label. No class/style/event attributes; links are inert evidence and never fetched.","enum":["alt","aria-label","href","title"],"type":"string"},"maxItems":4,"type":"array"},"ignore_json_paths":{"description":"Optional JSON-only exclusions, up to 20 paths of 1-256 characters starting with '/'; '~0'/'~1' escapes and '*' segments are supported. Example: ['/updated_at']. Accepted only with url; default []. With watch_id, omit entirely (including []): saved paths are reused.","items":{"description":"JSON Pointer-style path, 1-256 characters, starting with '/'. Decode '~0' as '~' and '~1' as '/'; '*' matches all object keys or array elements. Example: '/items/*/updated_at'.","maxLength":256,"minLength":1,"pattern":"^\\/","type":"string"},"maxItems":20,"type":"array"},"ignore_selectors":{"description":"Optional HTML-only exclusion array, up to 20 supported CSS selectors of 1-256 characters each, e.g. ['.timestamp']. Accepted only with url; default []. With watch_id, omit the field entirely (including []): saved exclusions are reused.","items":{"description":"HTML element(s) to remove before normalization: a supported CSS selector, 1-256 characters, e.g. '.timestamp' or 'nav'.","maxLength":256,"minLength":1,"type":"string"},"maxItems":20,"type":"array"},"include_diff":{"description":"Optional boolean; runtime default: true. Request a compact deterministic text diff when content changed and compatible prior text is retained. False omits the diff; true cannot recover unavailable old content and does not enable Smart Diff's structural analysis.","type":"boolean"},"max_age_seconds":{"description":"Optional integer cache age in seconds, 0-86400; runtime default: 0. A positive value permits reuse of a sufficiently recent watch result without fetching. Zero contacts the source (conditional HTTP may return 304). Cached Checks still require payment; this does not schedule background polling.","maximum":86400,"minimum":0,"type":"integer"},"previous_hash":{"description":"Optional previous Fresh402 content hash: exactly 64 hexadecimal characters, case-insensitive. Overrides comparison with the watch's current stored hash. Omit to use that stored hash; a new URL watch without a prior hash returns changed:null. Hash comparison does not require retained old text, but a text diff does; a hash cannot reconstruct missing content.","pattern":"^[a-fA-F0-9]{64}$","type":"string"},"selector":{"description":"Optional HTML CSS scope, 1-256 characters, e.g. 'main'; accepted only with url. Omit for the page after built-in noise removal. No match returns 422; not supported for JSON/plain text. With watch_id, omit this field: the saved selector is reused.","maxLength":256,"minLength":1,"type":"string"},"url":{"description":"Supply exactly one of url or watch_id. URL must be absolute public HTTPS on port 443, at most 4096 characters, with no credentials/private targets, e.g. 'https://example.com/docs'. Fresh402's own service URLs, including its discovery /openapi.json, cannot be targets; choose an external public document. With url, optional content rules identify the watch; an existing watch is reused or a new one is created by this paid Check. Separate registration is not required. No JavaScript rendering.","format":"uri","maxLength":4096,"pattern":"^[Hh][Tt][Tt][Pp][Ss]://","type":"string"},"watch_id":{"description":"Supply exactly one of watch_id or url. An existing ID returned by fresh402_register (free), POST /v1/register, or a URL-based Check: 'w_' followed by 32 lowercase hexadecimal characters. Reuses that watch's stored URL and rules. When supplied, omit selector, ignore_selectors and ignore_json_paths entirely, even empty arrays. Do not invent an ID.","pattern":"^w_[a-f0-9]{32}$","type":"string"}},"type":"object"},"bodyType":{"enum":["json","form-data","text"],"type":"string"},"method":{"enum":["POST"],"type":"string"},"type":{"const":"http","type":"string"}},"required":["type","method","bodyType","body"],"type":"object"},"output":{"properties":{"example":{"properties":{"cache_status":{"type":"string"},"cached":{"type":"boolean"},"changed":{"type":["boolean","null"]},"checked_at":{"type":"string"},"comparison_source":{"type":"string"},"content_kind":{"type":"string"},"diff":{"properties":{"added_excerpt":{"type":"string"},"available":{"type":"boolean"},"change_ratio":{"type":"number"},"changed":{"type":"boolean"},"content_truncated":{"type":"boolean"},"excerpt_truncated":{"description":"True when bounded contextual added/removed excerpts were clipped; independent of retained snapshot completeness.","type":"boolean"},"reason":{"type":"string"},"removed_excerpt":{"type":"string"}},"type":"object"},"final_url":{"type":"string"},"hash":{"type":"string"},"html_attribute_rules_version":{"const":1},"html_attributes":{"items":{"enum":["href","title","alt","aria-label"]},"type":"array"},"network_fetched":{"type":"boolean"},"noise_detected":{"type":"boolean"},"normalizer_version":{"type":"integer"},"persistence_error":{"type":"string"},"previous_hash":{"type":["string","null"]},"raw_changed":{"type":["boolean","null"]},"snapshot_saved":{"type":"boolean"},"snapshot_truncated":{"type":"boolean"},"url":{"type":"string"},"watch_id":{"type":"string"}},"required":["watch_id","hash","changed","content_kind"],"type":"object"},"type":{"type":"string"}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"},"history":[{"day":"2026-10-31","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.005,"price_match":true,"latency_ms":952,"error":null},{"day":"2026-10-29","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.005,"price_match":true,"latency_ms":871,"error":null}],"description_full":"Use Check for a changed/unchanged signal and optional compact text diff. Exactly one URL or existing watch ID; URL plus rules can create a watch, whereas watch_id reuses saved rules and forbids overrides. Use Smart Diff for structured changes. On-demand only; x402 $0.005 USDC on Base, including cache hits.","last_updated":"2026-10-29T07:52:14.678Z","schemes":["exact"]}