JSON diff
Try it interactively →POST /api/json-diffDiff two JSON documents and return the set of differences as JSON Patch operations (RFC 6902) or a structured changes array.
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| before* | string | — | The original JSON document, as a string. |
| after* | string | — | The new JSON document, as a string. |
| includeFromValue | boolean | false | Annotate each replace op with what it replaced (non-standard). |
Response
Modes: json. Cache: yes (24h TTL).
Code samples
Built from the trivial-rename example.
curl -X POST https://api.xtract.bot/api/json-diff \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
-H "X-Api-Key: $XTRACT_API_KEY" \
-d '{
"before": "{\"name\":\"alice\",\"age\":30}",
"after": "{\"name\":\"alice\",\"age\":31}",
"includeFromValue": false
}'