Most of the time you don't need the whole JSON document โ you need one field, or the same field across a list. Path expressions let you pull exactly that. Here are the practical patterns and examples you can paste and try.
| Pattern | Means |
|---|---|
.key or key | Step into an object's property |
[0] | The element at an array index |
[*] | Every element of an array (or every value of an object) |
Given this JSON:
{
"store": "Aurora",
"orders": [
{ "id": 1, "total": 18.0, "items": ["espresso"] },
{ "id": 2, "total": 32.5, "items": ["cold brew", "mug"] }
]
}
| Path | Result |
|---|---|
store | "Aurora" |
orders[0].total | 18 |
orders[*].id | [1, 2] |
orders[*].items[*] | ["espresso","cold brew","mug"] |
On a large response, hunting for a value by eye is slow and error-prone. A path expression returns just what you asked for, and combined with a viewer you can confirm the shape first, then extract.