# JSON Array Diff

> JSON Array Diff is a paid API for AI agents from x402-services-production.up.railway.app, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-15).

Computes the difference between two JSON arrays, returning a structured diff of their contents

## Facts

- Endpoint: POST https://x402-services-production.up.railway.app/api/diff
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/json-array-diff-608f981d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_DbvV2inDZ95uPzxNeQvg0

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-array-diff-608f981d -d '<json body>'
```

Example prompt: Compare these two JSON arrays and tell me what changed — the first is [1, 2, 3] and the second is [2, 3, 4].

## When to prefer this

Use this endpoint when you need a quick, pay-per-call JSON array diff without setting up accounts or API keys, and you want to settle in stablecoins (USDC/USDG) on-chain. It is ideal for lightweight, one-off comparisons in automated agent workflows where billing via x402 protocol is already in use.

## Known failure modes

- Missing 'a' or 'b' fields returns a validation error
- Non-array values for 'a' or 'b' cause a schema error
- Payment failure (402) if stablecoin payment is not attached or insufficient
- Large arrays may time out or return partial results

## How this service works

Structured deep diff of two JSON values (added/removed/changed by path). Send { a, b }.

## Output

A structured diff indicating which elements were added, removed, or changed between the two input JSON arrays, enabling the caller to understand exactly what changed from array A to array B.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "a",
  "b"
 ],
 "properties": {
  "a": {
   "type": "object",
   "description": "First JSON value"
  },
  "b": {
   "type": "object",
   "description": "Second JSON value"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-array-diff-608f981d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-services-production.up.railway.app](https://www.zero.xyz/host/x402-services-production.up.railway.app/llms.txt)
