New Admins: Register for our new Pure Lecture Series!
Pure's logos
Pure Help Center for Pure Administrators

If you are a researcher, or other non-admin at your institution, click here.

  • Home
  • Announcements
  • Release Notes
  • Technical user guides
  • Training
  • Events
  • Support
  • Contact Us
  • Home
  • Training
  • Technical user guides
  • Pure API

How Can We Help?

Search Results

Filter By Category

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Contact us

Pure API: MetricsPure API: Metrics

The Pure API allows you to get information about metrics and fetch metric values associated with individual content items. An endpoint only has metrics related operations when the content type handled by the endpoint supports metrics, such as the /research-outputs endpoint.

Metric collections are used as containers for metric values associated with a content item. To work with data in a metric collection, you first need to determine the id of the metric collection you want to access. You can then request a metric collection for each content item you want metric values from.

Determining what metric collection to access

You can use the /allowed-metric-collections operation to get information about metric collections available for content managed by the current endpoint in the form of MetricCollectionDefinition objects. A metric collection definition contains information about a set of related metrics. A metric collection definition is identified by a globally unique id and it contains a number of MetricDefinition objects, each describing the structure of a specific metric. A metric definition can be identified by an id that is unique across its owning metric collection definition. A metric definition's valueType informs about the type of value supported. A metric definition that has 'integer' as its valueType is referred to as an "integer-based metric".

Types available are:

  • Boolean
  • Classification
  • Decimal
  • Integer
  • String

From version 5.27.0: Generally, collections consisting solely of integer-based metrics are available.

 

 

 

Request URL:

https://{your Pure hostname}/ws/api/research-outputs/allowed-metric-collections

Response body:

{
  "items": [
    {
      "metrics": [
        {
          "metricId": "downloads",
          "valueType": "INTEGER",
          "name": {
            "en_GB": "Downloads",
          }
        }
      ],
      "collectionId": "downloadStatistics",
      "name": {
        "en_GB": "Download statistics",
      },
      "sourceClassificationScheme": {
        "systemName": "ClassificationScheme",
        "uuid": "69525778-3059-4012-9254-708c337cf801"
      }
    },
    ...
  ]
}

 

You currently only have access to a subset of Pure's metrics using the Pure API and the /allowed-metric-collections operation lets you see which ones.

Fetching a metric collection

You work with metric data of a content item using MetricCollection objects. A metric collection is a container for metric values associated with a content item, with a structure defined by a metric collection definition. You can think of a metric collection as an instance of a metric collection definition, specific to a content item.

You can access metric data of a metric collection from a specific content item using the /metrics/{collection-id} sub-resource of the content item. The collection-id argument specifies the id of the metric collection you want metric values for.

 

Request URL:

https://{your Pure hostname}/ws/api/research-outputs/fd50c80b-6693-486f-82ce-35f164fd6fcc/metrics/downloadStatistics

Response body:

{
  "collectionId": "downloadStatistics",
  "items": [
    {
      "source": {
        "uri": "/dk/atira/pure/source/citation/downloadstatistics",
        ...
      },
      "year": 2021,
      "metricValues": [
        {
          "metricId": "downloads",
          "integerValue": 42
        }
      ]
    },
    {
      "source": {
        "uri": "/dk/atira/pure/source/citation/downloadstatistics",
         ...
       },
      "year": 2022,
      "metricValues": [
        {
          "metricId": "downloads",
          "integerValue": 12
        }
      ]
    }
  ]
}

 

A set of metric values for each of the metrics supported by the collection can be uniquely identified by a combination of its source, category, and year; multiple values for the same metric are possible as long as each value is for a distinct combination. As you see in the "metric collection where metric values are identified by 'source' and 'year'" sample request, where metric values are not identified by a category, a metric collection may not specify one or more of the source, category, and year fields.

You will get an empty metric collection when a content item does not have metric values for a requested metric collection id.

 

Request URL:

https://{your Pure hostname}/ws/api/research-outputs/fd50c80b-6693-486f-82ce-35f164fd6fcc/metrics/plumXMentions

Response body:

{
  "collectionId": "plumXMentions",
  "items": []
}

 

 

Published at December 12, 2024

Download
Table of Contents
  1. Determining what metric collection to access
  2. Fetching a metric collection
Related Articles
  • Authorization
  • Pure API Roadmap / Resource catalog
  • Pure API: Working with files
  • Pure API: Users and roles
Keywords
  • metrics
  • pure api

Was this article helpful?

Yes
No
Give feedback about this article

    About Pure

  • Announcements

    Additional Support

  • Events
  • Client Community
  • Training

    Need Help?

  • Contact Us
  • Submit a Support Case
  • My Cases
  • Linkedin
  • Twitter
  • Facebook
  • Youtube
Elsevier logo Relx logo

Copyright © 2025 Elsevier, except certain content provided by third parties.

  • Terms & Conditions Terms & Conditions
  • Privacy policyPrivacy policy
  • AccesibilityAccesibility
  • Cookie SettingsCookie Settings
  • Log in to Pure Help CenterLog in to Helpjuice Center

Knowledge Base Software powered by Helpjuice

Expand