Empathy Stats API V2 - Reports - Categories

This report calculates the top categories in the system for the selected date range.

Report ID: TopCategories

Input parameters (see common parameters)

Parameter nameTypeRequiredDescriptionDefault Value
offsetint(error)The number of results to omit (from the start of the result set)0
rowsint(error)Number of results to return50
evolbool(error)Calculate the evolution of certain fields in the responseFalse
termsstr(error)Retrieve only categories with this terms in themNone
levelslist[int](error)Levels of depth within the breadcrumb admittedNone
parent_idslist[str](error)IDs of the immediate parent of each categoryNone
successbool(error)Order results by successCountFalse
browsingbool(error)Toggle between search data (False) and browse data (True)False

'browsing' param

For customers that are tagging navigation (aka browse) events setting this field to True toggles the report to browsing mode: the categories include a "views_data" field and all fields refers to browsing data.

'terms' param

This param is used to trigger the TOP 'n' categories which contain, among its words, the ones specified in this array.

'levels' param

According to the actual implementation, levels refer to the category position in a given breadcrumb (i.e. '[Man > Pants], 'Pants' in this case has a level 2). When a certain level or levels are specified within the request, only those meeting the criteria are shown (not those before 'n-level' or after 'n-level').

'parent_ids' param

Return only those categories which immediate predecessor category is among this IDs.

'success' param

By default, results are prompt ordered by amount of clicks. You can, however, set the sorting to be regarding the number of success clicks.

Responses

200 - successful information retrieve

Type: application/json
Example application/json (group = false)
{
    "data": [
        {
            "query_count": 0,
            "click_count": 717,
            "wishlist_count": 0,
            "add2cart_count": 0,
            "conversion_count": 0,
            "success_count": 717,
            "category_name": "cat1",
            "category_id": "42",
            "level": 1,
            "breadcrumb": [
                "cat1"
            ]
        },
        {
            "query_count": 0,
            "click_count": 669,
            "wishlist_count": 0,
            "add2cart_count": 0,
            "conversion_count": 0,
            "success_count": 669,
            "category_name": "cat2",
            "category_id": "39",
            "level": 1,
            "breadcrumb": [
                "cat2"
            ]
        },
        {
            "query_count": 0,
            "click_count": 601,
            "wishlist_count": 0,
            "add2cart_count": 0,
            "conversion_count": 0,
            "success_count": 601,
            "category_name": "cat3",
            "category_id": "63",
            "level": 1,
            "breadcrumb": [
                "cat3"
            ]
        },
        {
            "query_count": 0,
            "click_count": 540,
            "wishlist_count": 0,
            "add2cart_count": 0,
            "conversion_count": 0,
            "success_count": 540,
            "category_name": "cat4",
            "category_id": "61",
            "level": 1,
            "breadcrumb": [
                "cat4"
            ]
        },
        {
            "query_count": 0,
            "click_count": 538,
            "wishlist_count": 0,
            "add2cart_count": 0,
            "conversion_count": 0,
            "success_count": 538,
            "category_name": "cat5",
            "category_id": "59",
            "level": 1,
            "breadcrumb": [
                "cat5"
            ]
        },
        {
            "query_count": 0,
            "click_count": 406,
            "wishlist_count": 0,
            "add2cart_count": 0,
            "conversion_count": 0,
            "success_count": 406,
            "category_name": "cat6",
            "category_id": "44",
            "level": 1,
            "breadcrumb": [
                "cat6"
            ]
        },
        {
            "query_count": 0,
            "click_count": 400,
            "wishlist_count": 0,
            "add2cart_count": 0,
            "conversion_count": 0,
            "success_count": 400,
            "category_name": "cat7",
            "category_id": "41",
            "level": 1,
            "breadcrumb": [
                "cat7"
            ]
        },
        {
            "query_count": 0,
            "click_count": 399,
            "wishlist_count": 0,
            "add2cart_count": 0,
            "conversion_count": 0,
            "success_count": 399,
            "category_name": "cat8",
            "category_id": "58",
            "level": 1,
            "breadcrumb": [
                "cat8"
            ]
        },
        {
            "query_count": 0,
            "click_count": 374,
            "wishlist_count": 0,
            "add2cart_count": 0,
            "conversion_count": 0,
            "success_count": 374,
            "category_name": "cat9",
            "category_id": "48",
            "level": 1,
            "breadcrumb": [
                "cat9"
            ]
        },
        {
            "query_count": 0,
            "click_count": 361,
            "wishlist_count": 0,
            "add2cart_count": 0,
            "conversion_count": 0,
            "success_count": 361,
            "category_name": "cat10",
            "category_id": "40",
            "level": 1,
            "breadcrumb": [
                "cat10"
            ]
        }
    ],
    "params": {
        "site_id": "sample",
        "start_date": 1541548800000,
        "end_date": 1541980800000,
        "filters": [],
        "offset": 0,
        "rows": 10,
        "evol": false,
        "terms": null,
        "levels": [],
        "parent_ids": [],
        "success_sort": false
    }
}