Techdocs
Search…
Using Queries
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.
1
curl -0 -v -X POST https://api.nosto.com/v1/graphql \
2
-u ":<token>" \
3
-H 'Content-Type: application/graphql' \
4
-d @- << EOF
5
query {
6
recos (preview: false, image: VERSION_7_200_200) {
7
hot_now: toplist(hours: 168, sort: VIEWS, params: {
8
minProducts: 1
9
maxProducts: 10
10
}) {
11
primary {
12
name
13
productId
14
}
15
}
16
q_related: search(term: "black", params: {
17
minProducts: 1
18
maxProducts: 10
19
}) {
20
primary {
21
name
22
productId
23
}
24
}
25
}
26
}
27
EOF
Copied!
Last modified 1yr ago
Copy link