I did not know about jq, thanks!
Without jq, you can still pipe to python json.tool module:
$ curl http://domain.com | python -m json.tool
Without jq, you can still pipe to python json.tool module:
$ curl http://domain.com | python -m json.tool
One liner-wise, you could create an alias
echo '{"foo":12, "bar": 11}' | python -c 'import json as j, collections as c, sys as s; j.dump(j.load(s.stdin, object_pairs_hook=c.OrderedDict), s.stdout, indent=4)'
[0] https://github.com/python/cpython/blob/3.5/Lib/json/tool.py#...