TopDev
🛤

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.

Tất cả công cụ Browser-only
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)

Phù hợp với ai

Backend dev, API integrator, người debug response JSON/YAML/CSV, hoặc làm việc với dữ liệu cấu trúc thường xuyên.

Câu hỏi thường gặp

Dữ liệu nhạy cảm có an toàn không?

Có. JSON/YAML/CSV bạn paste KHÔNG được upload lên server. Mọi xử lý (parse, format, validate) diễn ra cục bộ trong trình duyệt.

Có giới hạn dung lượng dữ liệu không?

Phụ thuộc vào RAM trình duyệt. Thông thường file dưới 10MB chạy mượt. File lớn hơn có thể chậm hoặc đứng tab.

Công cụ liên quan

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