Finding One Field in a Huge Response
By toolbelt maintainers ·
Updated
You know the value exists. You do not want to click through a tree to find it. JSONPath gets you there in one line.
What is this tool?
JSONPath is a query language for JSON, like XPath for XML. You describe a path and get every node that matches. There is no single standard, so behaviour varies slightly between implementations.
How it works
The expression starts at the document root, written $. Dots select keys, brackets select indices or filters, star is a wildcard, and double dot searches every descendant. The result is always a list.
Example
$.users[*].name → every name $.users[?(@.role == admin)] → matching users $..id → every id at any depth $.items[0] → the first item
When to use it
Inspecting a large API response to find where a value lives. Extracting a nested field for a test assertion. Checking a payload has every required identifier before you write the code.
Optimization Tips
Build the path one step at a time and watch the match count. A filter that returns nothing is almost always pointing at an object instead of an array. And quote string values in filters — an unquoted `admin` is not the same as `"admin"`.
Frequently Asked Questions
What does $ mean?
Why do I get duplicates from ..?
Can I use length() or other functions?
Is the document uploaded?
Related tools
- curl ConverterConvert curl commands into Python, JavaScript, Go, PHP, Ruby, Rust and Java code. Paste a request copied from your browser devtools and get working client code instantly.
- HTTP Header AnalyzerPaste a response header set and see which security headers are missing or weak. Checks CSP, HSTS, frame protection, referrer policy and header disclosure.
- JSON ValidatorValidate JSON syntax with detailed error messages. Catch trailing commas, missing brackets, and syntax errors instantly before sending payloads to your API.
- JSON FormatterBeautify, validate, minify, and view JSON. Format messy API responses into readable code or compress it to save bandwidth, running safely in your browser.