# JSON Diff Comparator

> JSON Diff Comparator is a paid API for AI agents from x402-zoo.lolagent.workers.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Compares two JSON values and returns structured lists of changed, added, and removed paths between them.

## Facts

- Endpoint: GET https://x402-zoo.lolagent.workers.dev/api/json-diff
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/json-diff-comparator-3ed9cf87
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_GkyQSR9-8hgcvzVqPTj6H

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-diff-comparator-3ed9cf87
```

Example prompt: Can you compare these two JSON objects for me and tell me exactly which fields were added, removed, or changed? Left: {"name":"Alice","age":30,"city":"NY"} and right: {"name":"Alice","age":31,"country":"US"}.

## When to prefer this

Choose this endpoint when you need a fast, structured programmatic diff of two JSON values that returns machine-readable changed/added/removed path lists rather than a human-readable text diff. Ideal for automated pipelines, configuration drift detection, or API response auditing where the output must be parsed downstream.

## Known failure modes

- Malformed JSON in left or right query parameter returns an error
- Missing required query parameters (left or right) results in a bad request response
- Deeply nested or very large JSON objects may exceed processing limits
- URL-encoding issues with special characters in JSON strings can cause parse failures

## How this service works

Compare two JSON values and return structured changed, added and removed paths.

## Output

A structured object containing three categorized lists: paths where values changed (with before/after values), paths that were added in the right-side JSON, and paths that were removed relative to the left-side JSON.

## 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": [
      "left",
      "right"
     ],
     "properties": {
      "left": {
       "type": "string"
      },
      "right": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-diff-comparator-3ed9cf87/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-zoo.lolagent.workers.dev](https://www.zero.xyz/host/x402-zoo.lolagent.workers.dev/llms.txt)
