Last Updated: April 19, 2019
· felipeelias

Pretty print JSON responses with curl/ruby

Ruby only

curl -s "" | ruby -rjson -e 'print JSON.pretty_generate(JSON.parse('

With awesome_print gem

curl -s "" | ruby -rawesome_print -rjson -e 'ap JSON.parse('

3 Responses
Add your response


Thanks for this! Here's what I've got in my env:

function jcurl { curl $* | ruby -rawesome_print -rjson -e 'ap JSON.parse(' }
export -f jcurl

Now just
jcurl -s ""

over 1 year ago ·

For color and more options, try piping to jq

curl -s "" | jq

And then...

curl -s "" | jq .user_search_url
over 1 year ago ·

Mozilla Firefox if you are know the information and you have change our web browser and you are feel the working information are there and you have connect the more useful website and you have enjoy the new working web browser.

4 days ago ·