Curl and jq with pipes

Bash Pipe Commands explained

sudo apt-get install curl jq -y && curl -s "" | jq -r '.[].toppings | @csv' | sort | uniq -c | sort -bgr | head -20 | cat

Install cURL and jq if not on the debian Linux variant

sudo apt-get install curl jq -y 

Grab the file contents with cURL

curl -s ""

Use jq to parse the JSON with property you would like and then export to flat file format of csv

jq -r '.[].toppings | @csv' 

Sort the rows


Count the unique lines

uniq -c

Sort the data again with these options because each line now starts with its count in the previous input file like so: 156 "beef"

-b, --ignore-leading-blanks
-g, --general-numeric-sort
-r, --reverse

sort -bgr

Get the first 20 highest count values from sorted data

head -20

Finally output results