Time series

Get metric values for a single content item over a date range.

Changed on

Returns an array of values for each metric. Each item represents a metric value at a single point in time.

get/metrics/{base_path}/time-series

Request

  • Base URL
    https://content-data-api.publishing.service.gov.uk/api/v1
  • URL
    https://content-data-api.publishing.service.gov.uk/api/v1/metrics/{base_path}/time-series
  • Auth
    HTTP bearer

Path parameters

base_pathstring required
Example:/vat-rates

A GOV.UK base path. A reserved URL on www.gov.uk that is associated with a content item.

metricsstring required
Example:pviews

The names of metrics.

Query parameters

fromstring required
Example:2018-01-01

From date in the format 'YYYY-MM-DD'. Only data collected on or after this date will be returned.

tostring required
Example:2018-01-01

To date in the format 'YYYY-MM-DD'. Only data collected on or before this date will be returned.

Response

Success response

TimeSeriesResponse required

An object where each key is a metric ID and each value is a time series.

Changes

    • breaking

      the // response's property type changed from date to string for status

    • info

      for the query request parameter from, the type was generalized from date to string

    • info

      for the query request parameter to, the type was generalized from date to string

    • info

      endpoint added