JSONPath 查询工具 — Uttir
Skip to main content

JSONPath 查询工具

使用 JSONPath 语法查询任意 JSON 文档——提取字段、筛选数组、统计匹配数量。日常 JSON 检查的免费浏览器版 jq 替代品。

JSONPath 查询工具 — JSONPath is the query language for JSON — it lets you pull a single value out of a deeply nested response, filter an array of records to those that match a condition, or count how many items have a particular shape. It plays the same role for JSON that XPath plays for XML, or that jq plays at the command line.

Query runs locally in your browser. Your JSON never leaves the page.

Was JSONPath 查询工具 useful?

JSONPath 查询工具是什么?

JSONPath is the query language for JSON — it lets you pull a single value out of a deeply nested response, filter an array of records to those that match a condition, or count how many items have a particular shape. It plays the same role for JSON that XPath plays for XML, or that jq plays at the command line.

This tool runs the expression against the JSON you paste and returns every match. It supports the operators AI assistants and config tools (kubectl, jq-lite, GitHub Actions ${{ jsonPath(...) }}) reach for most: $ for root, dot and bracket member access, [n] and [-1] for indexing, [*] for wildcard, $.. for recursive descent, and [?(@.key op value)] for filtering. It does not cover every corner of the JSONPath spec — it covers the parts that are useful in day-to-day work.

使用方法

  1. Paste your JSON

    Drop a JSON document into the input. The tool validates it and shows a tree preview below.

  2. Write a JSONPath expression

    Start with $, then dot/bracket through the structure. Use [*] for all items, [0] for the first, [?(@.active == true)] to filter.

  3. Read the matches

    Every match is shown in a list with its JSON value. The count at the top tells you how many results the expression returned.

示例

First user name

Pull the first user's name from an array of users.

$.users[0].name

结果: "Ada Lovelace"

Active users only

Filter an array of users to those with active = true.

$.users[?(@.active == true)]

结果: [{"id":1,"name":"Ada","active":true},{"id":3,"name":"Linus","active":true}]

Every email address

Use recursive descent to find every value of any "email" key anywhere in the document.

$..email

结果: ["[email protected]", "[email protected]"]

常见问题

相关工具

Last reviewed: 2026-11-21