Frequency

The Frequency endpoint allows viewing analytics of total sessions vs unique sessions with a given interval (hour, day, month, year). This end point allows frequency analytics to be viewed for Apps, Stories, Pathways OR Streams.

Available Frequency Endpoints

v1/analytics/frequency/apps Get frequency analytics for an app or a list of apps.

v1/analytics/frequency/pathways Get frequency analytics for a pathways or a list of pathways.

v1/analytics/frequency/streams Get frequency analytics for a stream or a list of streams.

v1/analytics/frequency/stories Get frequency analytics for a story or a list of stories.

Parameters

The items parameter allows you to filter items based on the name or ID of the item. If the item parameter is not provided the endpoint will return the latest 10 items.

Key

Value

items

Array of Strings Item name or ID

Interval

String day, hour, month, year defaults to month.

steps

Int Number of steps to use between 1 - 24

Examples

Get App's Frequency For 7 Days

The example below retrieves a single app with an interval set to "day" and the steps "7". This will give a frequency result for 7 days.

curl -X POST \
  v1/analytics/frequency/apps \
  -H 'Authorization: Basic <Your Base64 Encoded Token>'\
  -d '{
    "items" : ["Learning App"],
    "interval" : "day",
    "steps" : 7
  }'

Get Frequency For 12 Months

The example below retrieves the latest 10 stories with an interval set to "month" and the steps set to "12". This will give a frequency of 12 months for each item.

curl -X POST \
  v1/analytics/frequency/stories \
  -H 'Authorization: Basic <Your Base64 Encoded Token>'\
  -d '{
    "interval" : "month",
    "steps" : 12
  }'

Success Response

Whichever frequency endpoint you are using a successful response will return an array of items with each item containing a context item (app, pathway, stream or story) and corresponding frequency data. The example below shows a successful response when using the frequency/apps endpoint.

{
    "status": "success",
    "data": [
        {
            "app": {
                "name": "Falkor",
                "version": "2.10.1",
                "type": "app",
                "ID": "io.falkor.demo"
            },
            "frequency": [
                {
                    "interval": "month",
                    "range": [
                        "2021-12-01T00:00:00+02:00",
                        "2021-12-31T23:59:59+02:00"
                    ],
                    "sessions": 12,
                    "unique": 1
                },
                {
                    "interval": "month",
                    "range": [
                        "2022-01-01T00:00:00+02:00",
                        "2022-01-31T23:59:59+02:00"
                    ],
                    "sessions": 17,
                    "unique": 13
                },
                ..etc
            ]
        },
        ...etc
    ],
    "hash": "7ed75a2f94c199e29c5d55faa9e81858",
    "response_time": 0.18564820289611816
}

Last updated