x402AgentsToolsHub

JSON Diff

Compare two JSON documents structurally — every added, removed and changed value reported with its RFC 6901 JSON Pointer path, not a text blob. Objects and arrays recurse; type changes (string → number) are flagged as changes. Deterministic, unlike eyeballing or text diffs.

Worked examples

Nested object change

GET /api/v1/dev/json-diff?a=%7B%22user%22%3A%20%7B%22name%22%3A%20%22Ada%22%2C%20%22admin%22%3A%20false%7D%7D&b=%7B%22user%22%3A%20%7B%22name%22%3A%20%22Ada%22%2C%20%22admin%22%3A%20true%7D%7D

Result: 1 difference(s): 1 changed, 0 added, 0 removed

Array + added key

GET /api/v1/dev/json-diff?a=%7B%22tags%22%3A%20%5B%22a%22%2C%22b%22%5D%7D&b=%7B%22tags%22%3A%20%5B%22a%22%2C%22c%22%5D%2C%20%22new%22%3A%201%7D

Result: 2 difference(s): 1 changed, 1 added, 0 removed

Identical documents

GET /api/v1/dev/json-diff?a=%7B%22x%22%3A%20%5B1%2C%202%5D%7D&b=%7B%22x%22%3A%20%5B1%2C%202%5D%7D

Result: ✓ Identical — the documents are structurally and value-equal

Machine API (x402)

$0.01 / call

This tool is also a JSON API for AI agents. Requests without payment receive 402 Payment Required plus instructions; agents pay USDC on Base via the x402 protocol — no accounts, no API keys.

GET /api/v1/dev/json-diff?a=%7B%22user%22%3A%20%7B%22name%22%3A%20%22Ada%22%2C%20%22admin%22%3A%20false%7D%7D&b=%7B%22user%22%3A%20%7B%22name%22%3A%20%22Ada%22%2C%20%22admin%22%3A%20true%7D%7D HTTP/1.1
Host: agentstoolshub.com

→ 402 (payment required, instructions in headers)
→ 200 (after X-PAYMENT header; JSON body below)

{
  "tool": "dev/json-diff",
  "input": {"a":"{\"user\": {\"name\": \"Ada\", \"admin\": false}}","b":"{\"user\": {\"name\": \"Ada\", \"admin\": true}}"},
  "result": { "value": 1, "answer": "1 difference(s): 1 changed, 0 added, 0 removed" }
}

Agent docs: /llms.txt · OpenAPI spec · integration guide

About this tool

Real structural JSON comparison: keys and values matched recursively, differences reported as JSON Pointer paths (/user/admin, /tags/1) with before → after values. Catches what text diffs hide — key reordering, whitespace, and type changes — because it compares parsed data, not formatting.

Frequently asked questions

How are arrays compared?

By index: inserting an element in the middle shows as changed/added paths for the shifted tail. For order-insensitive comparison, sort or key your arrays first.

Is a type change a difference?

Yes — 1 and "1" are different values in JSON. The changed row shows both JSON-encoded sides so type drift is obvious.

Related tools