Guide

Query Functions

1min

Query functions are basic building blocks of requests to Klevu backend. Any amount of them can be placed inside a KlevuFetch function as parameters. It is recommended to use multiple query functions inside KlevuFetch instead of multiple KlevuFetch functions.

Here is list of query functions available. Full listing with code reference can be found from @klevu/core reference.

Klevu Function

Description

Type

search()

Most basic query to find items based on a term

Search

suggestions()

Fetches suggestions based on a term.

Search

trendingProducts()

Find all products that are trending right now in results

Search

categoryMerchandising()

Products to display on category page

Search

searchCategory()

Search categories based on term

Search

searchCms()

Search CMS pages based on term

Search

products()

Fetches products by id from Klevu

Search

raw()

Write raw request to Klevu api. For expert use

Search

recentlyViewedProducts()

List of products user has recently viewed

Search







kmcRecommendation()

Fetches predefined recommendation by id from KMC and creates query automatically

Recommendation

newArrivals()

Recommendation list of new arrivals for the current user

Recommendation

trendingCategoryProducts()

Trending recommendation based for current user

Recommendation

similarProducts()

Fetch similar products based on given ids

Recommendation

alsoViewed()

Product recommendations what user should also check out

Recommendation

boughTogether()

On checkout page check what products are recommended to current cart products

Recommendation



Updated 30 Oct 2023
Did this page help you?