Use path expressions to extract specific data from JSON documents.
$.name ยท $.users[0] ยท $.items[*].price ยท $.address ยท $..email
| Expression | Description | Example |
|---|---|---|
$ | Root object | $ โ entire document |
.key | Child property | $.name โ value of "name" |
[0] | Array index | $.items[0] โ first item |
[*] | All array items | $.items[*].name โ all names |
.. | Recursive descent | $..email โ all emails at any depth |
Have questions? Check our FAQ page.
JSONPath is a query language for JSON, similar to XPath for XML. It allows you to extract specific values from complex JSON documents using concise path expressions. This is invaluable when working with large API responses where you only need specific fields.
$.store.books[0].title โ Get the title of the first book$.users[*].email โ Get all user email addresses$..price โ Find all "price" fields at any depth (recursive)$.data[0:5] โ Get the first 5 items from an array$.config.database.host โ Navigate nested objects with dot notationJSONPath is commonly used in API testing tools (like Postman), data pipeline configurations, log analysis, and anywhere you need to extract specific data from JSON without writing full parsing code. It's also used in tools like jq (command-line JSON processor) and various programming language libraries.