Recommend API client methods
This is documentation for v3 of the PHP API clients, which is not the latest version. To see the documentation for the latest version, see PHP v4.
This is documentation for v2 of the Ruby API clients, which is not the latest version. To see the documentation for the latest version, see Ruby v3.
This is documentation for v4 of the JavaScript API clients, which is not the latest version. To see the documentation for the latest version, see JavaScript v5.
This is documentation for v3 of the Python API clients, which is not the latest version. To see the documentation for the latest version, see Python v4.
This is documentation for v8 of the Swift API clients, which is not the latest version. To see the documentation for the latest version, see Swift v9.
This is documentation for v2 of the Kotlin API clients, which is not the latest version. To see the documentation for the latest version, see Kotlin v3.
This is documentation for v6 of the C# API clients, which is not the latest version. To see the documentation for the latest version, see C# v7.
This is documentation for v3 of the Java API clients, which is not the latest version. To see the documentation for the latest version, see Java v4.
This is documentation for v3 of the Go API clients, which is not the latest version. To see the documentation for the latest version, see Go v4.
This is documentation for v1 of the Scala API clients, which is not the latest version. To see the documentation for the latest version, see Scala v2.
Get frequently bought together |
Retrieve frequently bought together items for a set of |
Get related products |
Retrieve related products or related content for a set of |
Get trending items |
Retrieve global trending items. |
Get trending facets |
Retrieve trending facet values for a specific facet attribute. |
Get looking similar |
Retrieve similar looking recommendations for an |
Get recommendations |
Get recommendations from any Algolia recommendation model. |
You’re billed per Recommend request, not per HTTP request. Combining Recommend requests in HTTP requests doesn’t reduce the cost. For example, five HTTP requests containing a total of five Recommend requests costs the same as one HTTP request containing five Recommend requests.
Install
The Algolia Recommend client is separate from the search client. You can install it from npm.
1
npm install @algolia/recommend
If you don’t use a package manager, you can include this snippet in your HTML:
1
2
3
4
<script src="https://cdn.jsdelivr.net/npm/@algolia/recommend"></script>
<script>
const algoliarecommend = window['@algolia/recommend'];
</script>
Initialize the client
1
2
3
var client = new RecommendClient(
new RecommendConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")
);