What is JSONPath?
JSONPath is a query language for JSON data, similar to XPath for XML. It lets you navigate and extract data from JSON structures using path expressions. For example, $.users[0].name extracts the name from the first user in a users array.
JSONPath Quick Reference
| Expression | Meaning |
|---|---|
$ | Root element |
$.name | Property "name" of root |
$.users[0] | First item of "users" array |
$.users[*] | All items in "users" array |
$.users[*].name | Name of every user |
$..title | All "title" properties at any depth |
$.book[?(@.price < 10)] | Books where price is less than 10 |
$.book[-1:] | Last book in the array (slice) |
How to Use It
1
Open the tool
Go to JSON & API and scroll to the JSONPath Tester.
2
Paste your JSON
Paste the JSON document you want to query into the top panel.
3
Enter your expression
Type a JSONPath expression starting with $. Results appear instantly.
4
Refine and copy
Adjust your expression until you get the expected values, then copy it for use in code.
Frequently Asked Questions
What does
$ mean?The dollar sign represents the root element of the JSON document. All JSONPath expressions start with
$.How do I get all items in an array?
Use the wildcard:
$.users[*] returns all items. $.users[*].email returns the email of every user.How do I filter by condition?
$.books[?(@.price < 20)] — the ?(...) is a filter, and @ refers to the current element being evaluated.What is recursive descent (
..)?$..title finds all title properties at any depth in the JSON structure — useful for deeply nested documents.Test your JSONPath now
Open the JSONPath Tester and query any JSON structure — free, instant, no login required.
Open JSONPath Tester →