Welcome to our Online JSONPath Tester tool, designed to simplify the testing and debugging of your JSONPath expressions. Whether you're working with a JSON string or a file, this tool provides a user-friendly interface to streamline the process.
You can see JSONPath syntax to help you to find your JSONPath query.
You can see the user guide to help you to use this JSONPath tester.
In order to test your JSONPath expression, you must:
To fill "Your JSON structure" editor, you can:
It use JSONPath Plus library.
Effortlessly test and debug your JSONPath expressions using our online tool. Input your JSON string or upload a file, and our intuitive interface guides you through the process. With real-time feedback, you can quickly identify and rectify any issues in your expressions, ensuring they function as intended.
Navigating through JSONPath queries is made simple with our user-friendly interface. Explore and experiment with different expressions effortlessly, and witness immediate results. The tool gives you the ability to fine-tune your queries, making the process of working with JSON data more efficient and enjoyable (Well, I hope so ^^).
XPath (XML Path Language) is a query language for selecting nodes from a XML data.
JSONPath is XPath for JSON: JSONPath is a query language for JSON.
Developers can use JSONPath in a variety of programming languages (Javascript, PHP, Java, ...).
This mini syntax guide provides a quick reference point for understanding and effectively utilizing JSONPath expressions. Hoping this can assist you.
JSONPath | Description |
---|---|
$ | The root object / element |
@ | The current object / element |
. | Child member operator |
.. | Recursive descendant operator; JSONPath borrows this syntax from E4X |
* | Wildcard matching all objects/elements regardless their names |
[] | Subscript operator |
[,] | Union operator for alternate names or array indices as a set |
[start:end:step] | Array slice operator borrowed from ES4 / Python |
?() | Applies a filter (script) expression via static evaluation |
() | Script expression via static evaluation |
{ "house": { "room": [ { "name": "Bedroom", "area": 10 }, { "name": "Bathroom", "area": 9 }, { "name": "Kitchen", "appliance": "microwave", "area": 12 } ], "garden": { "area": 150 } } }
The following are some examples of JSONPath expressions:
JSONPath | Description |
---|---|
$.house.* | All things in house, which are some rooms and a garden |
$..name | All names |
$..room[2] | The third room |
$..room[(@.length-1)] | The last room |
$..room[-1:] | The last room |
$..room[0,1] | The first two rooms |
$..room[:2] | The first two rooms |
$..room[?(@.appliance)] | Filter all rooms with home appliance |
$..room[?(@.area<10)] | Filter all rooms smaller than 10 |
$..room[?(@.area<10 && @.name=="Bedroom")] | Filter all Bedrooms smaller than 10 |
$.house.room[*].area | The area of all rooms in the house |
Comments
DANIEL MARQUES PEREIRA-2021-01-19 14:07
Cyril-2021-01-19 14:30
asd-2022-02-05 18:13
Lienix-2022-02-22 12:09
E.g. instead of this
$.house.room[?(@.name == 'Bedroom')]
use an 'in' expression to geht two results:
$.house.room[?(@.name in ['Bedroom', 'Bathroom'])]
But that isn' t working! What is the trick to make it correct?
Lucas-2022-03-23 08:37