Skip to content
cosmodev ~/tools/jsonpath

أداة تجربة JSONPath

Data & DevOps

نفّذ استعلامات JSONPath على أي مستند: الوصول إلى الأبناء، والرموز البديلة، والنزول التكراري، والفهارس، والمقاطع والاتحادات، مع عرض كل تطابق في مساره الكامل. يعمل محليًا في متصفحك مع رابط قابل للمشاركة.

القواعد: .name ['name'] [*] .* ..name [n] [start:end] [a,b]

جرّب:

الصق مستندًا ومسارًا وستظهر التطابقات هنا.

(التوثيق بالإنجليزية)

What it does

Runs a JSONPath query against any JSON document and shows every match at its full path. The supported grammar: $ root, .name and ['name'] child access, [*] and .* wildcards, ..name recursive descent, [n] indexing with negatives from the end, [start:end] slices with clamping, and [a,b] unions of indexes and names. Missing paths return an empty match list, never an error; syntax problems are reported with their position. Everything runs locally in your browser.

How to use it

  1. Type a path into JSONPath (top left) — chips like $..price and book[*].title load worked examples.
  2. Paste a JSON document into JSON document, or tap Sample for a store/book catalog.
  3. Matches appear on the right with their full paths and values; the badge counts them.
  4. Copy share link encodes the document and the path in the URL.

Examples

Recursive descent finds every price at any depth:

$..price on the sample → 4 matches: $.store.book[0].price … $.store.bicycle.price

Wildcards + child combine:

$.store.book[*].title → Alpha, Beta, Gamma at indexed paths

Negative index and slice:

$.store.book[-1].title → Gamma · $.store.book[0:2].title → the first two titles

Grammar reference

Expression Meaning
$.a.b or $['a']['b'] child access
$.* / $.a[*] wildcard over object keys / array items
$..name every name key at any depth
$.a[2] / $.a[-1] index / index from the end
$.a[1:3] / $.a[:2] / $.a[-2:] slice (clamped, negatives allowed)
$.a[0,2] / $.a[0,'k'] union of indexes and names

Not supported (by design): filter expressions [?(@.x)] and script expressions — for those, jq or a full JSONPath implementation is the right tool (see the jq-style tools in our catalog).

الكود المصدري14 لغة

100% على جانب العميل · بياناتك لا تغادر متصفحك أبدًا. هل وجدت هذا مفيدًا؟ شاركه مع أحد زملائك.