Purchased Together

Prev Next

The Purchased Together algorithm recommends items by finding complementary products purchased by other users who have also purchased the user's items. It generates recommendations based on products purchased in the same sessions and in the same locale over the past 30 days. After generating recommendations, the Purchased Together algorithm orders the results according to purchase frequency. With the Purchased Together algorithm, you can apply your users' purchase patterns to your strategies. This type of algorithm works best on product and cart pages.

Endpoint

GET https://recommendation.api.useinsider.com/v2/purchased-together    

Visit our Postman collection to test this request.

When this algorithm is used on the cart page, its endpoint differs for multiple products. For example, three products (X, Y, Z) are in the cart. The recommendation API will return the complementary products for each product in the cart as X1, Y1, Z1, X2, Y2, Z2... respectively.

Query Parameters

Parameter

Sample Value

Description

Data Type

Required

partnerName

mybrand

Partner Identifier assigned by Insider One. You can use PartnerID as well.

String

Yes

locale

us_US

Locale of the requested product catalog

String

Yes

platform

web

Requested platform. Web comes by default.

Enum

No

currency

USD

Requested currency of the products. If no value is set, the default currency in your settings is used.

String

No

productId

ABC1234

The ID of the product whose complementary is requested

String

Yes

size

50

Required number of items in response. Valid values are 0 to 100.

Integer

No

categoryList

[“Clothes”, “Skirts”]

Category filter of the products

Array (of string)

No

filter


Smart Recommender filtering. There can be more than one filter parameter.

String

No

details

true

Adds details to the products of the response

Boolean

No

shuffle

false

Shuffles the products of the response

Boolean

No

getGroupProducts

false

Shows variant products under the products of the response

Boolean

No

groupProductsFields


Adds these fields to the variant products’ details

String

No

excludeVariants

true

Exclude variants from the response

Boolean

No

userId

testUser

User identifier which is assigned by Insider One

String

No

hp

true, false, or 0, 1

Makes affinities affect products of the response. The default is false.

Boolean

No

excludeViewDay

30

After how many days viewed products should be excluded. The default is -1.

Integer

No (Can only be used with userId)

excludeViewItem

10

How many viewed products should be excluded. The default is -1.

Integer

No (Can only be used with userId)

Sample Request

The sample below displays a request to Purchased Together, an algorithm that recommends items frequently bought alongside the user’s selected product(s).

https://recommendation.api.useinsider.com/v2/purchased-together?partnerName={PartnerName}&locale={Locale}&productId={ProductId}

Sample Response

{
        "success": true,
        "total": 10,
        "types": {
        "btb": 10
        },
        "data": [
        "QAZ-7890",
        "XYZ-1234",
        "QAZ-7899",
        "XYZ-1233",
        "QAZ-7898",
        "XYZ-1243",
        "QAZ-7891",
        "XYZ-1223",
        "QAZ-7892",
        "XYZ-1342"
        ]
        }

Fallback Algorithms

If the products from Purchased Together are not enough to fill the response data, some fallback algorithms below fill it:

  • View Together

  • Most Purchased of the Category

  • Most Purchased of the Partner