If you're working with JSON on the command line, then I can highly recommend jq for simple data manipulation. It let's you mine into JSON data using an XPath-like query syntax and makes quick work of extracting the stuff you actually care about. The source is on the githubs.