API v2

The API can be accessed at /api/v2 and supports JSON and XML as output format. The XML is generated from the JSON using the bijective XPath 3.1 transformation json-to-xml. If an end point also supports HTML output, the HTML is generated from the XML using the same XSLT transformations as in the main web search interface.

Contents

Common parameters for all end points

Get arguments

GET /api/v2/arguments Uses the same parameters as the usual args.me search.html: for example, /search.html?query=art&pageLayout=pro-con corresponds to /api/v2/arguments?query=art&pageLayout=pro-con. Supports JSON, XML, and HTML as output format.

Response

{
  "query": {
    "text":"text",
    "properties":{
      "key":"value", ...
    },
    "start":"timestamp"
  },
  "arguments":[
    {
      "id":"id",
      "conclusion":"text",
      "premises":[
        {
          "text":"text",
          "stance":"stance-towards-conclusion: PRO or CON",
          "annotations":[
            {
              "type":"java-class",
              "start":"character-offset",
              "end":"character-offset",
              "source":"java-class, url, or other identifier"
            }, ...
          ]
        }, ...
      ],
      "context":{
        "key":"value", ...
      },
      "summary":"text",
      "explanation":{
        "score":score,
        "name":score-name,
        "details":[
          { explanation }, ...
        ]
      },
      "stance":"stance-towards-query: PRO or CON"
    }, ...
  ],
  "totalSize":number-of-matching-arguments-in-index,
  "resultsBefore":number-of-arguments-on-previous-pages,
  "retrievalTimeInMilliseconds":milliseconds-between-query-parsing-and-result-presentation
}

Get argument

GET /api/v2/arguments/id

This end point offers no additional parameters. Supports JSON and XML as output format.

Response

{
  "id":"id",
  "conclusion":"text",
  "premises":[
    {
      "text":"text",
      "stance":"stance-towards-conclusion: PRO or CON",
      "annotations":[
        {
          "type":"java-class",
          "start":"character-offset",
          "end":"character-offset"
        }, ...
      ]
    }, ...
  ],
  "context":{
    "key":"value", ...
  }
}

Get aspect space

GET /api/v2/aspectSpace

The same parameters as for GET /api/v2/arguments apply. The aspect space is created from the arguments that are retrieved using these parameters. In addition, the following parameters are available to modify the way the aspect space is created. Supports JSON and XML as output format.

Response

{
  "dimensions":[
    {
      "aspects":["name", ...],
      "weight":normalized-sum-of-weights-from-arguments,
      "index":non-negative-integer,
      "cartesianX":X-coordinate-of-this-dimension-in-an-cartesian-system in [-1;1],
      "cartesianY":Y-coordinate-of-this-dimension-in-an-cartesian-system in [-1;1]
    }, ...
  ],
  "ignoredAspects":[ "aspects-ignored-due-to-query-terms", ... ]
}

Get pro/con counts

GET /api/v2/counts Uses the same parameters as get arguments. Supports JSON and XML as output format.

Response

{
  "byFilter":{
    "context-key1":{
      "context-value1":{
        "pro":"amount",
        "con":"amount",
      }, ...
    }, ...
  },
  "total":{
    "pro":"amount",
    "con":"amount",
  }
}
Back to main page