Сourses

Courses

Security and Compliance

GDPR Compliance

Integration

Website integration

Getting API Recommendations

Receive product recommendations via API and use the resulting list of products to display them in recommendation blocks on your site.

To use the API recommendations:

  1. Install the JavaScript API on your site.
  2. Upload a product data feed to your eSputnik account.
  3. Request recommendations from the required pages using the JavaScript API.
  4. After receiving an array of products, set up the display of blocks on your side (appearance, placements, headings).

Connecting API Recommendations

1. Go to the Site → Recommendations tab and click the Create recommendation button.

Create recommendation

2. Select the Product data for API usage option

Product data for API usage

3. Choose the page type for your recommendations. Each type has different algorithms for product selection.

Recommendation types

4. Specify data source.

Data source
5. The system will generate a JavaScript function:

  1. Copy it to your JavaScript.
  2. Call the function when you need to get product recommendations.
  3. Use product data in your response at your discretion.
  4. Set up ProductImpression event transmission.

JavaScript function

Important!

In this recommendation type, the ProductImpression event is not automatically sent. Pass it when site visitors actually view the recommendation block. As parameters in the request, you need to pass the product ID and container_type, which were returned in the getRecommendations response.

In the general list of recommendations, API recommendations will be marked with the corresponding icon.

 API icon

The rest of the settings are common to all recommendations (note that for API recommendations, you don't need to configure the appearance, placements and titles in your eSputnik account, you need to do it on your side).

Any Questions?
We’re always happy to help!
Request a Callback
Fill in the form, and our specialists will call you back as soon as possible.
Request a Callback
Chat Support
We’re waiting for your questions!
Send a Chat Message
Email
Contact the eSputnik support team
Send an Email