jq is the standard tool for slicing JSON in the shell.

Basics

echo '{"a":1,"b":{"c":2}}' | jq .
jq '.b.c' file.json
jq -r '.name' file.json   # raw string (no quotes)

Arrays

jq '.items[0]' file.json
jq '.items[] | .id' file.json
jq '[.items[].id]' file.json

Objects & filtering

jq '.users[] | select(.active == true)' file.json
jq 'map(.price * 1.1)' file.json

Combine with curl

curl -sS https://api.example.com/v1/data | jq '.results[0:5]'

Errors & optional fields

jq '.maybe // "default"' file.json
jq 'try (.deep.path) catch "n/a"' file.json

Install: apt install jq, brew install jq, or download from jqlang.org.