By Vivek - October 6, 2026
Compare API JSON Responses While Ignoring Timestamps
Two API responses can differ on every request even when the underlying records stay the same. Generated timestamps and request metadata make a diff harder to review. Exclude those specific fields while keeping business values visible.
This example uses the JSON Diff Tool. It ignores a response timestamp and each user’s update timestamp, while still finding a changed account status.
Start with a response that contains a genuine change
Original JSON:
{
"generatedAt": "2026-10-01T09:00:00Z",
"users": [
{ "id": 1, "active": false, "updatedAt": "2026-10-01T08:00:00Z" },
{ "id": 2, "active": true, "updatedAt": "2026-10-01T08:00:00Z" }
]
} Changed JSON:
{
"generatedAt": "2026-10-02T09:00:00Z",
"users": [
{ "id": 2, "active": true, "updatedAt": "2026-10-02T08:00:00Z" },
{ "id": 1, "active": true, "updatedAt": "2026-10-02T08:00:00Z" }
]
} Choose Record ID mode and use id as the field. Enter these two lines into Ignored paths:
/generatedAt
/users/*/updatedAt Click Compare JSON. Expect 1 changed, 0 added, 0 removed and 3 ignored matching fields. User 1 changed from inactive to active. Its original location is $.users[0].active; its changed location is $.users[1].active.
Remove the ignored paths and compare again. The response timestamp and two update timestamps also appear as changes. That is a useful check that your exclusions target the intended fields.
How the ignored paths work
Paths start at the document root. A slash introduces one property name or array index. A * segment matches exactly one segment, so /users/*/updatedAt applies to each direct user’s timestamp. It does not recursively remove every property named updatedAt.
| Field to ignore | Ignored path |
|---|---|
A top-level requestId | /requestId |
Each root-array record’s timestamp | /*/timestamp |
A literal property named build/time | /build~1time |
A literal property named ~metadata | /~0metadata |
The ~1 and ~0 escapes follow JSON Pointer syntax in RFC 6901. The * wildcard is this tool’s extension; it is not part of standard JSON Pointer. These rules are separate from the JSONPaths shown in the result.
A matching path on either document excludes that comparison. Ignoring an entire object excludes its descendants too. When an entire record or parent object is added or removed, the report includes that whole value, including any nested timestamps. The parent addition or removal is still a meaningful difference.
Avoid hiding the change you need to see
Only exclude fields whose changes are irrelevant to your review. An updatedAt change may be essential when testing cache freshness or audit records. Ignoring /users/* would hide every user change, including account status.
An empty result means no differences under your selected rules. It does not mean the source documents are byte-for-byte identical. The downloaded report includes the rules and ignored-field count so another reviewer can understand that distinction. A report marked partial needs a smaller comparison before you conclude there are no other changes.
For the array-order problem in isolation, see Compare JSON arrays by ID. Use the JSON Formatter to validate syntax and the JSONPath Tester to inspect a specific part of a response.
If you need to isolate a nested collection first, follow Filter a nested API response with JSONPath. For a reusable description of the response shape, see Generate JSON Schema from an API response. The JSON tools hub connects the full workflow.
Related Posts
- Compare JSON Arrays by ID Without Reorder Noise
- Find and Fix Common JSON Syntax Errors
- Generate JSON Schema from a Sample API Response
- Filter a Nested API Response with JSONPath
- Min Heap Heapify - A Worked Example With Every Swap
- How to Install Node.js and NPM on Ubuntu
- AWS Lambda Function with Response Streaming using Node.js
- Build a Chrome Extension with Svelte
- Focus a Dynamic Input Field in Svelte
- Svelte 5 Tutorial - A Thorough Introduction to Svelte