JSONPath Cheat Sheet for API Testers (2026)
The complete JSONPath cheat sheet for API testers — filters, wildcards, recursion, and copy-paste examples for Postman, Rest Assured, and Playwright.
2026-07-17 · By Avinash Kamble, reviewed by Priyanka G.
JSONPath is the fastest way to pluck values out of a JSON response for assertions. This cheat sheet covers every operator you'll actually use, with runnable examples you can validate live in the free JSON / JSONPath / JMESPath Tester.
Core syntax
$ root
@ current element (inside filters)
.name child by name
['name'] child by name (bracket form)
..name recursive descent (any depth)
* wildcard
[n] array index
[n,m] multiple indices
[start:end] array slice
[?(@.x > 1)] filter expressionCopy-paste examples
Sample JSON:
{ "orders": [
{ "id": 1, "total": 45, "status": "paid" },
{ "id": 2, "total": 120, "status": "pending" },
{ "id": 3, "total": 30, "status": "paid" }
]}
$.orders[*].id -> [1, 2, 3]
$.orders[0].total -> 45
$..status -> ["paid","pending","paid"]
$.orders[?(@.status=='paid')].id -> [1, 3]
$.orders[?(@.total > 50)].id -> [2]
$.orders[-1:].id -> [3]Postman
const body = pm.response.json();
pm.test("first order is paid", () => {
pm.expect(body.orders[0].status).to.eql("paid");
});Rest Assured
given().when().get("/orders")
.then().body("orders.findAll { it.status == 'paid' }.id", hasItems(1, 3));Playwright
const res = await request.get('/orders');
const body = await res.json();
expect(body.orders.filter((o:any)=>o.status==='paid').map((o:any)=>o.id)).toEqual([1,3]);Test your expressions live
Paste any JSON and a JSONPath expression into the JSON / JSONPath / JMESPath Tester to see instant matches. It also exports the assertion as Postman, Rest Assured, Playwright, or curl code.
Frequently asked questions
1.Is JSONPath standardised?
2.Can JSONPath modify values?
3.Does Postman support JSONPath natively?
4.JSONPath or JMESPath?
Practice these questions
Rehearse REST, Postman, REST Assured and contract-testing questions with worked examples.
Was this article helpful?
More from REST API Testing
REST fundamentals — verbs, status codes, contracts.
- Experience-Level QA InterviewsAPI Testing Interview Questions for 1 Year Experience (2026 Complete Guide)
- Experience-Level QA InterviewsAPI Testing Interview Questions for 3 Years Experience (2026 Complete Guide)
- Experience-Level QA InterviewsAPI Testing Interview Questions for Senior Level (2026 Complete Guide)
Keep building your QA edge
Pillar guides- Postman TutorialSoftwareTestPilot's Postman walkthroughPostman from zero to CI — collections, scripts, Newman.
- cURL to Code ConvertercURL to code converterConvert any cURL command to Postman, Playwright, Rest Assured, k6, Cypress, Python, and more — free, in-browser.
- JSON / JSONPath / JMESPath TesterJSON / JSONPath / JMESPath testerDual-engine JSONPath + JMESPath tester with assertion builder and Postman/Playwright/Rest Assured export.
- Postman to Code ConverterPostman collection to code converterConvert any Postman collection into a full Playwright, Rest Assured, k6, Cypress, Supertest, Python, or Karate test suite — folders, pm.test assertions, and environments preserved.
Practice these questions live
Rehearse with an AI QA interviewer that scores your answers in real time.
Continue reading
Join the QA Community
Connect with fellow testers, share job leads, and get career advice.
Stop Reinventing the Wheel. Upgrade Your QA Arsenal.
Take your testing skills from beginner to Lead Engineer. Supercharge your daily workflow with our premium digital resources.
- Ready-to-use testing strategy templates
- Advanced API & UI automation guides
- ⏱️ Save 10+ hours a week on test planning


