I have been doing some recent work for a client with a large amount of JSON and webservices. Of course CharlesProxy is always helpful for this. I use it to be able analyze data flows, etc. In this case I wanted to be able to filter through the JSON to get at specific elements. Doing this for a while I thought it’d be neat to filter it the way we use XPath with XML. JSON Editor is a cool AIR app which allows you to view JSON and XML but also translate from one to the other. So I thought I’d just use that to convert the JSON to XML and then use XPath on it. Then I thought… “has anyone done anything like xpath for json?” Turns out they have.
JSONPath is a lightweight component that allows to find and extract relevant portions out of JSON structures on the client as well as on the server.
You can read more about it.
Extensive test examples are available for JSONPath.
A PHP helper class JsonStore allows read, write and delete operations on JSON structures.
This isn’t the only json-xpath implementation of course. This also looks promising.