The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,854 other subscribers

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

  1. [Wayback/Archive] jsonpath query online at DuckDuckGo This started my quest.
  2. [Wayback/Archive] jsonpath for key value list json at DuckDuckGo
  3. [Wayback/Archive] “JSON” parser online “click” data and generate “JSONPath” query at DuckDuckGo
  4. [Wayback/Archive] jsonpath delphi at DuckDuckGo
  5. [Wayback/Archive] delphi DBXJSON at DuckDuckGo

Documentation and libraries

Sites/pages/tools

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, use root.child to access the child property of the root object.
    • Use [] to access object properties that do contain a quoting character in their name. For example, use root['child.name'] or root["child.name"] to access the child.name property of the root object.
  • Subscript operator ([]) for arrays. For example, use root[0] to access the first item of the root array.
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:

My need

--jeroen

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.