JSONPath query

Pull values out of JSON with a JSONPath expression such as $.items[*].name.

Input

The JSON to search.
JSONPath expression starting with $.

Result

Fill in the input and press Run.

Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.

Use it from code or an agent

curl -s https://setget.net/v1/tools/jsonpath-query \
  -H 'Content-Type: application/json' \
  -d '{"input":{"text":"{\"items\":[{\"name\":\"a\",\"n\":1},{\"name\":\"b\",\"n\":2}]}","path":"$.items[*].name"}}'
import json, urllib.request

body = {'input': {'text': '{"items":[{"name":"a","n":1},{"name":"b","n":2}]}', 'path': '$.items[*].name'}}
request = urllib.request.Request("https://setget.net/v1/tools/jsonpath-query", json.dumps(body).encode(),
                                 {"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/jsonpath-query", {
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({"input":{"text":"{\"items\":[{\"name\":\"a\",\"n\":1},{\"name\":\"b\",\"n\":2}]}","path":"$.items[*].name"}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
  "slug": "jsonpath-query",
  "input": {
    "text": "{\"items\":[{\"name\":\"a\",\"n\":1},{\"name\":\"b\",\"n\":2}]}",
    "path": "$.items[*].name"
  }
}
{
  "input": {
    "text": "{\"items\":[{\"name\":\"a\",\"n\":1},{\"name\":\"b\",\"n\":2}]}",
    "path": "$.items[*].name"
  }
}

Endpoint: POST /v1/tools/jsonpath-query. Over MCP: run_tool with slug: "jsonpath-query". Machine-readable: input schema, Markdown. Connect an agent.

Inputs

NameTypeRequiredWhat it does
text string yes The JSON to search.
path string yes JSONPath expression starting with $.

Examples

Input
{
  "text": "{\"items\":[{\"name\":\"a\",\"n\":1},{\"name\":\"b\",\"n\":2}]}",
  "path": "$.items[*].name"
}
Result
{
  "matches": [
    "a",
    "b"
  ],
  "count": 2
}

Recursive descent

Input
{
  "text": "{\"a\":{\"id\":1,\"b\":{\"id\":2}}}",
  "path": "$..id"
}
Result
{
  "matches": [
    1,
    2
  ],
  "count": 2
}

Questions

Which JSONPath features are supported?
Names, quoted names, indexes, slices, wildcards and recursive descent (..). Filter expressions such as ?(@.price > 10) are not supported.