# JSON Diff Comparison

> JSON Diff Comparison is a paid API for AI agents from api.strale.io, paid per call via x402, $0.0324/call, status unknown (last checked 2026-09-14).

Compare two JSON objects and return a structured diff showing added, removed, and changed fields with their paths and values

## Facts

- Endpoint: GET https://api.strale.io/x402/diff-json
- Price: $0.0324/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-strale-io-35fad5d6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_-O12ziKV28JUTmNaMFOX7

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 api-strale-io-35fad5d6
```

Example prompt: Compare these two JSON objects and show me exactly what changed — the before is {"name":"Alice","age":30,"role":"user"} and the after is {"name":"Alice","age":31,"role":"admin","email":"alice@example.com"}.

## When to prefer this

Use this endpoint when you need a programmatic, algorithmic diff between two JSON objects — ideal for detecting configuration drift, tracking API response changes, auditing data mutations, or building change-detection pipelines. Prefer this over text-based diff tools when you need structured, path-aware output that distinguishes added, removed, and changed fields.

## Known failure modes

- Missing 'before' or 'after' query parameter returns an error
- Non-JSON or malformed JSON inputs cause parse errors
- Very large or deeply nested JSON objects may hit size limits
- Invalid query parameter encoding for complex nested JSON

## How this service works

Compare two JSON objects and return structured diff. Shows added, removed, and changed fields with paths and values. Algorithmic.

## Output

A structured diff object listing all added fields (with their new values and paths), removed fields (with their old values and paths), and changed fields (with before and after values and paths) between the two input JSON objects.

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "after": {
    "age": 26,
    "name": "John",
    "email": "john@example.com",
    "status": "active"
   },
   "before": {
    "age": 25,
    "name": "John",
    "status": "active"
   }
  }
 }
}
```

## 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",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "before",
      "after"
     ],
     "properties": {
      "after": {
       "description": "Modified JSON"
      },
      "before": {
       "description": "Original JSON"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-strale-io-35fad5d6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.strale.io](https://www.zero.xyz/host/api.strale.io/llms.txt)
