JSONPath Query
Query JSON data using JSONPath expressions and get matching results.
POST
1 credit
/v1/jsonpath
curl -X POST "https://devtools.toolkitapi.io/v1/jsonpath" \
-H "Content-Type: application/json" \
-d '{
"data": {"store": {"books": [{"title": "Dune", "price": 12}, {"title": "1984", "price": 9}]}},
"path": "$.store.books[*].title"
}'
import httpx
resp = httpx.post(
"https://devtools.toolkitapi.io/v1/jsonpath",
json={
"data": {"store": {"books": [{"title": "Dune", "price": 12}, {"title": "1984", "price": 9}]}},
"path": "$.store.books[*].title"
},
)
print(resp.json())
const resp = await fetch("https://devtools.toolkitapi.io/v1/jsonpath", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
"data": {"store": {"books": [{"title": "Dune", "price": 12}, {"title": "1984", "price": 9}]}},
"path": "$.store.books[*].title"
}),
});
const data = await resp.json();
console.log(data);
# See curl example
Response
200 OK
{
"expression": "$.store.books[*].title",
"match_count": 2,
"matches": ["Dune", "1984"],
"paths": ["store.books.[0].title", "store.books.[1].title"]
}
Try It Live
Live Demo
Response
Description
Query JSON data using JSONPath expressions and get matching results.
How to Use
1
1. Send a POST request with `data` (the JSON document) and `path` (the JSONPath expression).
2
2. The response includes all matched values in `matches` and their corresponding paths in `paths`.
3
3. Use `match_count` to quickly check how many results were found.
About This Tool
JSONPath Query evaluates a JSONPath expression against a JSON document and returns all matching values along with their resolved paths. It supports the full JSONPath Extended syntax including wildcards, recursive descent, array slicing, and filter expressions.
Why Use This Tool
- Data extraction — Pull specific fields from large JSON documents
- API response inspection — Query nested API responses without writing code
- Testing — Assert that specific values exist at expected paths
- Data transformation — Extract subsets of data for downstream processing
Frequently Asked Questions
What JSONPath syntax is supported?
The tool uses `jsonpath-ng` with extensions, supporting: root (`$`), child (`.key`), recursive descent (`..`), wildcards (`*`), array indices (`[0]`), slices (`[0:5]`), and filter expressions (`[?(@.price < 10)]`).
Can I query arrays?
Yes. Pass an array as `data` and use expressions like `$[*].field` or `$[0].field`.
Start using JSONPath Query now
Get your free API key and make your first request in under a minute.