South Star

JSON Deep Diff Toolkit API

Free tier included · Tools
Deep recursive diff, RFC 6902 patch, flatten, unflatten, format, stats, and text diff on JSON.

JSON Deep Diff API is a stateless micro-API for comparing and transforming JSON documents. POST two objects or arrays to /diff and get back added/removed/changed entries, each with an exact RFC 6901 JSON Pointer and a readable dot path; arrays are compared by index, type changes are reported, and 1 equals 1.0. Ask for format=jsonpatch to receive a minimal RFC 6902 patch, then apply it (or your own) back onto the original with /patch. Beyond diffing, the API bundles a small JSON toolkit: /flatten and /unflatten convert between nested and dot-notation objects, /format pretty-prints with optional key sorting and null removal, /stats returns depth/key/type metrics, /text-diff compares two strings line by line, and /path does get/set/delete by dot path.

This covers diff, patch, flatten, format, stats, with no external calls and no stored data. Honest limits: documents are capped at 64 levels of nesting and 10,000 diff entries; /diff and /patch accept objects or arrays, /flatten and /unflatten expect flat or nested objects respectively, and /path operates on a single object. All processing is in-memory and request-scoped — there are no databases, no logs, and no cross-request state.

Endpoints

MethodPathWhat it does
GET/API metadata: name, version, and links to docs and health.
GET/healthLiveness probe; returns status "ok" while the process is up.
POST/diffDeep recursive diff between two JSON documents. Body: {"a": {...}, "b": {...}, "format": "entries|jsonpatch"}. Returns added/removed/changed entries with RFC 6901 pointers and dot paths, or an RFC 6902 patch.
POST/patchApply a diff (entries format) or an RFC 6902 JSON Patch onto an original document. Body: {"original": {...}, "diff": {...}}.
POST/flattenConvert a nested JSON object into a single-level object with dot-notation keys. Body: {"data": {...}, "separator": "."}.
POST/unflattenReconstruct a nested JSON object from a flat object with dot-notation keys. Body: {"data": {...}, "separator": "."}.
POST/formatPretty-print a JSON document, optionally sorting keys and removing null values. Body: {"data": {...}, "sort_keys": true, "remove_nulls": false}.
POST/statsCompute deep metrics on a JSON document: max depth, total keys, and type breakdown. Body: raw JSON object.
POST/text-diffCompare two text strings line by line; returns unified diff, HTML representation, and stats. Body: {"text_a": "...", "text_b": "..."}.
POST/pathGet, set, or delete a value inside a JSON object using a dot-notation path. Query param op = get|set|delete. Body: {"data": {...}, "path": "a.b.0", "value": {...}}.

Quick start

curl -X POST "https://jsondiff.p.rapidapi.com/diff" \
  -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
  -H "X-RapidAPI-Host: jsondiff.p.rapidapi.com" \
  -H "Content-Type: application/json" \
  -d '{"a":{"name":"alice","age":30},"b":{"name":"bob","age":30}}'

FAQ

What's the difference between /diff and /text-diff?

/diff compares two JSON documents recursively and returns structured entries with JSON Pointers and dot paths. /text-diff compares two plain text strings line by line and returns a unified diff plus HTML.

Can I apply a JSON Patch (RFC 6902) with /patch?

Yes. /patch accepts either our diff format (added/removed/changed with pointers) or a standard RFC 6902 patch array. Both are applied to the `original` document.

Are documents stored or logged?

No. All processing is in-memory and request-scoped. There are no databases, no logs, and no cross-request state.

What are the size and depth limits?

Documents are capped at 64 levels of nesting and 10,000 diff entries. /flatten and /unflatten expect objects; /path operates on a single object with a dot-notation path.

Try JSON Deep Diff Toolkit free

Free tier on every plan. Get an API key and start calling in under a minute.

Open on RapidAPI

Related APIs