Categories

JSONPath Query Tool

Query arbitrary JSON with JSONPath expressions, preview matches, switch output modes, and save reusable query templates

Example Results

2 examples

Extract all authors from a bookstore payload

Use a JSONPath wildcard to collect author names from a nested API response and keep the query as a reusable template

Rendered JSONPath matches, highlighted source JSON, and a saved template card.
View input parameters
{ "jsonInput": "{ \"store\": { \"book\": [{ \"author\": \"Nigel Rees\" }, { \"author\": \"Evelyn Waugh\" }] } }", "expression": "$.store.book[*].author", "outputFormat": "json", "maxMatches": 20, "saveTemplate": true, "templateName": "Book authors" }

Filter active admin users into a markdown report

Run a JSONPath filter on a user array, inspect matched paths, and export the subset as markdown blocks for documentation

Rendered markdown-ready query results with path highlighting for matching user records.
View input parameters
{ "jsonInput": "{ \"users\": [{ \"name\": \"Ava\", \"role\": \"admin\", \"active\": true }, { \"name\": \"Leo\", \"role\": \"viewer\", \"active\": true }] }", "expression": "$.users[?(@.role == \"admin\")]", "outputFormat": "markdown", "maxMatches": 10, "saveTemplate": false }

Key Facts

Category
Development
Input Types
textarea, text, select, number, checkbox
Output Type
html
Sample Coverage
4
API Ready
Yes

Overview

The JSONPath Query Tool allows developers and data analysts to extract specific data from complex, nested JSON payloads using standard JSONPath expressions. You can instantly preview matches, format the output as JSON, structured tables, or Markdown, and save frequently used queries as reusable templates for faster API debugging and data extraction.

When to Use

  • When you need to extract specific fields or arrays from deeply nested API responses.
  • When filtering large JSON datasets based on specific conditions, such as user roles or active statuses.
  • When generating Markdown or table reports directly from raw JSON data without writing custom scripts.

How It Works

  • Paste your raw JSON payload into the input area.
  • Enter a valid JSONPath expression to target the specific nodes or arrays you want to extract.
  • Select your preferred output format, such as JSON, Table, or Markdown, and set a maximum match limit.
  • View the extracted results instantly and optionally save the query as a template for future use.

Use Cases

Extracting a list of specific IDs or names from a large, nested API response.
Filtering user or product arrays to find records matching specific attributes.
Converting raw JSON configuration files into readable Markdown documentation.

Examples

1. Extracting Authors from a Bookstore API

Backend Developer
Background
A developer is testing a bookstore API and receives a deeply nested JSON response containing various book details.
Problem
They need to quickly extract just the list of author names without manually parsing the entire JSON tree.
How to Use
Paste the JSON response, enter the expression `$.store.book[*].author`, and check 'Save Query Template' to reuse it later.
Example Config
{
  "expression": "$.store.book[*].author",
  "outputFormat": "json",
  "maxMatches": 20,
  "saveTemplate": true,
  "templateName": "Book authors"
}
Outcome
The tool extracts all author names into a clean JSON array and saves the query as a reusable template.

2. Filtering Admin Users for a Report

Data Analyst
Background
An analyst has a JSON export of system users containing different roles and statuses.
Problem
They need to isolate only the active admin users and format the data for a documentation page.
How to Use
Input the user JSON, apply the filter expression `$.users[?(@.role == "admin")]`, and set the output format to Markdown.
Example Config
{
  "expression": "$.users[?(@.role == \"admin\")]",
  "outputFormat": "markdown",
  "maxMatches": 10,
  "saveTemplate": false
}
Outcome
The tool filters out non-admins and generates a Markdown-formatted block containing only the matching admin records.

Try with Samples

json

Related Hubs

FAQ

What is JSONPath?

JSONPath is a query language for JSON, similar to XPath for XML, that allows you to select and extract specific data from complex JSON structures.

Can I format the extracted data?

Yes, you can choose to output the matched results as raw JSON, a structured table, or Markdown blocks.

Is there a limit to the number of matches returned?

You can configure the maximum number of matches to return, ranging from 1 up to 500 results per query.

How do query templates work?

By checking the 'Save Query Template' option and providing a name, you can save your JSONPath expression to quickly reuse it on future JSON payloads.

Can I filter arrays based on specific values?

Yes, JSONPath supports filter expressions like `[?(@.role == "admin")]` to extract only the objects that meet your specific criteria.

API Documentation

Request Endpoint

POST /en/api/tools/jsonpath-query-tool

Request Parameters

Parameter Name Type Required Description
jsonInput textarea Yes -
expression text Yes -
outputFormat select No -
maxMatches number No -
saveTemplate checkbox No -
templateName text No -

Response Format

{
  "result": "
Processed HTML content
", "error": "Error message (optional)", "message": "Notification message (optional)", "metadata": { "key": "value" } }
HTML: HTML

AI MCP Documentation

Add this tool to your MCP server configuration:

{
  "mcpServers": {
    "elysiatools-jsonpath-query-tool": {
      "name": "jsonpath-query-tool",
      "description": "Query arbitrary JSON with JSONPath expressions, preview matches, switch output modes, and save reusable query templates",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=jsonpath-query-tool",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

You can chain multiple tools, e.g.: `https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`, max 20 tools.

If you encounter any issues, please contact us at [email protected]