Skip to main content
GET
/
retention
/
addiction
Query Frequency Report
curl --request GET \
  --url https://{regionAndDomain}.com/api/query/retention/addiction \
  --header 'Authorization: Basic <encoded-value>'
{
  "data": {
    "2012-01-01": [
      305,
      107,
      60,
      41,
      32,
      20,
      12,
      7,
      4,
      3,
      3,
      3,
      2,
      2,
      2,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1
    ],
    "2012-01-02": [
      495,
      204,
      117,
      77,
      53,
      36,
      26,
      20,
      12,
      7,
      4,
      3,
      3,
      1,
      1,
      1,
      1,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ]
  }
}
Get data about how frequently users are performing events. Let’s breakdown an example response. If you specify day as “unit” and hour as “addiction_unit”, you will get a response that looks like this:
{
  "2012-01-01": [
    305, 107, 60, 41, 32, 20, 12, 7, 4, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1,
    1, 1
  ],
  "2012-01-02": [
    495, 204, 117, 77, 53, 36, 26, 20, 12, 7, 4, 3, 3, 1, 1, 1, 1, 0, 0, 0, 0,
    0, 0, 0
  ],
  "2012-01-03": [
    671, 324, 176, 122, 81, 63, 48, 31, 21, 14, 9, 5, 3, 1, 1, 1, 0, 0, 0, 0, 0,
    0, 0, 0
  ]
}
One day’s worth of data is shown for each date, split into hours. On 2012-01-02, 495 users did the event Viewed report during at least 1 hour out of the next 24 hour period (the period specified by unit). 204 users did the event during at least 2 hours. 117 users did the event during at least 3 hours. The Query API has a rate limit of 60 queries per hour and a maximum of 5 concurrent queries.

Authorizations

Authorization
string
header
required

Service Account

Query Parameters

project_id
integer
required

Required if using service account to authenticate request.

workspace_id
integer

The id of the workspace if applicable.

from_date
string
required

The date in yyyy-mm-dd format to begin querying from. This date is inclusive.

to_date
string
required

The date in yyyy-mm-dd format to query to. This date is inclusive.

unit
enum<string>
required

The overall time period to return frequency of actions for can be "day", "week", or "month".

Available options:
day,
week,
month
addiction_unit
enum<string>
required

The granularity to return frequency of actions at can be "hour" or "day".

Available options:
hour,
day
event
string

The event to generate returning counts for.

where
string

An expression to filter the returning events by. See the expressions section above.

on
string

The property expression to segment the second event on. See the expressions section above.

limit
integer

Return the top limit segmentation values. This parameter does nothing if "on" is not specified.

Response

200 - application/json

Success.

data
object