JSON Path
Query and extract data from JSON using JSONPath expressions
JSON Input
850 B
JSONPath Guide — Query JSON Data
This guide explains how to use JSONPath on jsonmaster.com. We use the robust jsonpath-plus library, which extends the original JSONPath specification with additional features.
Basic Syntax
| Symbol | Description |
|---|---|
$ | The root object/element |
@ | The current element being processed by a filter predicate |
. or [] | Child operator |
.. | Recursive descent (deep scan) |
* | Wildcard. All objects/elements regardless of their names |
[] | Subscript operator (for array indices or names) |
[,] | Union operator in subscript (e.g. [0,1]) |
[start:end:step] | Array slice operator |
?() | Applies a filter (script) expression |
Examples
Based on the sample store data available in the editor:
All authors
$.store.book[*].authorReturns a list of all authors in the store.
Books cheaper than 10
$.store.book[?(@.price < 10)]Filters books where the price is less than 10.
Recursive search for prices
$..priceFinds the price of everything in the store (books and bicycle).
Books with ISBN
$..book[?(@.isbn)]Filter all books that have an 'isbn' property.