VOOZH about

URL: https://dev.to/happyonedayforme/how-to-compare-two-rest-api-json-responses-without-postman-373n

⇱ How to Compare Two REST API JSON Responses Without Postman - DEV Community


Comparing REST API JSON responses is one of the most common tasks in backend development, API testing, and release review. You change an endpoint, deploy to staging, capture a new response, and need to know exactly what changed before promoting to production.

Postman is a popular choice, but many teams still need a lightweight browser-based JSON diff — no desktop install, no corporate proxy issues, no account setup.

This guide walks through a practical workflow using JSON API Diff — a free tool that compares two JSON payloads side by side, highlights structural changes at the field-path level, and runs entirely in your browser so internal API data never leaves your machine.

Step 1: Capture your baseline response

Call the API endpoint in your usual way — curl, Insomnia, browser DevTools Network tab, or an integration test fixture. Copy the full JSON body. Minified JSON is fine; the diff tool parses structure, not formatting.

Step 2: Capture the candidate response

After your code change, schema migration, or dependency upgrade, call the same endpoint with the same inputs. Copy the new JSON body. Identical request parameters are critical — otherwise you diff unrelated changes mixed with real contract drift.

Step 3: Paste and compare

Open the JSON Diff Tool, paste baseline on the left and candidate on the right, then click Compare JSON. Within a second you should see added, removed, and changed paths plus a side-by-side view.

Step 4: Tune comparison options

  • Ignore key order — when serializers reorder object keys but semantics stay the same (common in Java, Go, Python APIs)
  • Ignore array order — only if your contract treats arrays as unordered sets
  • Show differences only — for large payloads with hundreds of stable fields

Step 5: Review breaking changes first

Focus on:

  • Removed keys
  • Type changes (string → number)
  • null where objects were expected
  • Renamed fields that clients still consume

These cause production incidents — not whitespace or key-order noise.

Step 6: Export and share

Copy or export the diff report into your pull request, Jira ticket, or release checklist. A path-level summary beats two full JSON blobs in chat.

Why not plain text diff?

Line-based diff treats JSON as text. Move one nested field and you get dozens of red lines even though the API contract change is a single path. Structured JSON diff reports paths like user.profile.email or items[2].price.

Why browser-local processing matters

Uploading staging responses to unknown SaaS tools can violate security policy in finance, healthcare, and enterprise environments. Client-side diff keeps payloads on your laptop.

Common scenarios

  • Microservice refactor — verify response shape unchanged
  • v1 vs v2 endpoint during deprecation
  • Mock server fixtures vs real backend output
  • Staging vs production before release

Quick checklist before production

  1. Same endpoint and inputs
  2. Ignore key order if applicable
  3. Review removed and type-changed paths
  4. Attach diff summary to the change ticket
  5. Re-run after hotfix if the first comparison was inconclusive

Try it: jsonapidiff.com/tool

Open source: github.com/happyonedayforme/json-api-diff-tool

More guides: jsonapidiff.com/blog

What would make this your default tab during API testing? Comments welcome 👇