Recently Viewed

Display recently viewed items to your visitors using this api endpoint.

// Example call (POST)
https://api.zubi.ai/r/product/data?_token=[TRACKER KEY]&uid=[UID]&
cnt=4&mid=default_last_viewed&product_details=true

Endpoint

POST https://api.zubi.ai/r/product/data

Path Parameters

NameTypeDescription

_token*

String

Your tracker key

uid*

String

The user id of the visitor

cnt*

String

Number of products to return, max 10

mid*

String

The model id to use

product_details

String

Set to true to include product details

// Response whitout product details (note that this is returned as float)
{
    "products": [
        1234567.0,
        2345678.0
    ]
}

// Response whit product details
{
    "products": [
        {
            "product_handle": "/my/product/handle",
            "product_id": "123456",
            "product_image": "https://www.example.com/images/image1.jpeg",
            "product_name": "Some product name",
            "product_price": "123.45",
            "product_secondary_image": "https://www.example.com/images/image2.jpeg",
            "product_url": "https://www.example.com/product/product-one?zlt_source=v1"
        }
    ]
}

// Response when empty (requires the model to have no_backfill = True)
{
    "message": "empty"
}

Example:

// Example call (POST)
https://api.zubi.ai/r/product/data?_token=[TRACKER KEY]&uid=[UID]&
cnt=4&mid=default_last_viewed&product_details=true

Get the UID

The uid is stored in a cookie called -zl_udi, extract it and include it in the call.

Last updated