JSON
مختبر JSONPath
اختبار تعبيرات JSONPath على بيانات JSON حقيقية — معاينة فورية للقيم الموجودة ومساراتها.
$ — الجذر · .key / ['key'] — خاصية · .. — بحث تكراري · [*] — جميع العناصر · [0,1] — فهارس · [0:2] — شريحة · [?(@.price<10)] — فلتر
—
JSONPath lets you reach into nested JSON values the way XPath does for XML — a compact path string like $.users[0].email instead of manually walking the structure. This tool lets you test an expression against real data and see the result instantly.
How to use it
- Paste JSON data into one field and a JSONPath expression into the other.
- The result shows every matched value along with its exact path, even when there are several matches.
- Use [*] to iterate over every array element, or a filter like [?(@.price > 100)] for conditional selection.
Common uses
- Working out the right JSONPath expression to pull a specific field from an API response before pasting it into code.
- Testing data-transformation or message-routing rules that rely on JSONPath (for example, in AWS Step Functions or an API Gateway).
- Quickly locating a value in a large, deeply nested JSON document without scrolling through it manually.
Things to keep in mind
There's no single official JSONPath standard — the basic syntax (dots, brackets, *) is supported the same way everywhere, but filters and more advanced expressions differ between libraries.
Array indexing in JSONPath starts at zero, like in most programming languages — [0] means the first element.
مقالة عن هذه الأداة: JSONPath: كيف تبحث في بيانات JSON دون تحليل يدوي
الأسئلة الشائعة
ما الفرق بين $.key و $..key؟
$.key يصل إلى الخاصية key في المستوى الحالي فقط، بينما $..key يبحث عنها بشكل تكراري في جميع المستويات المتداخلة أينما وُجدت.
هل JSONPath يشبه أي تقنية أعرفها؟
نعم، هو مشابه من الناحية المفاهيمية لـ XPath لكن لبيانات JSON بدلاً من XML، مع صياغة مختلفة مثل [*] لكل العناصر و[?(@.price<10)] للفلاتر.
هل بيانات JSON التي أختبرها آمنة؟
نعم، كل التقييم يتم محليًا داخل متصفحك عبر JavaScript، ولا تُرسل بياناتك أو تعبير JSONPath إلى أي خادم.
كيف أصل إلى مفتاح يحتوي نقطة أو مسافة؟
عبر أقواس مربعة مع علامات اقتباس: $['user.name'] بدلًا من $.user.name — وإلا سيقرأ المحلِّل النقطة كفاصل تداخل لا كجزء من اسم المفتاح.
هل يوجد معيار رسمي وحيد لـJSONPath؟
لا. الصياغة الأساسية (النقاط، الأقواس، النجمة) مدعومة بنفس الطريقة تقريبًا في كل مكان، لكن الفلاتر والتعبيرات المتقدمة تختلف بين المكتبات — تحقق من التوافق للتعبيرات المعقدة.