Skip to main content
The RecommendationsService class (accessed via client.recommendations) allows you to integrate AI-driven product suggestions into your storefront to increase discovery and conversion.
Secret Key Required. This service requires a Secret Key (tybrite_sk_live_* / tybrite_sk_test_*). AI inference is computationally expensive and consumes AI recommendation quota — gating to sk prevents abuse from scraped publishable keys. Requests authenticated with a publishable key receive 403 Forbidden.

Methods

getRecommendations

Retrieve curated product suggestions based on various AI models. Use the examples below to see how to implement different recommendation strategies.
Recommendation Types Details: Parameters:
Recommendation results are often cached for high performance. The response includes a fromCache boolean, a computedAt ISO timestamp, and an optional fallbackUsed string indicating if the system had to use a simpler algorithm due to data scarcity.

Marketplace recommendations

When you call this method with a marketplace operator key, recommendations are computed across all merchants in the marketplace rather than a single store. The supported types are the same: trending, new, also-bought, similar, personalized, bundle, and nextnext returns the products shoppers most often go on to view next, aggregated across merchants, and also-bought carries the same complement/alternative distinction. Each returned item is stamped with the merchant it came from via merchant_store_id, so you can link straight to that merchant’s shop page or product:

Cascading Fallback Chain

When a recommendation type cannot produce results (insufficient data, missing embeddings, cold-start product, etc.), Tybrite degrades gracefully to a simpler algorithm rather than returning an empty array: When a fallback is used, the response’s fallbackUsed field contains the name of the algorithm that ultimately produced the results.

Minimum results guarantee

Every recommendation response is topped up to at least 8 products (capped at the limit you request, and at the number of active products the store has), so a storefront never renders a multi-slot shelf with only one or two items. If the requested algorithm returns fewer than eight, the response is backfilled — in order — from what’s trending, what shoppers are viewing and adding to cart, the store’s featured products, and its newest arrivals. Backfilled items are de-duplicated and never include the product you anchored on. When a response has been topped up this way, fallbackUsed includes backfill.

Response Codes

This endpoint is POST and requires a Secret Key.