Sure, that’s what --json is for. Assuming the hostname is foobar and all snapshots have the same paths, something like this will work on Linux where command substitution and jq are available:
restic diff $(restic snapshots --host foobar | jq -r '.[-2:][].id')
Presumably you can do something similar on Windows using PowerShell – or maybe even in batch files, though it will likely be a bit trickier.