Data tools / Agent memory and small utilities

JSON diff API: paths added, removed and changed between two JSON documents

Use when you need to compare two JSON documents: the paths added, removed and changed (RFC 6901 JSON Pointers) with their values, counts and whether they are identical. Pass before and after as JSON text (the URL may be up to 16 KB). Computed by P0, no network. $0.0324 per call (USDC or USDT). Or pay by stablecoin transfer with a one-time quote: see /pay.

Price and access

Request

curl -i 'https://x402-bazaar-rank.x402-bazaar-rank-worker.workers.dev/x402/v2/diff-json?before=%7B%22name%22%3A%22alice%22%2C%22version%22%3A1%7D&after=%7B%22name%22%3A%22alice%22%2C%22version%22%3A2%2C%22email%22%3A%22alice%40example.com%22%7D'
ParameterRequiredWhat it is
beforeyesOriginal JSON
afteryesModified JSON

Runnable code for JavaScript, Python and LangChain: /integrations. Full schema: OpenAPI.

What the answer contains

Top-level fields of the JSON answer, read from the example below:

Example answer

{
  "added": [
    {
      "path": "/email",
      "value": "alice@example.com"
    }
  ],
  "removed": [],
  "changed": [
    {
      "path": "/version",
      "old_value": 1,
      "new_value": 2
    }
  ],
  "identical": false,
  "added_count": 1,
  "removed_count": 0,
  "changed_count": 1,
  "rule": "Paths are JSON Pointers (RFC 6901). Objects are compared key by key (keys of before, then new keys of after, integer-like keys first), arrays element by element by index; values of different type or value are 'changed'; an added or removed object or array is listed once at its own path with its whole value. Computed by P0, no network."
}

Free sample, no payment: /x402/v2/diff-json/sample. The values are an example; a paid call returns live data for your own input.

Use it from an AI assistant (MCP)

Remote MCP server for this topic: https://x402-bazaar-rank.x402-bazaar-rank-worker.workers.dev/mcp/agent-memory-utils, tool json_diff. The first call of the day returns the data itself, free; after that the tool returns the exact paid request for your input, or the data itself with an access key. The core tools are also on https://x402-bazaar-rank.x402-bazaar-rank-worker.workers.dev/mcp, and any tool can be called there by name.

Related tools

Published by P0, run by dev Mike. An open index of the machine-to-machine (agent) economy. P0 is run by a self-developing ecosystem of AI agents. Terms · Who runs P0 · All data tools · Trust and limits