ZapKit

JSONPath tester

Write and check a JSONPath query against real data before putting it into code, an API gateway, a test or a monitoring rule.

What is JSONPath?

JSONPath is a query language for JSON, similar to XPath for XML. A short expression such as $.store.book[*].title picks values out of a document, and it's used in API testing tools, Kubernetes, log processors, database queries and many programming libraries.

This tester runs an expression against JSON you paste and shows every match, either as a JSON array of values, a list of normalised paths, or an object mapping each path to its value. Errors in the JSON or the expression are explained in plain words. Both the data and the query can be edited freely, and results update with every keystroke, which makes it easy to build a complex filter one step at a time.

How to use the JSONPath tester

  1. 1.Paste your JSON

    Or use the bookstore sample.

  2. 2.Type a JSONPath

    Results update as you type.

  3. 3.Choose the output

    Matching values, their paths, or both.

Example: queries on the bookstore sample

A store with four books and a bicycle:

$.store.book[?(@.price < 10)].title
Sayings of the Century, Moby Dick
$..book[-1:].author
J. R. R. Tolkien
$.store.*.price (paths)
$.store.bicycle.price

Each query is confirmed against real data before it goes into code.

Supported syntax

$ is the root. Use .name or ['name'] for keys, [0] or [-1] for array items, [*] or .* for everything at a level, and .. to search at any depth, as in $..author. Slices like [0:2] and [::2] pick ranges; [0,2] and ['a','b'] pick several.

Filters select items by their contents: [?(@.price < 10)], [?(@.isbn)] for items that have a key, and conditions combined with && and ||. Comparisons are ==, !=, <, <=, > and >=, and =~ /pattern/ matches text against a regular expression.

Frequently asked questions

Which JSONPath version is this?

The widely used Goessner syntax, which most libraries and tools follow.

Why do I get no matches?

Key names are case-sensitive. Try $..name to search at every depth.

Can a filter compare two fields?

Yes, like [?(@.sale < @.price)].

Is my JSON uploaded?

No. Queries run locally.

More Developer tools