Jsonpath Query
/install jsonpath-query
JSONPath Query Tool
Query JSON data using JSONPath expressions with recursive descent, wildcards, filters, and slicing.
Query
# From file
python3 scripts/jsonpath.py query '$.store.book[0].title' -f data.json
# From stdin
cat data.json | python3 scripts/jsonpath.py query '$.store.book[*].author'
# Recursive descent (find all 'name' fields at any depth)
cat data.json | python3 scripts/jsonpath.py query '$..name'
# Array slicing
cat data.json | python3 scripts/jsonpath.py query '$.items[0:5]'
# Filter (price \x3C 10)
cat data.json | python3 scripts/jsonpath.py query '$.store.book[?(@.price \x3C 10)]'
# Wildcard
cat data.json | python3 scripts/jsonpath.py query '$.store.*'
# Count matches
cat data.json | python3 scripts/jsonpath.py query '$.users[*]' --count
# First match only
cat data.json | python3 scripts/jsonpath.py query '$.items[*].id' --first
# Exit 1 if no matches (CI-friendly)
cat data.json | python3 scripts/jsonpath.py query '$.missing' --exit-empty
List Paths
# Show all available paths in JSON data
cat data.json | python3 scripts/jsonpath.py paths
# Limit depth
cat data.json | python3 scripts/jsonpath.py paths --depth 3
Extract Multiple Values
# Named extractions
cat data.json | python3 scripts/jsonpath.py extract 'name=$.user.name' 'emails=$.user.emails[*]'
Validate Expression
python3 scripts/jsonpath.py validate '$.store.book[?(@.price > 10)]'
Output Formats
python3 scripts/jsonpath.py query '$.items[*]' -f data.json --format json # default
python3 scripts/jsonpath.py query '$.items[*].id' -f data.json --format lines # one per line
python3 scripts/jsonpath.py query '$.items[*]' -f data.json --format csv # CSV for objects
JSONPath Syntax
| Expression | Description |
|---|---|
$ |
Root object |
.key |
Child key |
[0] |
Array index |
[0:5] |
Array slice (start:end) |
[0:10:2] |
Array slice with step |
[*] |
All elements |
..key |
Recursive descent |
[?(@.price\x3C10)] |
Filter expression |
['key'] |
Bracket notation |
[0,1,2] |
Union (multiple indices) |
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install jsonpath-query - After installation, invoke the skill by name or use
/jsonpath-query - Provide required inputs per the skill's parameter spec and get structured output
What is Jsonpath Query?
Query JSON data using JSONPath expressions. Use when asked to extract, filter, search, or navigate JSON data. Supports recursive descent, wildcards, array sl... It is an AI Agent Skill for Claude Code / OpenClaw, with 86 downloads so far.
How do I install Jsonpath Query?
Run "/install jsonpath-query" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Jsonpath Query free?
Yes, Jsonpath Query is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Jsonpath Query support?
Jsonpath Query is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Jsonpath Query?
It is built and maintained by charlie-morrison (@charlie-morrison); the current version is v1.0.0.