SoftwareTestPilot
API TestingPublished: 7 min read

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.

Avinash Kamble
Founder & QA Engineer at SoftwareTestPilot
Reviewed by Priyanka G.
Share:XLinkedInWhatsApp

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 expression

Copy-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?
RFC 9535 (2024) finally standardised JSONPath. Most existing implementations already comply.
2.Can JSONPath modify values?
No. JSONPath is a query language; use jq or JMESPath libraries with mutation helpers if you need transforms.
3.Does Postman support JSONPath natively?
Yes — via pm.expect on the parsed body, or through third-party helpers. Most testers just use JS object access.
4.JSONPath or JMESPath?
JSONPath is more concise for filters; JMESPath has richer functions and multi-select projections. See our JMESPath comparison post.
Keep going

Practice these questions

Rehearse REST, Postman, REST Assured and contract-testing questions with worked examples.

Found this useful?
Share:XLinkedInWhatsApp

Was this article helpful?

Cluster · API Testing

More from REST API Testing

REST fundamentals — verbs, status codes, contracts.

Pillar guide · 30 articles
More in this cluster
From the API Testing pillar

Keep building your QA edge

Practice these questions live

Rehearse with an AI QA interviewer that scores your answers in real time.

Start a Free AI Mock Interview →

Continue reading

Join the QA Community

Connect with fellow testers, share job leads, and get career advice.

Premium QA Resources

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
4.9/5 rating
Explore All Products

⭐⭐⭐⭐⭐ Trusted by 1,000+ Software Test Pilots • Instant Access