Skip to content
POST AI agent ready /v1/diff/json

JSON Diff API - Free Deep Object Comparison

Send two JSON objects and get a structural diff showing which keys were added, removed, or changed at every nesting level. Values are compared by type and content.

Parameters

objectrequired

The original JSON object.

objectrequired

The modified JSON object.

Code examples

curl -X POST https://api.botoi.com/v1/diff/json \
  -H "Content-Type: application/json" \
  -d '{"original":{"name":"Alice","age":30},"modified":{"name":"Alice","age":31,"role":"admin"}}'

When to use this API

API response regression testing

Compare API responses from staging and production to catch unintended changes in response shape or values.

Config file auditing

Diff the previous and current JSON configuration to produce an audit log entry that shows exactly what changed.

Database record change tracking

Store the JSON diff between old and new record values in an audit table, keeping a compact history of field-level changes.

Frequently asked questions

Does this handle nested objects and arrays?
Yes. The diff recursively traverses nested objects and arrays, reporting changes at every depth with dot-notation paths.
How are array changes reported?
Array elements are compared by index. Insertions or deletions shift subsequent indices, which are each reported as individual changes.
What happens if the JSON is invalid?
The API returns a 400 error with a message indicating which input (original or modified) failed to parse.
Can I compare YAML or XML?
No. This endpoint accepts only JSON. Convert YAML to JSON first using the /v1/yaml/to-json endpoint.

Get your API key

Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.