Online tools to test JSONPath Queries (plus a small list of Amazon top level domains)
Posted by jpluimers on 2026/04/15
I wanted to parse some JSON being sent back during an XMLHttpRequest (what a wrongly named call is that!) of which I grabbed the content using the web development tools of my Chromium based browser.
Input
I got this list of amazon top level domain names from research I did for my blog post Download your Kindle books soon, because Amazon will block them after February 25, 2025 . The source is [Wayback/Archive] Amazon operating domains by country. · GitHub [Wayback/Archive] in the file amazon-domains.json:
{
"us": "https://www.amazon.com",
"uk": "https://www.amazon.co.uk",
"ca": "https://www.amazon.ca",
"de": "https://www.amazon.de",
"es": "https://www.amazon.es",
"fr": "https://www.amazon.fr",
"it": "https://www.amazon.it",
"jp": "https://www.amazon.co.jp",
"in": "https://www.amazon.in",
"cn": "https://www.amazon.cn",
"sg": "https://www.amazon.com.sg",
"mx": "https://www.amazon.com.mx",
"ae": "https://www.amazon.ae",
"br": "https://www.amazon.com.br",
"nl": "https://www.amazon.nl",
"au": "https://www.amazon.com.au",
"tr": "https://www.amazon.com.tr",
"sa": "https://www.amazon.sa",
"se": "https://www.amazon.se",
"pl": "https://www.amazon.pl"
}
The list is far from complete, so tomorrow I will post some more sources in Some pages that have lists of Amazon toplevel domains.
The queries and results show you that the original JSONPath (2007) and its RFC 9535 definition (2024, just 2 years ago) do not support getting the key names of the above list the ~ part in the first query below fails, and only the second query works.
This means that finding the right tooling is important.
Example
Amazon countries and domains Countries Domains Root name Root content Query $.*~$.*$~or$.~$or$.Result [ "us", "uk", "ca", "de", "es", "fr", "it", "jp", "in", "cn", "sg", "mx", "ae", "br", "nl", "au", "tr", "sa", "se", "pl" ] [ "https://www.amazon.com", "https://www.amazon.co.uk", "https://www.amazon.ca", "https://www.amazon.de", "https://www.amazon.es", "https://www.amazon.fr", "https://www.amazon.it", "https://www.amazon.co.jp", "https://www.amazon.in", "https://www.amazon.cn", "https://www.amazon.com.sg", "https://www.amazon.com.mx", "https://www.amazon.ae", "https://www.amazon.com.br", "https://www.amazon.nl", "https://www.amazon.com.au", "https://www.amazon.com.tr", "https://www.amazon.sa", "https://www.amazon.se", "https://www.amazon.pl" ] null{ "us": "https://www.amazon.com", "uk": "https://www.amazon.co.uk", "ca": "https://www.amazon.ca", "de": "https://www.amazon.de", "es": "https://www.amazon.es", "fr": "https://www.amazon.fr", "it": "https://www.amazon.it", "jp": "https://www.amazon.co.jp", "in": "https://www.amazon.in", "cn": "https://www.amazon.cn", "sg": "https://www.amazon.com.sg", "mx": "https://www.amazon.com.mx", "ae": "https://www.amazon.ae", "br": "https://www.amazon.com.br", "nl": "https://www.amazon.nl", "au": "https://www.amazon.com.au", "tr": "https://www.amazon.com.tr", "sa": "https://www.amazon.sa", "se": "https://www.amazon.se", "pl": "https://www.amazon.pl" }
I forgot where I got the list of amazon domains from, it is shorter than the list but I think I got it when researching that list.
Links
Queries
- [Wayback/Archive] jsonpath query online at DuckDuckGo This started my quest.
- [Wayback/Archive] jsonpath for key value list json at DuckDuckGo
- [Wayback/Archive] “JSON” parser online “click” data and generate “JSONPath” query at DuckDuckGo
- [Wayback/Archive] jsonpath delphi at DuckDuckGo
- [Wayback/Archive] delphi DBXJSON at DuckDuckGo
Documentation and libraries
- [Wayback/Archive] JSONPath – XPath for JSON is where it all started.
- [Wayback/Archive] RFC 9535: JSONPath: Query Expressions for JSON
- [Wayback/Archive] GitHub – nirajp82/jsonpath-cheatsheet: A comprehensive JSONPath cheat sheet with real-world examples. does not mention how to obtain key names.
- [Wayback/Archive] jsonpath – Get keys in JSON – Stack Overflow (thanks [Wayback/Archive] Stefan and [Wayback/Archive] Viktor) taught me the
~trick to get key names:
I found that the tilda
~symbol is able to retrieve the keys of the values it’s called upon. - [Wayback/Archive] 4 JSONPath functionality in Zabbix documents
~:
Matched element names can be extracted by adding a tilde (~) suffix to the JSONPath. It returns the name of the matched object or an index in string format of the matched array item.
Via: [Wayback/Archive] Can I get the keys of an array from a JSON with JSONPath? : zabbix
- [Wayback/Archive] JSONPath Comparison table is maintained at
[Wayback/Archive] GitHub – cburgmer/json-path-comparison: Comparison of the different implementations of JSONPath and language agnostic test suite. and centered around[Wayback/Archive] json-path-comparison/regression_suite/regression_suite.yaml at master · cburgmer/json-path-comparison · GitHub (raw file [Wayback/Archive] regression_suite.yaml) which is generated from theFurthermore, the repository has these interesting documentation files:
- [Wayback/Archive] json-path-comparison/INTERESTING_QUERIES at master · cburgmer/json-path-comparison · GitHub (raw file [Wayback/Archive] INTERESTING_QUERIES)
- [Wayback/Archive] json-path-comparison/OPEN_QUESTIONS.md at master · cburgmer/json-path-comparison · GitHub (raw file [Wayback/Archive] OPEN_QUESTIONS.md)
- [Wayback/Archive] json-path-comparison/TODO at master · cburgmer/json-path-comparison · GitHub (raw file [Wayback/Archive] TODO)
One library missing from tie comparison table is the built-in JSON support in Delphi. Hopefully someone makes that result available and automates it into the table.
-
[Wayback/Archive] GitHub – JSONPath-Plus/JSONPath: A fork of JSONPath from http://goessner.net/articles/JsonPath/
implements the
~functionality in [Wayback/Archive] JSONPath/src/jsonpath.js at main · JSONPath-Plus/JSONPath · GitHub (RAW source code file [Wayback/Archive] jsonpath.js) using this construct:} else if (loc === '~') { // property name retObj = { path: push(path, loc), value: parentPropName, parent, parentProperty: null }; this._handleCallback(retObj, callback, 'property'); return retObj; -
[Wayback/Archive] GitHub – pacifica/python-jsonpath2: A JSONPath implementation for Python (but better than jsonpath). with documentation at
[Wayback/Archive] Example Usage — JSONPath2 Library documentation
Note I’m not sure if this supports the~, but it looks like it supports.keys()instead. - [Wayback/Archive] GitHub – json-path/JsonPath: Java JsonPath implementation supports
.keys()instead of~. - [Wayback/Archive] GitHub – mariocasciaro/object-path: A tiny JavaScript utility to access deep properties using a path (for Node and the Browser) is a different (and more limited) notation for searches called “object path” which I found via JSONPath and object-path online evaluator below which pointed to [Wayback/Archive] object-path – npm.
Sites/pages/tools
- [Wayback/Archive] JSON Path Finder allows you to click a node and get the JSONPath expression for it
- [Wayback/Archive] JSONPath and object-path online evaluator allows you to enter a JSONPath query, JSON data and presents the query results. It supports
~. - [Wayback/Archive] JSONPath Online Evaluator is open source at [Wayback/Archive] GitHub – ashphy/jsonpath-online-evaluator: JSONPath Online Evaluator, but does not support
~usually giving this error:SyntaxError: Expected ".", "..", "[", [\t-\n\r ], or end of input but "~" found.. - [Wayback/Archive] JSON Query Builder – Create Complex JSON Queries | Tools for Human does not support the JSONPath syntax (but somehow did turn up high in the search results)
- [Wayback/Archive] JSON Path Finder & Evaluator Online does not support the
~syntax, has some quirks, but *does* support clicking on an element in the JSON tree getting the JSONPath for that item (sans keys) - [Wayback/Archive] Convert JSON to Swift, C#, TypeScript, Objective-C, Go, Java, C++ and more • quicktype also misses Delphi support, but that should be straightforward to add as the TypeScript source code is open source at [Wayback/Archive] GitHub – glideapps/quicktype: Generate types and converters from JSON, Schema, and GraphQL and the C# implementation and and tests are at:
- [Wayback/Archive] quicktype/packages/quicktype-core/src/language/CSharp at master · glideapps/quicktype · GitHub
- [Wayback/Archive] quicktype/packages/quicktype-core/src/language/CSharp/CSharpRenderer.ts at master · glideapps/quicktype · GitHub (raw file [Wayback/Archive] CSharpRenderer.ts)
- [Wayback/Archive] quicktype/packages/quicktype-core/src/language/CSharp/NewtonSoftCSharpRenderer.ts at master · glideapps/quicktype · GitHub (raw file [Wayback/Archive] NewtonSoftCSharpRenderer.ts)
- [Wayback/Archive] quicktype/packages/quicktype-core/src/language/CSharp/SystemTextJsonCSharpRenderer.ts at master · glideapps/quicktype · GitHub (raw file [Wayback/Archive] SystemTextJsonCSharpRenderer.ts)
- [Wayback/Archive] quicktype/packages/quicktype-core/src/language/CSharp/index.ts at master · glideapps/quicktype · GitHub (raw file [Wayback/Archive] index.ts)
- [Wayback/Archive] quicktype/packages/quicktype-core/src/language/CSharp/language.ts at master · glideapps/quicktype · GitHub (raw file [Wayback/Archive] language.ts)
- [Wayback/Archive] quicktype/packages/quicktype-core/src/language/CSharp/constants.ts at master · glideapps/quicktype · GitHub (raw file [Wayback/Archive] constants.ts)
- [Wayback/Archive] quicktype/packages/quicktype-core/src/language/CSharp/utils.ts at master · glideapps/quicktype · GitHub (raw file [Wayback/Archive] utils.ts )
- [Wayback/Archive] quicktype/test/fixtures/csharp-SystemTextJson at master · glideapps/quicktype · GitHub
- [Wayback/Archive] quicktype/test/fixtures/csharp at master · glideapps/quicktype · GitHub
Delphi discussion: [Wayback/Archive] Adding Delphi support · glideapps/quicktype · Discussion #2852 · GitHub
- [Wayback/Archive] quicktype/packages/quicktype-core/src/language/CSharp at master · glideapps/quicktype · GitHub
Note that Delphi uses a query syntax that differs from JSONPath, despite they named their class TJSONPathParser, see [Wayback/Archive] System.JSON.TJSONPathParser – RAD Studio API Documentation
Supported JSON Path Syntax
TJSONPathParser implements a subset of the JSON path specification defined by Stefan Göessner. Specifically, supported elements are:
- Child operators for objects:
- Use
.to access object properties that do not contain a dot in their name. For example, useroot.childto access thechildproperty of therootobject.- Use
[]to access object properties that do contain a quoting character in their name. For example, useroot['child.name']orroot["child.name"]to access thechild.nameproperty of therootobject.- Subscript operator (
[]) for arrays. For example, useroot[0]to access the first item of therootarray.These operators do not support special expressions, they only support actual values (object properties or array indexes).
This is one of the many examples where the libraries introduced by the Delphi team after Delphi 2007 are just tick off product boxes: they indeed ticked the boxes, but after that are hardly maintained (if at all) and largely lack in features and quality.
Luckily, for Delhi there are a few alternatives. See these links:
- [Wayback/Archive] Trouble getting JSON FindValue (JSONPath) to work – Network, Cloud and Web – Delphi-PRAXiS [en] (thanks [Wayback/Archive] omnibrain and [Wayback/Archive] Der schöne Günther)
Q
My Code after stripping away everything else:var myjson:=TJSONObject.ParseJSONValue('{"name": "Chris","value": 10000}'); var myval:=myjson.FindValue('$.name'); ergebnis.Text:=myval.Value;The JSON get’s parsed, but the FindValue returns ‘nul’.Am I doing something completely wrong?A
Take at the look at the documentation again, it has some examples. Get Rid of the $ and the dot.program Project1; uses System.SysUtils, System.JSON; begin var myjson:=TJSONObject.ParseJSONValue('{"name": "Chris","value": 10000}'); var myval:=myjson.FindValue('name'); Assert(myVal.Value() = 'Chris'); end. - [Wayback/Archive] System.JSON.TJSONObject.FindValue – RAD Studio API Documentation
…
TJSONPathParser implements a subset of the JSON path specification defined by Stefan Göessner. Specifically, supported elements are:- Child operators for objects:
- Use
.to access object properties that do not contain a dot in their name. For example, useroot.childto access thechildproperty of therootobject. - Use
[]to access object properties that do contain a quoting character in their name. For example, useroot['child.name']orroot["child.name"]to access thechild.nameproperty of therootobject.
- Use
- Subscript operator (
[]) for arrays. For example, useroot[0]to access the first item of therootarray.
These operators do not support special expressions, they only support actual values (object properties or array indexes).…
- Child operators for objects:
- [Wayback/Archive] System.JSON.TJSONPathParser – RAD Studio API Documentation
- [Wayback/Archive] How to parse a JSON string in Delphi? – Stack Overflow (thanks [Wayback/Archive] Salvador for asking) lists some alternatives. In no particular order:
- The built in Delphi JSON parser in the
System.JSONunit (thanks [Wayback/Archive] jaruzafa and [Wayback/Archive] Simoh) - The built in Delphi JSON parser in the
System.DBXJSONunit (thanks [Wayback/Archive] Chau Chee Yang) - The (as of 2024 archived because it was unmaintained) SuperObject library at [Wayback/Archive] GitHub – hgourvest/superobject (thanks [Wayback/Archive] Arioch ‘The)
- The TalJsonDocument class at [Wayback/Archive] GitHub – MagicFoundation/Alcinoe: Alcinoe empowers developers to build fast, modern apps without the usual complexity or performance bottlenecks. It keeps the focus on innovation—not tool constraints—delivering top performance, deep customization, and great cross-platform UX while staying independent of GAFA ecosystems. (thanks [Wayback/Archive] zeus)
Note that personally, I have not trusted “new” library functionality from the Delphi team itself due to prolonged low quality of their code and very long times (if at all) for bug fixes to appear. This includes their JSON support. I prefer 3rd party libraries, of which a few above and more below. Need to check which ones are maintained best.
- The built in Delphi JSON parser in the
- [Wayback/Archive] Query JSON documents with JSONPath – grijjy blog
That is not a “(Java) script operator”.
* JSONPath “$” – the root object / element
* JSONPath “@” – the current object / element
I hope somedays “Grijjy.Bson.Path” will have full JSONPath support.
Because for now it is much closer than all others…The code is in the hardly maintained [Wayback/Archive] GitHub – grijjy/GrijjyFoundation: Foundation classes used by other Grijjy repositories with no progress on the JSONPath implementation at all. If you want to look at the source it is at
[Wayback/Archive] GrijjyFoundation/Grijjy.Bson.Path.pas at master · grijjy/GrijjyFoundation · GitHub (raw file [Wayback/Archive] Grijjy.Bson.Path.pas – yes, BSON is binary JSON)
- [Wayback/Archive] GitHub – neslib/Neslib.Json: Fast and memory-efficient JSON for Delphi despite supporting
$nitation, does not support~.It has also not been maintained for more than 7 years: [Wayback/Archive] Neslib.Json/Neslib.Json.Path.pas at master · neslib/Neslib.Json · GitHub (raw file [Wayback/Archive] Neslib.Json.Path.pas)[Wayback/Archive] Neslib.Json/UnitTests at master · neslib/Neslib.Json · GitHub , which work in an interesting feature: some test data is packed into a .zip file, loaded as a binary resources in the .res file through an .rc script. That logic is in methods
LoadTestDataandLoadTestStringof [Wayback/Archive] Neslib.Json/UnitTests/TestUtils.pas at master · neslib/Neslib.Json · GitHub (raw file [Wayback/Archive] TestUtils.pas) with at the core:GTestDataStream := TResourceStream.Create(HInstance, 'JSON_TEST_DATA', RT_RCDATA);
GTestDataZipFile := TZipFile.Create;
GTestDataZipFile.Open(GTestDataStream, TZipMode.zmRead);The main usage is by the method
TestJsonData.TestJsonFilein [Wayback/Archive] Neslib.Json/UnitTests/Tests/Tests.Neslib.Json.IO.pas at master · neslib/Neslib.Json · GitHub (raw file [Wayback/Archive] Tests.Neslib.Json.IO.pas)That file mentions the source is at the repository [Wayback/Archive] GitHub – open-source-parsers/jsoncpp: A C++ library for interacting with JSON. where the content of the .zip file was actually obtained from the subdirectory [WaybackSae/Archive] jsoncpp/test/data at master · open-source-parsers/jsoncpp · GitHub of [Wayback/Archive] jsoncpp/test at master · open-source-parsers/jsoncpp · GitHub.The JSONPath tests does not use the .zip file as all tests are in the subdirectory [Wayback/Archive] Neslib.Json/UnitTests/Tests at master · neslib/Neslib.Json · GitHub containing the file [Wayback/Archive] Neslib.Json/UnitTests/Tests/Tests.Neslib.Json.Path.pas at master · neslib/Neslib.Json · GitHub (raw file [Wayback/Archive] Archive) and do not use the .zip file.
- [Wayback/Archive] New sample for JSON performance: mORMot vs SuperObject/XSuperObject/dwsJSON/DBXJSON – Synopse Open Source
My need
- [Wayback/Archive] JSON voor NN Beleggingskeuzewijzigen per product https://www.nn.nl/mijn.nn/Wijzigen-levensverzekeringen/Beleggingskeuze-wijzigen.htm · GitHub
JSON voor NN Beleggingskeuzewijzigen per product https://www.nn.nl/mijn.nn/Wijzigen-levensverzekeringen/Beleggingskeuze-wijzigen.htm
- [Wayback/Archive] inlegkeuze.Premie-Beleggingsverzekering.json
- [Wayback/Archive] inlegkeuze.Koopsom-Beleggingsverzekering.json
- [Wayback/Archive] inlegkeuze.events[0].changes.changes[4].model.domain.Premie-Beleggingsverzekering.json
- [Wayback/Archive] inlegkeuze.events[0].changes.changes[8].model.domain.Koopsom-Beleggingsverzekering.json






Leave a comment