In your familiar with XML files, you’ve probably heard of/used XPath to select nodes from a XML document without implementing a custom parser. There is a similar tool for JSON, called JSONPath. This post shows you where to get the documentation, implementation and tools to get you started.
Subbu Allamaraju forked this implementatio, modernized and improved to an extend unknown to me. Nevertheless I’ve decided to use it in my project as it is actively maintained. It’s available on GitHub. Looking at the test files is a good source of “in-situation” examples.
To test the queries, an online JSONPath evaluator is a convenient tool. I find jsonpath.com to be the best. You can paste your JSON content and your JSONPath expression and it will immediately show you the matching content.
There is an interesting alternative to JSONPath: json:select(), CSS-like selectors for JSON. I never took the time to play with it but it could be worth a shot.