JSON

JSONPath Cheat Sheet

Query nested JSON without writing custom loops. Test expressions with the FreeToolMate JSONPath tester — matching stays in your browser.

Sample document

{
  "store": {
    "book": [
      { "title": "Sayings", "price": 8.95, "category": "reference" },
      { "title": "Sword", "price": 12.99, "category": "fiction" }
    ],
    "bicycle": { "color": "red", "price": 19.95 }
  }
}

Common expressions

  • $ — root
  • $.store.bicycle.color — exact path
  • $..price — recursive descent (all prices)
  • $.store.book[*].title — every book title
  • $.store.book[0] — first book
  • $.store.book[?(@.price < 10)] — filter by price
  • $.store.book[?(@.category=='fiction')] — filter by string

Tips

  • Start with $ and build the path one segment at a time
  • Use .. carefully on large documents — it walks the whole tree
  • Pretty-print JSON first so paths are easier to invent and verify

Try it

Open the JSONPath Tester, paste JSON, and run an expression. Related: JSON Viewer and JSON Beautify.

All articles · JSON Cheat Sheet · JSON Tools hub