This document focuses on the Similar API within the recommendation module. This API is designed to suggest products that are similar to a particular item in terms of features, design, category, or price range. By analyzing product attributes, customer reviews, and other relevant data, the Similar API helps customers discover alternative options that closely match their interests or preferences.

Consider a customer interested in a specific brand of running shoes, but either the size they need is out of stock, or they are looking for similar styles with different features or at a different price point. When viewing the product details, the Similar Products API can recommend alternative running shoes that share similar characteristics, such as cushioning technology, design, and purpose (e.g., for trail running or road running), either of the same brand or different brands. This capability ensures that customers have relevant choices, increasing the likelihood of finding a suitable product without having to manually search.

Compare to other Personalization API features:

  • Complements
    The Complements suggests products that enhance the look, appearance, and usability or are necessary for the primary product (like accessories for electronics). It focuses on compatibility rather than similarity. In contrast, the Similar recommends products that are alike, providing alternatives for direct comparison.

  • Bought Together
    While the Bought Together reveals items frequently purchased together with the primary product based on historical purchases, the Similar focuses solely on recommending products similar in features.

  • New Arrival and Random
    These introduce customers to the latest products or a random selection of items without specific criteria for similarity. The Similar, however, - curates recommendations based on the similarity to a product of interest.

The request outlined below demonstrates how to use the Similar API in AfterShip Personalization. Set the type parameter to SIMILAR to retrieve product recommendations similar to a specific item. Based on the aforementioned example, it will suggest alternative running shoes based on shared characteristics such as cushioning technology, design, and purpose. The request body includes the following parameters:

  • type: Set this to SIMILAR to specify that the API should provide similar product recommendations.

  • session_id: Represents the unique identifier for the user session.

  • limit: Determines the maximum number of products to be returned in the response. In this example, the limit is set to 5.

  • products: An array containing the details of the product for which similar recommendations are required. Each product includes an id, source_id, and variants (along with their corresponding source_id). Typical use cases include passing the main product id on the product page or passing cart line items on the cart page/checkout page.

Sample Request

preparing...

The response to this request will contain a list of product recommendations similar to the provided item, including their IDs, source_ids, and variants (along with their corresponding source_id).

Sample Response

preparing...