Test a JSONPath expression
Run a JSONPath expression on JSON: the matching values and their paths, with filters such as [?(@.price < 10)] and a clickable cheat sheet.
Run a JSONPath expression on JSON: the matching values and their paths, with filters such as [?(@.price < 10)] and a clickable cheat sheet.
Click an expression to try it on the bookstore example.
Runs entirely in your browser: nothing you type is sent or stored.
$.store.book[*].author reads “the author of every book of the store”. Proposed by Stefan Goessner in 2007, it was standardized in 2024 as RFC 9535.
$['store']['book'][0]['author'], which points at exactly one value. Click an expression of the cheat sheet to try it on the bookstore example.
| Syntax | Selects |
|---|---|
$ | |
@ | |
.name or ['name'] | |
..name | |
*, [*] | |
[0], [-1:] | |
[0,1], [1:3] | |
[?(@.price < 10)] |
@ being the item tested.
<, <=, >, >=, ==, === and !=, strings in quotes: [?(@.category == 'fiction')].&&, || and !, as in [?(@.price > 10 && @.isbn)].[?(@.isbn)].$.store.book[?@.price < 10], and adds functions such as length() and match(). Expressions without filters give the same result in both, and the normalized paths shown here are those of the RFC.
.store.book[] | select(.price < 10). JSONPath only selects values, but its short syntax fits in a configuration file or a test assertion.
kubectl output (without the $, between braces).jsonPath("$.name") with Spring MockMvc, JMeter’s JSON extractor or SoapUI assertions.kubectl get pods -o jsonpath='{.items[*].metadata.name}'