JSON Diff / Compare
Compare two JSON objects and return a structured diff
Parameters
| name | in | type | required | description |
|---|---|---|---|---|
original |
body | json | required | Original JSON |
modified |
body | json | required | Modified JSON |
ignore_order |
body | boolean | optional | Ignore element ordering when comparing arrays |
Request
Send your key in the X-API-Key header. More languages and patterns live on the
code examples page.
curl -s -X POST "https://apixies.io/api/v1/json-diff" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"original":{"user":{"name":"Alice","age":30,"email":"alice@example.com"}},"modified":{"user":{"name":"Alicia","email":"alice@example.com","phone":"+1-555-0123"}}}'
Response
The result sits under data in the standard envelope. See the
response format guide for errors and status codes.
returns
- data.changes
- Each change with its JSONPath, type, and old and new values.
- data.summary
- Counts of added, removed and changed fields.
- data.is_identical
- True when both documents match.
- data.total_changes
- Total number of changes.
{
"status": "success",
"http_code": 200,
"code": "SUCCESS",
"message": "JSON diff completed",
"data": {
"is_identical": false,
"total_changes": 3,
"summary": {
"added": 1,
"removed": 1,
"changed": 1
},
"changes": [
{
"path": "$.user.age",
"type": "removed",
"old_value": 30
},
{
"path": "$.user.name",
"type": "changed",
"old_value": "Alice",
"new_value": "Alicia"
},
{
"path": "$.user.phone",
"type": "added",
"new_value": "+1-555-0123"
}
]
}
}
Authentication and limits
This endpoint needs an API key. Use the sandbox ("try it" above) to test it without registering. See the authentication guide for details.
Standard rate limits apply to this endpoint.
related endpoints
More documentation
Get a free API key
A temporary key takes one click and no signup. Register and you get 75 requests/day. Free tier is for development & small projects.