How to use the JSON Path Tester
- 1. Paste JSONAn API response or any JSON document.
- 2. Write a pathStart with $, then go down with .key, [0], [*] or a filter.
- 3. See the matchesEvery match is listed with its full path and value.
JSONPath syntax supported
$: the root..nameor['name']: a child key.[0],[-1]: an array item, counting from the end with negatives.[*]or.*: every child...name:nameat any depth (deep scan).[0:2]: a slice (items 0 and 1);[0,2]: a union.[?(@.price < 500)]: a filter with ==, !=, <, <=, > or >=, or[?(@.isbn)]to check that a key exists.
JSONPath is used in API testing tools such as Postman and REST Assured, in Kubernetes kubectl output, and in many no-code integrations.
Worked example
The sample store has three books priced 399, 549 and 299. The path $.store.books[?(@.price < 500)].title returns 2 matches: "Python Basics" and "Data Stories", with paths $['store']['books'][0]['title'] and $['store']['books'][2]['title'].
More to try on the sample:
$..namefinds Meera, the author nested inside the third book.$.store.books[-1].pricegives 299, the last book's price.$.store.books[*].tagsreturns only one array, because only the first book has tags.
For safety, filter expressions are read by a small parser instead of being run as code, so only simple comparisons are allowed. Complex expressions with functions or && are not supported in this tester. Write the path step by step, checking the matches after each part, to find mistakes quickly.
Frequently asked questions
Is JSONPath the same as jq?
No. jq is a separate, more powerful command-line language. JSONPath is simpler and is built into many testing tools.
Why does my filter fail?
Filters here take one comparison, like ?(@.age >= 18). Combine conditions by running two paths, or filter the result in code.
Can I get the full objects instead of one field?
Yes. Leave out the last .field, for example $.store.books[?(@.price < 500)].
Is the json path tester free?
Yes, it is free. Running your first path asks for your name and WhatsApp number once, and after that the json path tester and every other Uncodemy tool open without the form.