JSONPath Tester

Test JSONPath expressions.

2 results

About the JSONPath Tester

Evaluate a JSONPath expression against a JSON document and see both the matches and how many there are as you type. Recursive descent ($..author), wildcards, array slices, index unions, and filters such as $..book[?(@.price<10)] all work. Useful for writing an assertion in an API test or pulling one field out of a long response. Errors appear inline, and results come back as a JSON array you can copy.

How to use the JSONPath Tester

  1. Paste your JSON into the JSON panel.
  2. Type an expression in the box at the top, starting with $.
  3. Watch the Results panel and the result count update on every keystroke.
  4. Press Copy to take the matched values as a JSON array.

Frequently asked questions

Why is the result always an array?
A JSONPath expression can match any number of nodes, so results are always wrapped in an array, even when exactly one node matches. No match gives an empty array and a count of 0.
Why do I get 0 results instead of an error?
JSONPath does not fail on a path that simply matches nothing. Check property spelling and case, array indices, and whether your filter compares a number against a string. An error message only appears when the JSON itself will not parse.
What syntax is supported?
$ for the root, dot and bracket child access, .. for recursive descent, * wildcards, [1:3] slices, [0,2] unions, [?(@.price<10)] filters, ~ to return property names instead of values, and .length on an array.
Is JSONPath the same as jq or JMESPath?
No. They are separate query languages with different syntax and different capabilities. An expression written for jq will not run here, and vice versa.
Is my JSON uploaded?
No. The query runs in your browser, which is what makes it safe to paste a real API response containing customer data.

Related tools