Snapshot API responses and diff them against previous saves. Catch breaking changes in status codes, headers, and response bodies before they hit production.
Zero external dependencies. Uses only Node.js builtins.
npm install -g @lxgicstudios/reqsnapOr run directly:
npx @lxgicstudios/reqsnap save https://api.example.com/usersreqsnap save https://api.example.com/usersThis captures the status code, headers, and body. Snapshots are stored in .reqsnap/.
reqsnap check https://api.example.com/usersCompares the live response to your saved snapshot. Shows added, removed, and changed fields. Flags breaking changes.
reqsnap check https://api.example.com/users --ignore-fields timestamp,updatedAt,requestIdreqsnap listreqsnap show https://api.example.com/usersreqsnap delete https://api.example.com/usersreqsnap save https://api.example.com/search --method POST --body '{"q":"test"}'- Save complete API response snapshots (status, headers, body)
- Deep diff with breaking change detection
- Ignore volatile fields like timestamps and request IDs
- Support for any HTTP method (GET, POST, PUT, DELETE, etc.)
- Custom headers and request bodies
- Colorful terminal output with clear diff display
- JSON output mode for CI/CD integration
- Multiple snapshot management (list, show, delete)
- Non-zero exit code on breaking changes
- Works with JSON and non-JSON responses
| Option | Alias | Description | Default |
|---|---|---|---|
--help |
-h |
Show help message | |
--json |
Output results as JSON | false |
|
--method <method> |
-m |
HTTP method | GET |
--header <key:value> |
-H |
Add request header (repeatable) | |
--body <data> |
-d |
Request body | |
--ignore-fields <f1,f2> |
Ignore fields in body diff | ||
--ignore-headers |
Skip header comparison | false |
|
--timeout <ms> |
-t |
Request timeout | 10000 |
--dir <path> |
Snapshot directory | .reqsnap |
| Command | Description |
|---|---|
save <url> |
Save a snapshot of the API response |
check <url> |
Compare live response against saved snapshot |
list |
List all saved snapshots |
show <url> |
Display a saved snapshot |
delete <url> |
Remove a saved snapshot |
| Code | Meaning |
|---|---|
0 |
No breaking changes detected |
1 |
Breaking changes found or error occurred |
Built by LXGIC Studios