Metrics

Query metrics (POST)

Changed on

Query one or more metrics by posting a JSON array of metric requests. The Metric API provides access to time series data for segments, streams, experiences, and other Lytics resources.

post/metric

Request

  • Base URL
    https://api.lytics.io/v2
  • URL
    https://api.lytics.io/v2/metric
  • Auth
    API key in header Authorization

Query parameters

account_idstring

The account ID. Defaults to the user's default account.

Request body */*

aggregationstring
dimensionstring
dimension_idstring
dimension_typestring
end_datestring
include_empty_rowsboolean
include_sum_of_bucketsboolean
intervalstring
namestring
rangestring
refresh_cacheboolean
round_datesboolean
smoothboolean
start_datestring

Example request

[
  {
    "aggregation": "sum",
    "dimension": "segment",
    "dimension_id": "abc123",
    "dimension_type": "size",
    "end_date": "now",
    "interval": "1d",
    "range": "7d",
    "start_date": "now-7d"
  }
]

Changes