Recommend & Insights APIs and UI Library for JavaScript

Recommend API for JavaScript

Recommend & Insights APIs and UI Library for JavaScript

Sign up

Features

  • Fully integrated into Algolia’s Analytics and Insights API

  • Finds items Frequently Bought Together and Related Products

  • Applies to ecommerce, media, back office, and any other domain

  • Leverages your data and user interactions / analytics to create ML models

  • Comes with filtering and control over confidence thresholds   

  • Perfectly compatible with Algolia’s Search APIs and InstantSearch

  • Comes with a front end library

Version

  • Works in node and all browsers (including IE11+)

Related Integrations

  • InstantSearch for React, Vue, Angular, vanilla 
  • Search APIs

Get started

  • Send Events using Insights
    1
    aa('clickedObjectIDs', {
    2
      userToken: string,
    3
      index: string,
    4
      eventName: string,
    5
      objectIDs: array
    6
    });
    7
    8
    aa('convertedObjectIDs', {
    9
      userToken: string,
    10
      index: string,
    11
      eventName: string,
    12
      objectIDs: array
    13
    });
  • Get Recommendations - API
    1
    client.getRelatedProducts([
    2
      {
    3
        indexName: 'your_index_name',
    4
        objectID: 'your_object_id',
    5
      },
    6
    ])
    7
    .then(({ results }) => {
    8
      console.log(results);
    9
    })
    10
    .catch(err => {
    11
      console.log(err);
    12
    });
  • Display Recommendations - Front End
    1
    <!--HTML-->
    2
    <div class="relatedProducts"></div>
    3
    4
    // JavaScript
    5
    function RelatedItem({ item }) {
    6
      return (
    7
        <a href={item.url}>
    8
          <img src={item.image_link} alt={item.name} />
    9
          <div>{item.category}</div>
    10
          <div>{item.name}</div>
    11
          <div>${item.price}</div>
    12
        </a>
    13
      );
    14
    }
    15
    16
    relatedProducts({
    17
      container: '#relatedProducts',
    18
      recommendClient,
    19
      indexName,
    20
      objectIDs: [currentObjectID],
    21
      itemComponent: RelatedItem,
    22
    });
Get started for free
Explore developer docs