How AI is applied across API Evangelist and APIs.io. Read my AI disclosure →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

JSONPath

JSONPath is a query language used to extract, filter, and manipulate data from JSON (JavaScript Object Notation) structures. It provides a syntax similar to XPath (used for XML) but is designed specifically for JSON data. Almost any service or tool working with JSON will likely be using JSONPath behind the scenes. JSONPath is used by Spectral rules to identify the portion of OpenAPI or other schema being referenced by any governance rule, bringing the following benefits.

  • Efficient Data Access - JSONPath makes it easy to navigate and extract specific parts of deeply nested JSON structures without having to manually traverse the hierarchy.
  • Flexibility - Supports filtering, wildcard matching, and recursive searches, enabling complex queries with minimal effort.
  • Standardized Queries - Provides a consistent way to query JSON data across programming languages and libraries, improving code readability and maintainability.
  • Dynamic Filtering - Allows you to filter JSON data based on conditions, such as retrieving objects that match specific key-value pairs.
  • Integration with APIs - JSONPath is widely supported in tools and libraries for APIs, making it ideal for parsing and processing JSON responses.
  • Scripting and Testing - Useful in testing frameworks like Postman and JMeter for validating JSON responses in API tests.

JSONPath is an essential tool for querying and manipulating JSON data efficiently. Its simplicity, flexibility, and compatibility with multiple programming languages make it a go-to solution for working with JSON in APIs, data analysis, and testing frameworks. Open source standards like JSONPath help ensure more precision when it comes to governing the technical details of APIs, but can also be expanded to reference artifacts that are the inputs our outputs of business applications being used to manage APIs.

JSONPath, standardized as RFC 9535, is a query language for selecting and extracting values from a JSON document, filling the same role for JSON that XPath fills for XML. A JSONPath expression walks the object and array structure with a compact syntax to pick out exactly the nodes you want, from a single field to every match under a recursive descent.

  • Path expressions - $ roots the query while dot and bracket steps descend into objects and arrays.
  • Filters and wildcards - Predicates, wildcards, and recursive descent express complex selections tersely.
  • Late standardization - Widely implemented for years before RFC 9535 finally pinned down the semantics in 2024.
  • Tooling ubiquity - Built into Postman, JMeter, Spectral, kubectl, and countless client libraries.

In API operations JSONPath is how governance and testing tools point at a specific location inside a document — Spectral rules use it to target the exact OpenAPI node a rule applies to, and test frameworks like Postman assert against selected values in a JSON response. As API governance and agentic tooling increasingly reason over JSON artifacts, a standardized JSONPath means a rule or an agent can reference “the part of the document I care about” the same way across every implementation.

Referenced on the API Evangelist blog

Where this standard shows up across sixteen years of my writing at apievangelist.com — how it fits into API design, governance, and the agentic turn.