BEST SELLER product list code in shopify

censoftg71
Shopify Partner
6 0 1

Hello,

I'm a new to shopify and i'm developing the shopify . I want to know about the BEST SELLER product list code because i have used many code but the products are not fetching best seller.so please provide me code for fetching the best seller product.
I'm using CLassic theme.

Thanks in advance.

0 Likes
Busfox
Shopify Staff
Shopify Staff
619 49 95

Hi there,

Retrieving a list of best selling products through the API is something that will have to be done on your end using either the Analytics API or looking through line items on orders using the Order API. You'll need to keep a record of this, and potentially listen to order webhooks to keep your records current.

0 Likes
kalitas
Tourist
6 0 1

But Analytics API must be run from the embedded API (now called Bridge, it is app which run inside the dashboard of the admin of a store ) so probably it is not relevant. you left with only the Order API

0 Likes
vertalm
New Member
3 0 0
collectionByHandle(handle: "{$collectionHandle}") {
title
productsCount
products(first: {$steps}) {
edges {
cursor
node {
title
id
}
}
}
}
0 Likes