JSONWeave / Query JSON with JSONPath, jq or SQL
JSONPath tester, jq and SQL query for JSON
Pull exactly the values you need out of a large JSON document. Type a JSONPath expression, a jq filter or a SQL-style SELECT and JSONWeave runs it against the open document, entirely in your browser.
Query JSON in the workspaceThree query languages, one query bar
You do not pick a mode. JSONWeave looks at what you typed: a query that starts with $ runs as JSONPath, one that starts with SELECT runs as SQL, and anything else runs as a jq filter.
- JSONPath: property access, wildcards, array indexes and slices, recursive descent (..) and ?(filter) expressions.
- jq: a subset of jq filters, including pipes and select().
- SQL: SELECT with FROM, WHERE, GROUP BY, ORDER BY, LIMIT and OFFSET, plus aggregates such as count(*).
Example: the same question in all three languages
Given this document, find the titles of books that cost less than 8.
{
"store": {
"books": [
{ "title": "Dune", "price": 9.5 },
{ "title": "Emma", "price": 5 }
]
}
}$.store.books[?(@.price < 8)].title.store.books[] | select(.price < 8) | .titleSELECT title, price FROM $.store.books WHERE price < 8 ORDER BY priceUseful JSONPath patterns
$.store.books[*].title$..priceWorking with the results
- Copy the results, or open them as a new document to keep working on just that slice.
- Results are capped at 5,000 items, and the app tells you when a result was cut.
- A query that would take too long to evaluate is stopped, so a bad query cannot freeze the tab.
- Errors in the query are shown as a message instead of failing silently.
Queries need a valid document
A query runs on the parsed document. If your JSON is broken, repair it first, then query it.
Frequently asked questions
Is this a JSONPath tester?
Yes. Paste your JSON, type a JSONPath expression starting with $ and the matching values are listed straight away.
Does it support the full jq language?
No. It supports a subset of jq filters, including pipes and select(). JSONPath and SQL-style SELECT are also available.
Is my JSON uploaded when I run a query?
No. Queries run in your browser against the document you opened.
Related
Ready to try it on your own JSON?
Open the workspace, paste or drop a file, and nothing leaves your browser.
Query JSON in the workspace