ucbcdq
Last Updated: June 15, 2017
·
1.286K
· riyadhalnur
10309058 10152457564452360 4465802230248535815 n

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

Say Thanks
Respond

3 Responses
Add your response

18761
9845ebb43e8796695a3013a03b1f447e

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
0bc5158691ed0c18ce2c1b447745346d
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 ·
Filed Under