Get Recommendations

Retrieve product recommendations from a recommendation scenario.

📘 Prerequisites

Before you can retrieve product recommendations, complete the Recommendation API prerequisites.

get/app/{app_id}/scenarios/{scenario_id}/recommendation

Request

  • Base URL
    https://recommendation.jp.aiqua.io/api/v1.0
  • URL
    https://recommendation.jp.aiqua.io/api/v1.0/app/{app_id}/scenarios/{scenario_id}/recommendation
  • Auth
    none required

Path parameters

app_idstring required
Example:<YOUR_APP_ID>

Your AIQUA app ID.

scenario_idstring required
Example:<YOUR_SCENARIO_ID>

The recommendation scenario's ID.

Query parameters

user_idstring required
Example:<USER_ID>

Required. The user_id of the user being served recommendations.

num_itemsinteger
Example:20

The number of recommended products to return. Valid values are 1 to 50. Default: 20.

filterstring
Example:<FILTER>

Optional. A <a href="https://developer.mozilla.org/en-US/docs/Glossary/percent-encoding" target="_blank">percent-encoded</a> JSON object specifying filtering rules to apply to the recommendation results. Only products that satisfy the filtering rules are returned.

To learn more about creating recommendation filters, see Defining API filtering rules.

Before percent-encoding, the filter object has the following structure:

{
  "version": 2,
  "filterRule": {
    "operator": "OR",
    "ruleList": [
      {
        "operator": "OR",
        "conditionList": [
          {
            "key": "category",
            "operator": "in",
            "value": ["3C", "Life"]
          }
        ]
      }
    ]
  }
}
categorystring
Example:<CATEGORY>

Only required when using Category Hot Items models.

The category name is case sensitive. The value must be a left-to-right prefix of the product's category. For example, if a product's category is "Woman's > Pants > Blue Jeans":

  • "Blue Jeans": doesn't match
  • "Pants > Blue Jeans": doesn't match
  • "Woman's > Pants": matches
  • "Woman's > Pants > Blue Jeans": matches

If the category name includes special characters, it must be <a href="https://developer.mozilla.org/en-US/docs/Glossary/percent-encoding" target="_blank">percent-encoded</a>.

product_idstring
Example:<PRODUCT_ID>

The product ID as specified in your product data feed. Required for some recommendation models. See Recommendation model reference for a list of all recommendation models and their required parameters.

Response

Success

recIdstring

Used to track recommendation scenario analytics on the AIQUA dashboard.

scenarioIdstring

Used to track recommendation scenario analytics on the AIQUA dashboard.

modelIdstring

Used to track recommendation scenario analytics on the AIQUA dashboard.

expTypestring
respCodestring

Example response

{
  "items": [
    {
      "productId": "TEST_SKU_16",
      "position": 2,
      "image": "<IMAGE_URL>",
      "title": "Mobile_16",
      "description": "hTC",
      "customLabel00": "Foo's bar",
      "customLabel01": "false",
      "customLabel02": "-10",
      "customLabel03": "200.65",
      "url": "<PRODUCT_URL>",
      "category": "3C > Mobile",
      "currency": "TWD",
      "price": "5999",
      "originalPrice": "5999",
      "order": "PRIMARY"
    }
  ],
  "recId": "8c4d2657-5a0e-4b77-aa25-e22fa5ba5633",
  "scenarioId": "Aj2MMx5KHzPau2pv4aQ26i",
  "modelId": "5",
  "expType": "normal",
  "respCode": "1000"
}

Changes

No recorded changes to this operation across all 1 revision of this API.