post
https://{yourinstance}.makaira.io/recommendation
Retrieve recommended products
Fetches product recommendations based on a configured recommendation setup. Requires API authentication.
Request
POST /recommendation
Headers
| Header | Value |
|---|---|
Authorization | Bearer <token> |
Content-Type | application/json |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
recommendationId | string | Yes | Identifier of the recommendation configuration from the Makaira admin UI. |
query.shop_id | string | Yes | Shop identifier for multi-shop setups. |
query.language | string | Yes | Language code for the index to query (e.g. de, en). |
productId | string or array | No | Product ID(s) to base context-dependent recommendations on (e.g. "bought together"). The referenced products are excluded from the response. |
count | integer | No | Maximum number of recommendations to return. |
query.use_stock | boolean | No | When true, only returns in-stock products. |
oi.user.agent | string | No | User agent for Machine Learning personalization. |
oi.user.ip | string | No | User IP for Machine Learning personalization. |
oi.user.timezone | string | No | User timezone for Machine Learning personalization. |
fields | string | No | Comma-separated list of product fields to include in the response. |
enableHook | boolean | No | Set to false to skip configured search query hooks. Defaults to true. |
mergeFilter | boolean | No | When true, merges client-provided filters with the filters stored in the recommendation configuration. |
Example Request
{
"recommendationId": "homepage-recommendations",
"query.shop_id": "1",
"query.language": "de",
"count": 6
}Context-based recommendations
Pass productId to get related recommendations for a specific product (e.g. on a product detail page):
{
"recommendationId": "bought-together",
"query.shop_id": "1",
"query.language": "de",
"productId": "product-abc123",
"count": 4
}Response
Returns a JSON object with the recommended products grouped by recommendation ID.
200OK

