Get product recommendations
AI-powered product recommendations. Supported types:
- similar: Products similar to a given product
- also-bought: Frequently purchased together. Each item indicates whether it is a complement (commonly bought alongside) or an alternative.
- next: The products a shopper is most likely to view or add next, given what they have
viewed/added in the current session. Pass
sessionId(the worker anchors on the shopper’s most recent product this session) and/or an explicitproductIdanchor. Falls back to also-bought, then trending, when there is no session signal. - trending: Currently trending products
- new: Recently added products
- personalized: Based on a customer’s preferences
- bundle: Bundle suggestions. Items that complement the product are surfaced ahead of alternatives.
Minimum results. Every response is topped up to at least 8 products (capped at limit,
and at the number of active products in the store), so a storefront shelf never renders with
only one or two items. When the requested algorithm returns fewer than eight, the response is
backfilled — in order — from trending, engagement signals (views/adds-to-cart), featured
products, and newest arrivals, de-duplicated and excluding the anchor product; fallbackUsed
then includes backfill.
⚠️ SECRET KEY REQUIRED
This endpoint requires a secret key (tybrite_sk_*). Publishable keys will return 403 Forbidden.
Why Secret Key? Recommendation generation uses computational resources and accesses machine learning models that should be protected from unauthorized use. This prevents abuse and ensures fair resource allocation.
Marketplace operator keys. With a marketplace operator key, recommendations are computed
across all merchants in the marketplace; supported types: trending, new, also-bought,
similar, personalized, bundle, next. Each item is stamped with its source merchant
(merchant_store_id).
Authorizations
API Key Authentication
Use your API key in the Authorization header:
Key Types:
Secret Keys (Server-Side Only):
- Format:
tybrite_sk_live_*(production) ortybrite_sk_test_*(sandbox) - Full read/write access to all endpoints
- ⚠️ NEVER expose in client-side code or public repositories
- Required for: write operations, authentication, payment verification, AI recommendations
Publishable Keys (Client-Safe):
- Format:
tybrite_pk_live_*(production) ortybrite_pk_test_*(sandbox) - Read-only access (GET requests only, plus POST semantic search)
- ✅ Safe for client-side JavaScript, mobile apps, and public code
- Allowed for: browsing products, search, CMS content, pricing queries
Endpoint-Specific Requirements:
- Authentication endpoints (
/v1/auth/*): Secret key required - Payment verification (
POST /v1/payments/verify): Secret key required - AI Recommendations (
POST /v1/recommendations): Secret key required - Semantic Search (
POST /v1/search): Both key types allowed (read-only operation) - All write operations: Secret key required
- All read operations: Both key types allowed
Using a publishable key for restricted operations returns 403 Forbidden.
Body
similar, also-bought, next, trending, new, personalized, bundle Required when type is similar, also-bought, or bundle. For next, an optional explicit anchor. Must reference an existing product in the store; otherwise 404 is returned.
Used with type next. The shopper's current session identifier; the most recent product viewed/added in that session is used as the anchor when productId is not supplied.
Optional for personalized. When omitted, the response falls back to trending recommendations.
1 <= x <= 50
