Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
The query methods allow you to fetch basic recommender data and does not require any sessions. Query operations are light and do not give you the benefit of personalization but can be used to fulfill simple use cases e.g. an in-store display that always shows the top 10 viewed products.
_The given example simply fetches products related to a given search term aliased as q_related
and also fetches the most viewed products within the last week.
Querying products gives access to Nosto's product catalogues current state. It can be useful for backend integration and verification purposes. It is not meant for online use purposes as it doesn't include any concepts related to user sessions or attribution, for those refer to GraphQL For Headless
The maximum number of products that can be paged over is capped at 10000. If you need to get around this limitation, we recommend adding more restrictive filters to narrow down the result set.
You can query identities using the GraphQL Identities endpoint. An "identity" is the personal information associated with an email address.
So long as you are able to specify the email address, you will be able to query the identity, its associated customer affinity and the personalized recommendations for that identity.
You can query orders using the GraphQL orders endpoint. So long as you are able to specify the order number or an external order reference, you will be able to query the order.
You can generic recommendations using the GraphQL orders endpoint. The recommendations offered here don't use sessions so they aren't personalized but still offer enough flexibility to support a multitude of use-cases.
The endpoint can be used to fetch toplist recommendations i.e. best-sellers. Toplists recommendations are either sorted by views or buys.
The endpoint can be used to fetch random recommendations i.e. previews. Random recommendations are a totally randomized selection of products and often used for testing purposes.
The endpoint can be used to fetch related recommendations i.e. cross-sellers. Cross-sell recommendations allow you fetch related products to a given set of products.
Example: If you were to use this to add recommendations to a product page, the productIds
parameter would be a single-item array containing the product identifiers of the product that is being viewed.
Example: If you were to use this to add recommendations to an order-follow email, the productIds
parameter would be an array containing the product identifiers of the products that were purchased.
The endpoint can be used to fetch recommendations related to a search term.
Example: If you were to use this to add recommendations to a search page, the term
parameter would be the entire search term as queries by the user.
Note: This endpoint cannot be used for building auto-complete style integrations.
In case some cases it is desired to filter products by their properties. include
and exclude
fields of primary
should be used to achieve this. The former will filter only the products that match the specified attribute, the later will filter out the products that match the attribute.
include
field expects a type of InputIncludeParams
, whose attributes are
exclude
field expect type InputFilterParams
whose attributes are:
Here is an example of a query including filters
Search GraphQL API uses different API endpoint. For more information see:
This documentation is only for the implementation of CM 1.0 and most likely this doc shouldn't be used anymore. If you'd like to implement CM 2.0, please check this . If you're not sure which version you'd like to implement, please contact your technical solutions manager or our support.
Nosto's category merchandising APIs are meant to be used for resorting your existing product listing pages. It has support for listing the products in the order defined within Nosto for different categories, including paging and filtering support. It doesn't support taking over the product listing pages fully as it doesn't include support for creating category specific filters and calculating their facet counts. The expected implementation leveraging these APIs would keep on using their current solution for building most of the product list pages, but swap the shown products with the information retrieved from this APIs results.
You can query using the query below:
Setting the addAttributionParameters
parameter to true
, causes attribution parameters to be automatically rendered in product URLs. For example, the url https://example.com/product
becomes https://example.com/product?nosto_source=cmp&nosto=5e5e09f060b232790cbbccbf
. These parameters allow our client script to track the performance of Category Merchandising results.
If you wish to handle attribution parameters manually, the addAttributionParameters
parameter can either be set to false
or can be omitted.
Product views resulting from clicking products of a category listing need to contain the required attribution parameters:
type
: VIEWED_PRODUCT
target
: (product id)
ref
: (resultId
from the category merchandising response)
refType
: CATEGORY_MERCHANDISING
For example, given the following category merchandising response:
If a customer clicks on Cool Kicks, the following GraphQL query should be sent to fetch the product's details and to attribute the product view to the category merchandising result:
Graphql calls using Category Merchandising methods are treated as a category view by default. This behavior can be changed by including skipVCEvent: true
into the graphql request. All product URLs on a category page must be appended with #nosto\_cmp
fragment. An example of such a product URL would be www.test-store.com/product1#nosto\_cmp
where #nosto\_cmp
is the added fragment.
The batchToken
can be used the next batch of results. This is useful if you only wish to fetch the first 10 products when there may be thousands of results. To fetch the next batch, use the batchToken
in the next query like in the example below:
If you wish to skip the first number of pages, you can use the skipPages
parameter instead of the batchToken
. A page size is calculated from the maxProducts
parameter.
The attributes associated with an identity can be used to segment users. This works similarly to how the attributes can be leveraged .
In order to be able to provide personalized results, we will need to look up a session either by id or by reference. You read more about managing sessions on our wiki page.
Results can be filtered by specifying the include and exclude parameters. You can explore more parameters in the