Retrieve recommendations

Retrieves recommendations from selected AI models.

Usage

Required ACL: search
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require "algolia"

client = Algolia::RecommendClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")

response = client.get_recommendations(
  Algolia::Recommend::GetRecommendationsParams.new(
    requests: [
      Algolia::Recommend::RelatedQuery.new(
        index_name: "ALGOLIA_INDEX_NAME",
        algolia_object_id: "objectID",
        model: "related-products",
        threshold: 42.1
      )
    ]
  )
)
Did you find this page helpful?
Ruby API clients v3