Test your API · Lesson 7 of 20
Compare responses and environments
See what changed between two responses, and check staging against production request by request.

"It worked yesterday" is easier to fix when you can see exactly what changed. Swastik Codes compares responses field by field: status, headers and every JSON value. It understands JSON, so a different key order or different spacing does not count as a change.
Compare a response with an earlier one
- Send a request.
- In the response bar, open the ⋯ menu and choose Compare with…
- Pick what to compare with: one of the request's saved examples, or an earlier send of the same request from History.
The comparison lists:
- the status, if it changed;
- JSON fields that were added, removed or changed, as paths like
$.items[0].price: 10 → 12; - headers that changed (Date, ETag, request ids and similar headers that differ every time are left out unless you ask);
- a line-by-line diff of the body.
Some fields always differ, such as ids and timestamps. Type them into Ignore fields, separated by commas: $.id, $.createdAt. To ignore everything inside a list, end the path with .*, as in $.items.*.
You can also start from History: right-click a send and choose Compare with another send…
Compare two environments
Before a release it is worth checking that the new deployment answers like the old one, or that staging matches production.
- Open the collection runner, pick the collection and the requests.
- Switch to the Compare environments tab.
- Choose Environment A (for example Production) and Environment B (Staging), and add any fields to ignore.
- Click Compare.
Every request is sent in both environments and the results come back as a list: Same, Different (with what differs), Failed (no response in one of them) or Missing. Tests that pass in one environment and fail in the other are called out in red. Click a row to see the two responses side by side, and use Report to download the whole comparison as text for a ticket or a release note.
What you learned
- Compare with… shows field-level changes between two responses, ignoring noise you name.
- Compare environments runs the same requests in two places and lists every difference.
Next: find tests that fail only sometimes, and the parts of your API no test covers.