Short answer
Use Blobster’s Query pane for path-style JSONPath, meaning child keys, indexes, wildcards and recursive descent, on data you should not paste into an online evaluator. For filter expressions, slices and unions, use a full JSONPath library or jq.
Key points
- Supported syntax covers
$,.key,['key'],[0],.*,[*],..keyand..*. - Filters such as
[?(@.price < 10)], slices, negative indexes and unions are not supported. Blobster shows an error instead of guessing. - Results update as you type, up to 10,000 matches, and the first 200 are listed with their paths.
- Copy query results puts the matched values on the clipboard as a JSON array.
Steps
- Open the document in Blobster.
- Open Query in the side pane, or run Query with JSONPath from the command palette.
- Type an expression, or start from one of the examples Blobster offers.
- Click a result to select that value in the tree.
- Use Copy query results to copy every matched value.
Expressions that work
The query runs on the parsed document, so it works on YAML, TOML, CSV rows and NDJSON records as well as JSON.
| What you want | Expression |
|---|---|
| Every email address, at any depth | $..email |
| The id of every order | $.orders[*].id |
| Every SKU in the first order | $.orders[0].items[*].sku |
| A key that contains a dot | $['feature.flag'] |
| Every value in the document | $..* |
What it does not do
Blobster supports the name, index and wildcard selectors and the descendant segment (..) from RFC 9535. It does not support filter selectors such as $.orders[?(@.total > 100)], slices such as [0:2], negative indexes or several selectors in one bracket such as [0,1]. Each of those returns an error that names the unsupported selector.
When you need a filter, jq handles it locally with select, for example jq '.orders[] | select(.total > 100)' orders.json. In application code, use the JSONPath implementation your tests or API client already depend on, so the expression behaves the same way there.
From a value back to its path
Querying goes from a path to values. To go the other way, select a value in the tree and copy its path as JSONPath, jq or JavaScript.