ucbcdq
Last Updated: June 15, 2017
·
5.118K
· riyadhalnur

Prettify CURL JSON on OSX

When making CURL requests, add the following line to prettify the JSON response:

curl http://star-api.herokuapp.com/api/v1/stars/Sun | python -m json.tool

3 Responses
Add your response

18761

nice! I added on some colors via grc for some additional pretty points lol =)

$ curl http://star-api.herokuapp.com/api/v1/stars/Sun | python -m json.tool | grcat ~/.grc/conf.curl  
over 1 year ago ·
21089
over 1 year ago ·
21090

Using the awesome jq (http://stedolan.github.io/jq/), you could pipe the results to jq . and get really nice output, plus the option to filter/massage the output from json also.

over 1 year ago ·