v1

latestOpenAPI 3.1.02026-08-041911887.3 KB
Content Metrics

Metrics API for aggregated analytics

Metrics

The Metrics API provides at-a-glance analytics over all our news & regulatory content. It allows users to monitor, visualise and understand news coverage over time, and enables direct integration with Business Intelligence & data visualisation tools

The /metrics endpoint supports the same expressive query language as our /search endpoint, but rather than returning metadata for each individual piece of content, provides aggregated metrics over the results which can be sliced and diced along multiple dimensions: date, publication source, publication country, topics, entities, sentiment, etc.. The limits for these parameters are the same as on the /search endpoint (i.e. at most 200 entities, 100 topics...). The exact numbers for each field are detailed in the schema below.

Example questions the Metrics API can answer in 1 API request / response:

  • How is the coverage (number of articles) and sentiment (negative, neutral and positive coverage) towards my suppliers changing…
    • …over time?
    • …and / or in relation to a set of key ESG topics?
    • …and / or by country of publication?
  • How does overall sentiment towards companies in my portfolio vary by country?
  • What are the top publications (by volume) covering the topics of Cleantech and Sustainable Investments?

⚠️  Metrics requests are limited to a maximum number of 10,000 aggregation groups

If the number of groups resulting from a query exceeds that limit, the API will return an HTTP 400 response (Bad Request). We would recommend in such instance to break down the metrics query into multiple queries and combine the results. For instance, in order to get daily coverage metrics for 100 entities over 12 months (100 entities X 365 days = 36,500 aggregation groups), you could achieve this with either:

  • 4 requests for groups of 25 entities (25 entities X 365 days = 9,125 groups per request)
  • 12 monthly requests for 100 entities (100 entities X 31 days = 3,100 groups per request)

ℹ️  For better performance, use the where field to select only relevant documents

Before computing the aggregated metrics, the where field is used to reduce the number of documents the system has to process. The more precise the subset of documents is, the faster the results will be computed.

ℹ️  Weekly Aggregation

The date associated with each aggregation bucket in the results will be the date of the first day of that week, so if you query from 2021-01-01 (which was a Friday), the date associated with the first bucket would be 2020-12-28 which was the Monday of the same week.

post/metrics

Request body

Example request

{
  "where": {
    "story-id": {
      "eq": "bcd2d868-ed38-4382-b94a-622a30fc3215"
    },
    "entities": {
      "id": {
        "eq": "bcd2d868-ed38-4382-b94a-622a30fc3215"
      }
    },
    "published-at": {
      "gt": "2023-01-01",
      "gte": "2023-01-01",
      "lt": "2023-01-01",
      "lte": "2023-01-01"
    },
    "source": {
      "id": {
        "eq": "bcd2d868-ed38-4382-b94a-622a30fc3215"
      }
    },
    "topics": {
      "id": {
        "eq": "bcd2d868-ed38-4382-b94a-622a30fc3215"
      }
    },
    "categories": {
      "id": {
        "eq": "bcd2d868-ed38-4382-b94a-622a30fc3215"
      }
    }
  },
  "exclude": {
    "entities": {
      "id": {
        "any": [
          "bcd2d868-ed38-4382-b94a-622a30fc3215"
        ]
      }
    },
    "topics": {
      "id": {
        "any": [
          "bcd2d868-ed38-4382-b94a-622a30fc3215"
        ]
      }
    },
    "source": {
      "id": {
        "any": [
          "bcd2d868-ed38-4382-b94a-622a30fc3215"
        ]
      }
    }
  },
  "aggregations": {
    "options": {
      "topic": {
        "include": [
          "bcd2d868-ed38-4382-b94a-622a30fc3215"
        ]
      },
      "iptc-media-topic": {
        "include": [
          "bcd2d868-ed38-4382-b94a-622a30fc3215"
        ]
      },
      "entity": {
        "include": [
          "bcd2d868-ed38-4382-b94a-622a30fc3215"
        ]
      },
      "source": {
        "include": [
          "bcd2d868-ed38-4382-b94a-622a30fc3215"
        ]
      }
    }
  }
}

Response

Returns aggregate metrics for documents matching the search query

aggregationsAggregation[] required