MetricsGet the analytics KPIs

Get the analytics KPIs

Returns the Answer Engine Analytics KPI tiles for a period, each with the previous period's value and the change between them.

Required scope: v2:metrics.

previousValue and changePercent are null when there is nothing to compare with.

curl -X GET "https://api.opttab.com/v1/external/metrics/kpis?period=7d" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
{
  "prompts": {
    "value": 120,
    "previousValue": 110,
    "changePercent": 9.1
  },
  "mentions": {
    "value": 86,
    "previousValue": 80,
    "changePercent": 7.5
  },
  "visibility": {
    "value": 42,
    "previousValue": 40,
    "changePercent": 5
  },
  "sentiment": {
    "value": 71,
    "previousValue": 68,
    "changePercent": 4.4
  },
  "citations": {
    "value": 24,
    "previousValue": 20,
    "changePercent": 20
  },
  "responses": {
    "value": 340,
    "previousValue": 300,
    "changePercent": 13.3
  }
}
GET
/v1/external/metrics/kpis
GET
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token
Bearer Tokenstring
Required

An API key secret from Settings › API. It starts with opt_live_. Send it as Authorization: Bearer opt_live_xxxxxxxx. A session cookie, an X-API-Key header and an ?api_key= query parameter do not authenticate.

An API key secret from Settings › API. It starts with opt_live_. Send it as Authorization: Bearer opt_live_xxxxxxxx. A session cookie, an X-API-Key header and an ?api_key= query parameter do not authenticate.
query
periodstring

The time window: 1d (last day), 7d, 30d, 3m, 6m or 1y. Omitted, the window is the last seven days.

Options: 1d, 7d, 30d, 3m, 6m, 1y
Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token. An API key secret from Settings › API. It starts with opt_live_. Send it as Authorization: Bearer opt_live_xxxxxxxx. A session cookie, an X-API-Key header and an ?api_key= query parameter do not authenticate.

Query Parameters

periodstring

The time window: 1d (last day), 7d, 30d, 3m, 6m or 1y. Omitted, the window is the last seven days.

Allowed values:1d7d30d3m6m1y

Responses

promptsobject
Required
mentionsobject
Required
visibilityobject
Required
sentimentobject
Required
citationsobject
Required
responsesobject
Required