JSONPath
JSONPath is a query language for selecting nodes from JSON documents. It was first proposed by Stefan Gössner in 2007.
Open the JSONPath Window
Right-click an object or array node in the Navigator and select Query with JSONPath, or select a node and choose Transformations → Query with JSONPath from the main menu. The selected node becomes the root of the query; the path label at the top of the window shows which node you’re querying.
Run a Query
Type a query in the query field and the result updates as you type:
$.orders[*].items[*].skuResult Type
The Result Type menu controls what the query returns for each match:
- Value: the value of the matched node.
- Path: the JSONPath of the matched node.
- Pointer: the JSON Pointer of the matched node.
- Parent: the parent of the matched node.
- Parent Property: the property name in the parent that holds the matched node.
- All: an object combining the value, path, pointer, and parent for each match.
Result Format
Two checkboxes control the shape of the output:
- Flatten results: flatten the returned array of results into a one-dimensional array.
- Wrap results in array: wrap the results in an array even when there is a single match.
Use the Result
When the result is valid JSON, you can open it in a new viewer. You can always copy the result, or hand it to a script with the Search Scripts button.
Saved Queries
Click Save… to keep the current query for later use. Saved queries appear in the menu next to the Save button, sorted by most recently used.
You can manage saved queries — rename, edit, or delete them — in Settings → jq & JSONPath.
Reference
OK JSON’s JSONPath support is based on JSONPath Plus . Please refer to JSONPath Plus’s documentation for the full syntax, including its extensions to the original proposal.