> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # ListAvailableAlgorithms # Package: recommendations # Namespace: RecommendationsService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/other-services/recommendations/recommendations/list-available-algorithms.md ## Permission Scopes: Read eCommerce - all read permissions: SCOPE.DC-ECOM-MEGA.READ-ECOM ## Introduction Returns a list of recommendation algorithms that can be used on a Wix site or project. These algorithms can be used with [Get Recommendation](https://dev.wix.com/docs/rest/api-reference/wix-e-commerce/recommendations/get-recommendation.md) to provide item recommendations to site visitors. Apps built by Wix may provide algorithms to support their own catalogs or catalogs from other apps installed on the same site. For an algorithm to be considered available and returned in this method's response, the following conditions must be met: 1. The app that provides the algorithm must be installed on the site. This is the app whose ID matches the algorithm's `appId`. 2. At least one app whose catalog is supported by the algorithm must be installed on the site. These are the apps whose IDs are in the algorithm's `catalogAppIds` array. App IDs for apps built by Wix are [listed here](https://dev.wix.com/docs/api-reference/articles/get-started/apps-created-by-wix.md). --- ## REST API ### Schema ``` Method: listAvailableAlgorithms Description: Returns a list of recommendation algorithms that can be used on a Wix site or project. These algorithms can be used with [Get Recommendation](https://dev.wix.com/docs/rest/api-reference/wix-e-commerce/recommendations/get-recommendation.md) to provide item recommendations to site visitors. Apps built by Wix may provide algorithms to support their own catalogs or catalogs from other apps installed on the same site. For an algorithm to be considered available and returned in this method's response, the following conditions must be met: 1. The app that provides the algorithm must be installed on the site. This is the app whose GUID matches the algorithm's `appId`. 2. At least one app whose catalog is supported by the algorithm must be installed on the site. These are the apps whose GUIDs are in the algorithm's `catalogAppIds` array. App GUIDs for apps built by Wix are [listed here](https://dev.wix.com/docs/api-reference/articles/get-started/apps-created-by-wix.md). URL: https://www.wixapis.com/v1/recommendations/algorithms Method: GET Return type: ListAvailableAlgorithmsResponse - name: availableAlgorithms | type: array | description: List of algorithms available for use on a site. - name: config | type: AlgorithmConfig | description: Algorithm configuration. - name: name | type: string | description: Algorithm name. This value is not translatable. - name: description | type: string | description: Algorithm description. This describes how the algorithm works and if it has any limitations regarding site content, number of items in the catalog, site traffic, and so on. This value is not translatable. - name: additionalInfo | type: string | description: A supplemental `description`. It can be used to help break up and organize information. You can, for example, display this information as a tooltip or as an additional section that is collapsed by default. - name: algorithmType | type: AlgorithmType | description: Algorithms may have the following types: * `RELATED_ITEMS` - This type of algorithm provides recommendations based on 1 or more other provided items. For example, when an item is added to a cart, the algorithm can suggest other items frequently bought together with that item. * `GLOBAL` - This type of algorithm provides general recommendations based on site or project statistics. For example, bestsellers or new arrivals. - enum: UNSPECIFIED, RELATED_ITEMS, GLOBAL - name: algorithmId | type: string | description: Algorithm GUID. This must be unique for a specific app but does not have to be unique across all apps on the site or in the project. - name: appId | type: string | description: GUID of the app that provides the algorithm. This can be an app built by Wix or a 3rd-party app. See app GUIDs for [apps built by Wix](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/platform/about-apps-created-by-wix.md). - name: catalogAppIds | type: array | description: IDs of apps with catalogs that this algorithm supports. This can be an app built by Wix or a 3rd-party app. See app GUIDs for [apps built by Wix](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/platform/about-apps-created-by-wix.md). ``` ### Examples ### ListAvailableAlgorithms ```curl ~~~cURL curl GET 'www.wixapis.com/ecom/v1/recommendations/algorithms' \ -H 'Content-Type: application/json;charset=UTF-8' \ -H 'Authorization: ' ~~~ ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.recommendations.RecommendationsService.listAvailableAlgorithms() Description: Returns a list of recommendation algorithms that can be used on a Wix site or project. These algorithms can be used with [Get Recommendation](https://dev.wix.com/docs/rest/api-reference/wix-e-commerce/recommendations/get-recommendation.md) to provide item recommendations to site visitors. Apps built by Wix may provide algorithms to support their own catalogs or catalogs from other apps installed on the same site. For an algorithm to be considered available and returned in this method's response, the following conditions must be met: 1. The app that provides the algorithm must be installed on the site. This is the app whose GUID matches the algorithm's `appId`. 2. At least one app whose catalog is supported by the algorithm must be installed on the site. These are the apps whose GUIDs are in the algorithm's `catalogAppIds` array. App GUIDs for apps built by Wix are [listed here](https://dev.wix.com/docs/api-reference/articles/get-started/apps-created-by-wix.md). Return type: PROMISE - name: availableAlgorithms | type: array | description: List of algorithms available for use on a site. - name: config | type: AlgorithmConfig | description: Algorithm configuration. - name: name | type: string | description: Algorithm name. This value is not translatable. - name: description | type: string | description: Algorithm description. This describes how the algorithm works and if it has any limitations regarding site content, number of items in the catalog, site traffic, and so on. This value is not translatable. - name: additionalInfo | type: string | description: A supplemental `description`. It can be used to help break up and organize information. You can, for example, display this information as a tooltip or as an additional section that is collapsed by default. - name: algorithmType | type: AlgorithmType | description: Algorithms may have the following types: * `RELATED_ITEMS` - This type of algorithm provides recommendations based on 1 or more other provided items. For example, when an item is added to a cart, the algorithm can suggest other items frequently bought together with that item. * `GLOBAL` - This type of algorithm provides general recommendations based on site or project statistics. For example, bestsellers or new arrivals. - enum: UNSPECIFIED, RELATED_ITEMS, GLOBAL - name: algorithmId | type: string | description: Algorithm GUID. This must be unique for a specific app but does not have to be unique across all apps on the site or in the project. - name: appId | type: string | description: GUID of the app that provides the algorithm. This can be an app built by Wix or a 3rd-party app. See app GUIDs for [apps built by Wix](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/platform/about-apps-created-by-wix.md). - name: catalogAppIds | type: array | description: IDs of apps with catalogs that this algorithm supports. This can be an app built by Wix or a 3rd-party app. See app GUIDs for [apps built by Wix](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/platform/about-apps-created-by-wix.md). ``` ### Examples ### listAvailableAlgorithms ```javascript import { recommendations } from '@wix/ecom'; async function listAvailableAlgorithms() { const response = await recommendations.listAvailableAlgorithms(); }; ``` ### listAvailableAlgorithms (with elevated permissions) ```javascript import { recommendations } from '@wix/ecom'; import { auth } from '@wix/essentials'; async function myListAvailableAlgorithmsMethod() { const elevatedListAvailableAlgorithms = auth.elevate(recommendations.listAvailableAlgorithms); const response = await elevatedListAvailableAlgorithms(); } ``` ### listAvailableAlgorithms (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { recommendations } from '@wix/ecom'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { recommendations }, // Include the auth strategy and host as relevant }); async function listAvailableAlgorithms() { const response = await myWixClient.recommendations.listAvailableAlgorithms(); }; ``` ---