What is JSONPath?

JSONPath is a query language for JSON documents that enables extracting and filtering data from complex JSON structures using path expressions similar to XPath for XML.

Quick Facts

Full NameJSONPath Query Language
Created2026-02-01
SpecificationOfficial Specification

How JSONPath Works

JSONPath provides a standardized syntax for navigating and querying JSON data structures. It uses dot notation and bracket notation to traverse nested objects and arrays, with support for wildcards, recursive descent, array slicing, and filter expressions. JSONPath expressions start with $ representing the root element, followed by path segments that navigate through the JSON structure. The language supports both simple property access and complex filtering operations, making it invaluable for extracting specific data from large JSON responses.

Key Characteristics

  • Uses $ as root element reference
  • Supports dot notation ($.store.book) and bracket notation ($['store']['book'])
  • Wildcard (*) matches all elements at current level
  • Recursive descent (..) searches all descendants
  • Array slicing with [start:end:step] syntax
  • Filter expressions with ?() for conditional selection
  • Script expressions with () for computed values

Common Use Cases

  1. Extracting specific fields from API responses
  2. Filtering arrays based on conditions
  3. Testing JSON structure in automated tests
  4. Data transformation pipelines
  5. Configuration file parsing

Example

$.store.book[?(@.price < 10)].title

Related Tools on QubitTool

Related Concepts