# utilsforagents.com JSON Diff

> utilsforagents.com JSON Diff is a paid API for AI agents from utilsforagents.com, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-10).

Compare two JSON objects or arrays and return a structured list of differences as RFC 6902-style patch operations with JSON Pointer paths.

## Facts

- Endpoint: POST https://utilsforagents.com/v1/diff?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/utilsforagents-com-b8a7d052
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_P4fYe6-fBLAwF2xjeRnvY

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 utilsforagents-com-b8a7d052 -d '<json body>'
```

Example prompt: Compare these two JSON objects and show me exactly what changed — the original is {"age":30,"city":"New York","name":"Alice"} and the updated version is {"age":31,"city":"Boston","name":"Alice"}, including any unchanged fields.

## When to prefer this

Use this endpoint when you need a structured, machine-readable diff of two JSON documents — especially when you need RFC 6902 patch operations with JSON Pointer paths for audit logging, change detection, config comparison, or reconstructing state transitions. Prefer this over text-based diff tools when working with structured data where field-level granularity and JSON Pointer paths matter.

## Known failure modes

- Invalid JSON in left or right fields returns a 400-level error
- maxDepth value outside 1–256 range causes a validation error
- Extremely large or deeply nested JSON may hit depth limits if maxDepth is too low
- Non-object/non-array top-level JSON values may produce unexpected results
- Missing left or right field in request body returns an error

## How this service works

Pay-per-call AI agent utilities plus a free feedback endpoint: JSON diff, EXIF extraction, metadata scrubbing, HTML-to-Markdown, URL fetching, and feature-request collection. $0.003/call for paid utility routes via x402 on Base or Solana.

## Output

Returns an 'ok' boolean, a 'diff' array of RFC 6902-style patch operations (each with 'op' as add/remove/replace, 'path' as a JSON Pointer string, and 'oldValue'/'newValue' where applicable), plus a 'stats' object with counts of added, removed, changed, and unchanged fields and processing time in milliseconds.

## Example request

```json
{
 "left": {
  "tags": [
   "test",
   "demo"
  ],
  "count": 5,
  "status": "active"
 },
 "right": {
  "tags": [
   "test",
   "demo",
   "updated"
  ],
  "count": 5,
  "status": "inactive"
 },
 "options": {
  "maxDepth": 32,
  "includeUnchanged": true
 }
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "left": {
   "type": "object",
   "description": "Original JSON value"
  },
  "right": {
   "type": "object",
   "description": "Modified JSON value"
  },
  "options": {
   "type": "object",
   "properties": {
    "maxDepth": {
     "type": "number",
     "description": "Maximum object depth to traverse (1-256)"
    },
    "includeUnchanged": {
     "type": "boolean",
     "description": "Include unchanged paths in output"
    }
   },
   "description": "Optional diff settings"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "diff": [
   {
    "op": "replace",
    "path": "/name",
    "newValue": "Bob",
    "oldValue": "Alice"
   }
  ],
  "stats": {
   "added": 0,
   "changed": 1,
   "removed": 0,
   "unchanged": 0,
   "processingTimeMs": 0.042
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/utilsforagents-com-b8a7d052/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from utilsforagents.com](https://www.zero.xyz/host/utilsforagents.com/llms.txt)
