JSON-Arch Logo
JSON-Arch
JSONPath Specification

JSONPath Expression & Syntax Reference

JSONPath is a query language for JSON, similar to XPath for XML. It enables developers to query, extract, and filter specific nodes inside deeply nested JSON structures.

1. Core JSONPath Operators

OperatorDescriptionExample
$The root object or array$
. or []Child operator$.store.book or $['store']['book']
..Recursive descent (searches all descendant nodes)$..author
*Wildcard matching all elements or properties$.store.book[*]
@Current node being evaluated in filter expressions?(@.price < 10)
?()Applies a logical filter expression$.books[?(@.price > 20)]
[start:end]Array slice operator$.items[0:2]

2. Real-World Query Examples

Sample JSON Inputstore.json
{
  "store": {
    "book": [
      { "category": "fiction", "author": "Herman Melville", "title": "Moby Dick", "price": 8.99 },
      { "category": "fiction", "author": "J. R. R. Tolkien", "title": "The Lord of the Rings", "price": 22.99 }
    ]
  }
}
$.store.book[*].author

Extracts all book authors

["Herman Melville", "J. R. R. Tolkien"]
$..price

Extracts all prices anywhere in the structure

[8.99, 22.99]
$.store.book[?(@.price < 10)]

Filters books costing under $10

[ Moby Dick object ]

Test your JSONPath queries live online

Execute JSONPath expressions against any JSON payload in real time with our free client-side tool:

Open JSONPath Tester