How to extract fields from api responses using jsonpath
- Step 1Paste the API response JSON — Paste the full REST or GraphQL API response. For GraphQL, paste the data object. The tool handles objects and arrays at the root level.
- Step 2Write the JSONPath expression — Start with $.data.users[*].email to extract all email addresses, or $.orders[?(@.status == 'pending')].id to filter orders by status. Use the wildcard * to match any property at a level.
- Step 3Review matched values — The result panel shows all values matched by the expression. If the result is empty, check the path by expanding one level at a time — $.data, then $.data.users, then $.data.users[*].email.
- Step 4Copy the expression for use in your code — Use the JSONPath expression in Node.js with the jsonpath-plus package, in Python with jsonpath-ng, or in a jq command: cat response.json | jq '[.data.users[].email]'.
Frequently asked questions
What is the difference between JSONPath and jq?+
JSONPath is a query language specifically for extracting values from JSON, similar to XPath for XML. jq is a more powerful command-line JSON processor that includes transformation, conditional logic, and output formatting beyond just path extraction. Use JSONPath for simple field extraction; use jq for complex transformations.
How do I extract values from arrays of objects where only some objects match a condition?+
Use a filter expression: $.orders[?(@.status == 'completed')].total. The ?() syntax applies a filter to each array element where @ refers to the current element. You can combine conditions with && and || inside the filter.
Is the API response data transmitted to JAD Apps?+
No. JSONPath evaluation runs entirely in your browser. API responses, customer records, and sensitive field values are never transmitted to JAD Apps servers.
Privacy first
Conversion runs locally in your browser. No file is uploaded — only metadata counters are saved for signed-in dashboard stats.