Skip to content

Recommendations

Get Recommendations

GET /api/recommendations

Returns a list of recommended products for a given context.

Query Parameters

ParameterTypeRequiredDescription
productIdstringConditionalShopify product ID. Required for product-based strategies.
collectionIdstringConditionalShopify collection ID. Required for collection strategies.
customerIdstringNoShopify customer ID for personalized recommendations.
strategystringNoRecommendation strategy (see below). Defaults to auto-select.
limitnumberNoNumber of products to return (default: 8, max: 24).
excludestringNoComma-separated product IDs to exclude from results.

Strategies

StrategyDescriptionRequired Context
bought-togetherProducts frequently purchased togetherproductId
similarProducts similar by attributes and behaviorproductId
trendingCurrently trending products in the storeNone
personalizedPersonalized to the shopper’s historycustomerId
collection-popularPopular products in a collectioncollectionId
recently-viewedBased on the shopper’s recent browsingcustomerId

Response

{
"products": [
{
"id": "gid://shopify/Product/123456",
"title": "Classic Leather Wallet",
"handle": "classic-leather-wallet",
"image": "https://cdn.shopify.com/...",
"price": "49.99",
"compareAtPrice": "59.99",
"vendor": "LeatherCo",
"score": 0.92,
"strategy": "bought-together"
}
],
"meta": {
"strategy": "bought-together",
"modelLevel": 2,
"count": 8
}
}

Example

Terminal window
curl -H "Authorization: Bearer your-api-key" \
"https://your-store.myshopify.com/apps/simplersuite-recommendations/api/recommendations?productId=123456&strategy=bought-together&limit=4"