Pretty printing json in Bash + gzipped response with curl

To decompress response in curl add: --compressed to curl command.

To pretty print JSON response, pipe the result to: python -m json.tool

All in one line:

$ curl --compressed "http://someUrl"  | python -m json.tool
Advertisements