What is JSONPath?
JSONPath is a query language for JSON, first proposed by Stefan Goessner in 2007 as a JSON equivalent of XPath (XML's query language). After 17 years of de facto standardization, JSONPath was finally formalized in RFC 9535 (February 2024). It provides a consistent way to navigate, filter, and extract data from JSON documents using path expressions like $.store.books[0].title.
Why JSONPath matters
Modern systems pass JSON everywhere. JSONPath gives you a single query language for all of them — log search (Elasticsearch, Datadog), API testing (Postman), configuration (Kubernetes kubectl jsonpath), ETL pipelines (Airflow, Dagster), AWS Step Functions ($.input.field), GitHub Actions context expressions. Learning JSONPath once pays dividends everywhere.
How JSONPath compares
- JSONPath — read-only query, simple syntax, RFC 9535 standard
- JMESPath — alternative spec used by AWS CLI, more functional features (sort, map, filter)
- JQ — full programming language for JSON, command-line tool
- JSON Pointer (RFC 6901) — minimal path syntax, no wildcards, used in JSON Patch