/statistics

Requests in the Statistics category frequently look similar to the ones in the search category, in that they usually require a query as a paramater. However, they differ in the kind of data they return.

Instead of returning a list of documents that match the query, /statistics queries return analytics and/or statistical metrics for the query.

Table of Contents #

GET /statistics/documentvolume #

Get the number of documents matching a query as a histogram of document volumes over a given time window.

Request

GET /statistics/documentvolume
GET /statistics/documentvolume/{query} 

Parameters

q : The query string to search for.

binSize : The size of the bins in minutes. Defaults to 1440.

startDate : The datetime should be in yyyy-MM-dd [HH:mm:ss] format

endDate : The datetime should be in yyyy-MM-dd [HH:mm:ss] format

splitType (optional) : One of the following split types can be used. If none is selected the manual split type will be used.

Response

A histogram data structure of {Value, Time} pairs, and some metadata for the query.

Example:

{
      "Series": [
         {
            "Query": "United Nations",
            "Label": "United Nations",
            "StartDate": "2013-10-12T00:00:00",
            "EndDate": "2013-10-14T00:00:00",
            "BinSize": 1440,
            "Points": [
                  {
                     "Value": 464,
                     "Time": "2013-10-12T00:00:00Z"
                  },
                  {
                     "Value": 425,
                     "Time": "2013-10-13T00:00:00Z"
                  }
            ],
            "LastUpdated": "0001-01-01T00:00:00"
         }
      ],
      "UniqueDocumentsCount": 849,
      "LastUpdated": "0001-01-01T00:00:00"
}

GET /statistics/documentcount #

Fetches the document count, optionally split into different facets.

Example facets are country of document origin, document type, the publication, etc.

Request

GET /statistics/documentcount

Parameters

q : The query string to search for.

splitType (optional) : One of the following split types can be used. If none is selected the manual split type will be used.

showDuplicates (bool) : Indicate if the count should be distinct or not.

Response

A list of how many documents match the query, faceted by the different splits.

Example: The query https://api.silobreaker.com/statistics/documentCount?q=iphone&splitType=sourceCountry&type=json will produce output similar to:

{
   Facets: [
      {
         Description: "France",
         Amount: 1315
      },
      {
         Description: "United States",
         Amount: 2941
      },
      {
         Description: "Sweden",
         Amount: 923
      }
   ]
}

GET /statistics/relatedentities #

Get the related terms from a query.

DEPRECATION WARNING It is strongly recommended to use the /v1/infocus endpoint. This endpoints is for backwards compatibility.

Request

GET /statistics/relatedentities
GET /statistics/relatedentities/{query}
GET /statistics/relatedentities/{query}/{types}

Parameters

q : The query string to search for.

types (optional) : Filter on the type of entities. Valid types are:

entityTypeLimits (optional) : Filter the maximum number of entities for each type that will be included in the result. This list must have the same length as the list of types.

optimization (optional) : Optimisation can be used by using one of the following keywords:

Response

A list of entities that match the query.

Example: The query statistics/relatedEntities?q=Kiruna&types=Person,Company&entityTypeLimits=2,1&type=json will produce

{
    "Items": [
        {
            "EntityReference": "alexander-linder-11_110328485",
            "Id": "11_110328485",
            "Description": "Alexander Linder",
            "Type": "Person",
            "LocalizedType": "Person",
            "LastUpdated": "0001-01-01T00:00:00"
        },
        {
            "EntityReference": "maria-stenberg-the-social-democratic-party-swe-11_37013862",
            "Id": "11_37013862",
            "Description": "Maria Stenberg (The Social Democratic Party (SWE))",
            "Type": "Person",
            "LocalizedType": "Person",
            "LastUpdated": "0001-01-01T00:00:00"
        },
        {
            "EntityReference": "luossavaarakiirunavaara-ab-11_9766104",
            "Id": "11_9766104",
            "Description": "Luossavaara-Kiirunavaara AB",
            "Type": "Company",
            "LocalizedType": "Company",
            "LastUpdated": "0001-01-01T00:00:00"
        }
    ],
    "LastUpdated": "0001-01-01T00:00:00"
}

GET /statistics/relatedtopics #

Get the topics related to a query.

Request

GET /statistics/relatedTopics
GET /statistics/relatedTopics/{query}

Parameters

q : The query string to search for.

types (optional) : Filter on the type of topics. Commonly used topic types are

entityTypeLimits (optional) : Filter the maximum number of topics of each type that will be included in the result.

optimization (optional) : Optimisation can be used by using one of the following keywords:

Response

A list of topics related to the query.

Example: The query statistics/relatedTopics?q=HSBC&type=json returns

{
    "Items": [
        {
            "Id": "7_6362",
            "Description": "NewsML-4",
            "Type": "Urgency",
            "LocalizedType": "Urgency",
            "LastUpdated": "0001-01-01T00:00:00"
        },
        {
            "Id": "7_6366",
            "Description": "NewsML-5",
            "Type": "Urgency",
            "LocalizedType": "Urgency",
            "LastUpdated": "0001-01-01T00:00:00"
        }
    ],
    "LastUpdated": "0001-01-01T00:00:00"
}

Documentation generated by mdoc.