# JSON Structural Diff

> JSON Structural Diff is a paid API for AI agents from json-data-tools.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-29).

Performs a structural diff of two JSON documents, identifying every added, removed, changed, or retyped path.

## Facts

- Endpoint: GET https://json-data-tools.x402tookit.com/json-diff?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/json-structural-diff-5d882860
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_G7j7jHDSaKBwUnOmKCAPw

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability json-structural-diff-5d882860
```

Example prompt: Can you diff these two JSON objects and tell me every path that was added, removed, changed, or retyped? Here's the original: {"name":"Alice","age":30,"active":true} and here's the new version: {"name":"Alice","age":31,"role":"admin"}.

## When to prefer this

Use this endpoint when you need a precise, path-level structural diff between two JSON documents, especially when you need to know not just whether values changed but also whether types changed (retyped). Prefer this over manual comparison or generic text diff tools when working with structured JSON data in agent workflows, CI pipelines, or data migration validation tasks. Best for JSON documents under 2000 characters each.

## Known failure modes

- Input JSON exceeds 2000 character limit — response may indicate truncation
- Malformed or invalid JSON in either parameter — endpoint may return an error or partial results
- Missing required query parameters 'a' or 'b' — results in a bad request error
- Non-JSON string passed as input — may fail to parse and return an error response

## How this service works

Structural diff of two JSON documents: every added, removed, changed or retyped path.

## Output

An array of difference objects, each containing the JSON path, the type of change (added, removed, changed, retyped), the original value (from), and the new value (to). Also includes a summary, truncation flag, and metadata fields like source and asOf.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "a",
      "b"
     ],
     "properties": {
      "a": {
       "type": "string",
       "description": "Original JSON (up to 2000 chars)"
      },
      "b": {
       "type": "string",
       "description": "New JSON"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "total": {
       "type": [
        "null",
        "number"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "truncated": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "notChecked": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "differences": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "object",
        "properties": {
         "to": {
          "type": [
           "boolean",
           "null",
           "number"
          ]
         },
         "from": {
          "type": [
           "null",
           "number",
           "string"
          ]
         },
         "path": {
          "type": [
           "null",
           "string"
          ]
         },
         "change": {
          "type": [
           "null",
           "string"
          ]
         }
   
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-structural-diff-5d882860/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from json-data-tools.x402tookit.com](https://www.zero.xyz/host/json-data-tools.x402tookit.com/llms.txt)
