What does the JSONPath Playground do?
JSONPath is a query language for JSON. An expression such as $.store.books[?(@.price > 40)].title selects values from a document, much like XPath does for XML. This tester evaluates your expression live and highlights every match.
How to use the JSONPath Playground
- Paste your JSON into the left pane.
- Type a JSONPath in the expression box, starting with $ for the root.
- Read the Matches tab for values and their paths, or switch to Highlighted to see them in the document.
- Use the Syntax panel to insert operators such as [*], .. and [?()] with one click.
When it helps
- Building a query before putting it in code
- Checking a path used in a test or a config file
- Extracting a few fields from a large response
Frequently asked questions
What is JSONPath?
JSONPath is a query syntax for selecting parts of a JSON document. $ is the root, . selects a child, [*] selects all items and [?(...)] filters items.
How do I filter an array with JSONPath?
Use a filter expression, for example $.items[?(@.price > 10)]. Inside the filter, @ means the current item. You can combine conditions with && and ||.
What does $.. mean?
Two dots mean recursive descent: search at any depth. $..price returns every price key anywhere in the document.
Which JSONPath features are supported?
Child and bracket access, indexes including negatives, wildcards, unions, slices, recursive descent, filters with comparisons, && || and !, regex matching with =~, and length().