Sổ Tay AI
🛤

JSONPath Tester (Pick data từ JSON)

Test JSONPath query với JSON sample. Hỗ trợ recursive descent, slice, filter cơ bản. Phù hợp pick data từ API response, debug LLM structured output.

Kết quả
  

Cú pháp JSONPath

$ Root object
$.foo / $["foo"] Property foo
$.foo.bar Nested property
$[0] Phần tử mảng đầu tiên
$[-1] Phần tử cuối
$[*] Tất cả phần tử
$[0:3] Slice 0..2
$..price Recursive — mọi `price` ở mọi level
$.items[?(@.price > 100)] Filter (subset support)

Test JSONPath query với JSON sample. Implement JSONPath subset (RFC 9535 draft). Dùng để pick data từ API response, debug structured output LLM.

JSONPath là gì?

JSONPath = "XPath cho JSON". Cú pháp query để extract phần dữ liệu từ JSON object/array. Phổ biến trong:

Cú pháp tóm tắt

Use case thực tế

// API response
{
  "store": {
    "books": [
      { "title": "AI for Everyone", "price": 350000 },
      { "title": "Sapiens", "price": 280000 }
    ]
  }
}

// Lấy tất cả title:
$.store.books[*].title  // ["AI for Everyone", "Sapiens"]

// Lấy book có giá > 300k:
$.store.books[?(@.price > 300000)]

// Recursive — mọi price trong document:
$..price  // [350000, 280000]

JSONPath vs JSON Pointer (RFC 6901)

Liên quan

Công cụ liên quan

Xem tất cả công cụ →