DevBolt

JSONPath Expression Examples

Browse practical JSONPath expression examples for everyday tasks. Each example can be tested live in the browser with no data sent to any server.

← Back to tools

JSON Path Tester

Test JSONPath expressions against your JSON data with real-time evaluation. Perfect for building API queries, data extraction, and debugging JSON structures.

About JSONPath

JSONPath is a query language for JSON, similar to XPath for XML. It lets you extract specific values from complex JSON structures using path expressions.

Common syntax:
  • $ — root object
  • .key — child property
  • [*] — all array elements
  • [0], [0:3] — array index / slice
  • .. — recursive descent (search all levels)
  • [?(@.price < 50)] — filter expression

JSONPath is commonly used in REST API testing, data pipelines, and configuration management to extract or validate specific fields from JSON payloads.

Everything runs in your browser — no data is sent over the network.

Why learn JSONPath by example?

JSONPath syntax is compact but can be tricky with nested arrays and filter expressions. Working through real examples is the fastest way to build fluency. Each example below covers a common scenario like extracting nested fields, filtering arrays by value, and using wildcards for bulk extraction.

Common use cases

JSONPath is used in API testing tools like Postman, configuration systems like Kubernetes, log analysis pipelines, and data transformation workflows. Developers use it to extract specific fields from large API responses, validate payloads in automated tests, and build dynamic queries in no-code platforms.

Frequently Asked Questions

Can JSONPath select multiple fields at once?

Yes. You can use the union operator, e.g. $..book[0,1] to select the first two books, or combine with wildcards like $..book[*].title to extract the title from every book in the array.

How do I filter JSON arrays with JSONPath?

Use the filter syntax [?(@.field operator value)]. For example, $..book[?(@.price < 15)] returns all books cheaper than 15. You can chain conditions with && and || operators.