Guides/Tool Guides

JSONPath Query Guide

Query JSON with JSONPath.

Overview

Run JSONPath queries to extract values from JSON (e.g. $.data.items[*].id). Ideal for debugging APIs, pulling fields from nested responses, and writing quick data checks without code. Runs locally in your browser.

Pro time-savers

  • Batch path queries (one JSONPath per line)

Use cases

  • Extract IDs from an API response to compare with database records.
  • Pull nested values to create a smaller sample payload for bug reports.
  • Validate that a field exists across a list of items.

Common pitfalls

  • Different JSONPath implementations support different filter syntaxes; if a filter fails, try simplifying.
  • Paths are case-sensitive; a wrong key casing often yields empty results.

FAQs

Why is the result empty?

Verify the JSON structure first, then simplify the path step-by-step. Start with $ and add segments gradually.

Is JSONPath standardized?

Not fully. There are variations across implementations. Common syntax ($.a.b, $..id, [*]) works in most cases.

How do I select all items in an array?

Use [*], e.g. $.items[*].id.

How do I debug a complex path?

Try evaluating intermediate paths (e.g. $.data, then $.data.items) to confirm each level matches what you expect.

Examples

Input

json={"a":{"b":[{"id":1},{"id":2}]}}
path=$.a.b[*].id

Output

[1,2]