Ecosystem
JSONPath, JMESPath and jq: one input, checked results
Run equivalent selections on a downloadable JSON sample, compare result shapes and choose a language supported by your tool.
Use the query language your host application supports. A query copied from jq cannot be pasted unchanged into JSONPath, and a successful browser test does not establish that a different library supports the same extensions.
Run the same selection
Download books.json. Open the JSONPath tester, paste this input, then select titles priced below 10:
{"books":[{"title":"A","price":8},{"title":"B","price":12},{"title":"C","price":9}]}
JSONPath expression:
$.books[?(@.price < 10)].title
Expected selected values in the tester:
["A","C"]
Equivalent standard JMESPath expression (the backticks delimit a JSON numeric literal):
books[?price < `10`].title
Equivalent jq command, with brackets collecting values into one array:
jq '[.books[] | select(.price < 10) | .title]' books.json
All three yield ["A", "C"] as values for this input. Without jq’s outer brackets, the command emits two separate JSON strings. That difference matters if a downstream process expects one document rather than a stream of values.
Selection and transformation are different tasks
JSONPath selects nodes. To rename fields, construct objects with a language that supports that operation. For example, JMESPath:
books[?price < `10`].{name: title, cost: price}
And jq:
jq '[.books[] | select(.price < 10) | {name: .title, cost: .price}]' books.json
Expected output:
[{"name":"A","cost":8},{"name":"C","cost":9}]
JMESPath defines functions such as sort_by, length and contains. Their input type requirements are checked during evaluation; a syntactically valid query can still fail on incompatible data. Do not assume a function from jq also exists in JMESPath.
Test empty and missing data too
Change the price threshold to zero: the collected output should be []. Remove the books property and repeat: implementations differ in whether missing paths become null, no matches or an error once another operation is applied. Decide which result your integration accepts rather than letting an empty report silently look like success.
An individual JSON Pointer, such as /books/0/title, identifies one location. It is not a JSONPath filter. Schema validation error paths often use Pointer conventions, so check the producer’s format before interpreting them.
Choose a place to run the query
JSONPath is useful when the answer already exists in the input and your application accepts its dialect. JMESPath is used by the AWS CLI --query option and can construct result objects. jq is convenient for shell transformations and can work with streams, although its default document parsing still materializes input.
JSONCraft provides JSONPath and a tree viewer; it does not claim to run JMESPath or jq in the browser. For larger exports, see the streaming guide.
References: JSONPath RFC 9535, JSONPath Plus documentation, JMESPath specification, jq manual.
Related tools
Frequently asked questions
Does JSONCraft implement the JSONPath RFC exactly?
The tester uses JSONPath Plus. Do not assume complete RFC 9535 conformance; test the dialect and options used by the receiving application.
Is group_by a standard JMESPath function?
No. jq provides group_by; it is not in the standard JMESPath function set.