Json Diff
Deep-compare two caller-supplied JSON values with deterministic object-key ordering and explicit index-based array semantics. Returns bounded added, removed and changed paths with primitive before/after values when safe; performs no network request, model inference, persistence or mutation.
Forest exposes this capability as a deterministic machine-readable API for software agents. Discovery is free; execution uses the canonical paid endpoint below. The live x402 challenge is the source of truth for payment terms.
$0.001 / callPOST /json/diffx402 · Base
Typical agent tasks
This capability is intended for bounded machine decisions such as:
- compare two JSON payloads and list changed fields
- detect structured output drift between previous and current JSON
- find added removed or changed JSON paths before running downstream work
- diff two API responses deterministically without an LLM
What Forest guarantees
- caller-supplied JSON only; zero network, provider, persistence, mutation or model work
- object keys are traversed in sorted deterministic order and arrays are compared by index
- payload bytes, nesting depth, visited nodes and returned differences are hard bounded
- primitive before/after values are returned only for the affected path; compound values are represented by type only
Boundaries
- JSON Patch generation or application
- semantic entity matching, array reordering detection or set semantics
- schema validation, similarity scoring or domain-specific interpretation
Machine contract
The request and response schemas are published in the canonical OpenAPI document. This page shows a representative input from the same production manifest.
Input example
{
"before": {
"status": "queued",
"retries": 0
},
"after": {
"status": "ready",
"retries": 1
}
}
Canonical paid endpoint
https://http--forest-gas-station-mainnet--lcjl27p8lmjs.code.run/json/diff
Related capabilities
- Json Validate — Validate caller-supplied JSON against Forest bounded JSON Schema subset v1 before an agent trusts or forwards structured output. Returns deterministic machine-readable violations with stable paths; performs no network request, remote $ref resolution, regex evaluation, model inference or mutation.
- Json Query — Extract one bounded value from caller-supplied JSON using a deterministic simple path such as items[2].name or $.data.id. Forest performs no network request or model inference, returns an explicit found flag, and supports only dot object keys plus numeric array indexes so lookup behavior stays predictable.
- Blob Decode — Identify and unwrap a bounded caller-supplied opaque string into readable JSON, text or binary evidence using deterministic local rules for JWT payloads, canonical Base64/Base64URL and gzip. Ambiguous hex/Base64 representations stop in auto mode; canonical hex and Brotli can be selected only through explicit bounded hints. JWT claims are decode-only and always marked unverified.
- Openapi Payload-validate — Validate one caller-supplied JSON request or response payload against the documented JSON schema for one exact OpenAPI or Swagger operation. Forest fetches only the supplied public specification, never invokes the described API operation, resolves only bounded local references, and reuses the same deterministic schema subset as json.validate.