JSONPath online: test an expression on your JSON
Checkcraft is a desktop app for checking APIs and logs without code, with a free edition. Download, no sign-up →
An expression for Zabbix, a test or an export does not work and it is unclear why. Run it here and see exactly what it matches.
What is supported
The root $, fields with dots and in quotes, array elements by index including negative ones, the wildcard, recursive descent .., slices [start:end:step], unions [0,2] and filters ?(...) with ==, !=, <, <=, >, >=, the &&, || and ! operators and field existence checks. Inside a filter, @ refers to the current element and $ to the root.
$.items[*].sku
$..amount
$.items[-1]
$.items[0:2]
$.items[?(@.amount > 1000)].sku
$.items[?(@.tags && @.amount < 1000)]Why an expression behaves differently elsewhere
JSONPath evolved for years without a standard, and libraries differ in details: functions such as length(), regular expressions in filters and result order. RFC 9535 was published in 2024. This page implements the common core; if your expression relies on functions of a particular library, check its documentation.
A path for checking an API response
Checkcraft rules use the same path without the leading $: items[0].amount, or items[*].amount for all elements. Once you find the right expression here, you can move it into a response check. A script in your browser does the work; the page sends nothing to a server.
Repeat this on your own API
Checkcraft is a desktop app that saves API response checks without code and shows what did not match. Start with a sample, then use your own sanitized data. Free runs on Windows and Linux with no time limit.
Download FreeDownload and first runNo sign-up or email needed, the archive is ready in a couple of minutes. See the edition limits.
References
Start with the linked example and compare its result with your own test requirement.